@@ -152,11 +152,11 @@ jobs:
152
152
153
153
- name : Setup ingress
154
154
run : |
155
- echo <<EOF
155
+ cat <<EOF > ingress.yaml
156
156
apiVersion: networking.k8s.io/v1
157
157
kind: Ingress
158
158
metadata:
159
- name: pr${{ env.PR_NUMBER }}-ingress
159
+ name: pr${{ env.PR_NUMBER }}
160
160
namespace: pr${{ env.PR_NUMBER }}
161
161
annotations:
162
162
cert-manager.io/cluster-issuer: letsencrypt-prod
@@ -176,7 +176,7 @@ jobs:
176
176
name: coder
177
177
port:
178
178
number: 80
179
- EOF > ingress.yaml
179
+ EOF
180
180
kubectl apply -f ingress.yaml
181
181
182
182
- name : Install Helm chart
@@ -189,35 +189,25 @@ jobs:
189
189
--set coder.serviceAccount.enableDeployments=true \
190
190
--set coder.env[0].name=CODER_ACCESS_URL \
191
191
--set coder.env[0].value="https://pr${{ env.PR_NUMBER }}.${{ secrets.PR_DEPLOYMENTS_DOMAIN }}" \
192
- --set coder.env[1].name=CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS \
193
- --set coder.env[1].value=true \
194
- --set coder.env[2].name=CODER_OAUTH2_GITHUB_CLIENT_ID \
195
- --set coder.env[2].value=${{ secrets.PR_DEPLOYMENTS_GITHUB_OAUTH_CLIENT_ID }} \
196
- --set coder.env[3].name=CODER_OAUTH2_GITHUB_CLIENT_SECRET \
197
- --set coder.env[3].value=${{ secrets.PR_DEPLOYMENTS_GITHUB_OAUTH_CLIENT_SECRET }} \
198
- --set coder.env[4].name=CODER_OAUTH2_GITHUB_ALLOWED_ORGS \
199
- --set coder.env[4].value=coder \
200
192
# Uncomment this when https://github.com/coder/coder/issues/8714 is resolved
193
+ # --set coder.env[1].name=CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS \
194
+ # --set coder.env[1].value=true \
195
+ # --set coder.env[2].name=CODER_OAUTH2_GITHUB_CLIENT_ID \
196
+ # --set coder.env[2].value=${{ secrets.PR_DEPLOYMENTS_GITHUB_OAUTH_CLIENT_ID }} \
197
+ # --set coder.env[3].name=CODER_OAUTH2_GITHUB_CLIENT_SECRET \
198
+ #--set coder.env[3].value=${{ secrets.PR_DEPLOYMENTS_GITHUB_OAUTH_CLIENT_SECRET }} \
199
+ #--set coder.env[4].name=CODER_OAUTH2_GITHUB_ALLOWED_ORGS \
200
+ #--set coder.env[4].value=coder \
201
201
# --set coder.env[5].name=CODER_OAUTH2_GITHUB_REDIRECT_URI \
202
202
# --set coder.env[5].value="https://pr${{ env.PR_NUMBER }}.${{ secrets.PR_DEPLOYMENTS_DOMAIN }}/gitauth/github/callback \
203
203
--force
204
204
205
- - name : Get deployment URL
206
- id : deployment_url
207
- run : |
208
- set -euo pipefail
209
- kubectl rollout status deployment/coder --namespace "pr${{ env.PR_NUMBER }}"
210
- POD_NAME=$(kubectl get pods -n "pr${{ env.PR_NUMBER }}" | awk 'NR==2{print $1}')
211
- CODER_ACCESS_URL=$(kubectl logs $POD_NAME -n "pr${{ env.PR_NUMBER }}" | grep "Web UI:" | awk -F ':' '{print $2":"$3}' | awk '{$1=$1};1')
212
- echo "::add-mask::$CODER_ACCESS_URL"
213
- echo "CODER_ACCESS_URL=$CODER_ACCESS_URL" >> $GITHUB_OUTPUT
214
-
215
205
- name : Install coder-logstream-kube
216
206
run : |
217
207
helm repo add coder-logstream-kube https://helm.coder.com/logstream-kube
218
- helm install coder-logstream-kube coder-logstream-kube/coder-logstream-kube \
208
+ helm upgrade -- install coder-logstream-kube coder-logstream-kube/coder-logstream-kube \
219
209
--namespace "pr${{ env.PR_NUMBER }}" \
220
- --set url="${{ steps.deployment_url.outputs.CODER_ACCESS_URL }}"
210
+ --set url="https://pr ${{ env.PR_NUMBER }}.${{ secrets.PR_DEPLOYMENTS_DOMAIN }}"
221
211
222
212
- name : Send Slack notification
223
213
run : |
@@ -226,7 +216,7 @@ jobs:
226
216
"pr_number": "'"${{ env.PR_NUMBER }}"'",
227
217
"pr_url": "'"${{ env.PR_URL }}"'",
228
218
"pr_title": "'"${{ env.PR_TITLE }}"'",
229
- "pr_access_url": "'"${{ steps.deployment_url.outputs.CODER_ACCESS_URL }}"'" }' ${{ secrets.PR_DEPLOYMENTS_SLACK_WEBHOOK }}
219
+ "pr_access_url": "'"https://pr ${{ env.PR_NUMBER }}.${{ secrets.PR_DEPLOYMENTS_DOMAIN }}"'" }' ${{ secrets.PR_DEPLOYMENTS_SLACK_WEBHOOK }}
230
220
echo "Slack notification sent"
231
221
232
222
- name : Comment on PR
@@ -237,6 +227,6 @@ jobs:
237
227
comment-id : ${{ needs.pr_commented.outputs.COMMENT_ID }}
238
228
body : |
239
229
:heavy_check_mark: Deployed PR ${{ env.PR_NUMBER }} successfully.
240
- :rocket: Access the deployment link [here](https://codercom.slack.com/archives/C05DNE982E8 ).
230
+ :rocket: Access the deployment link [here](${{ secrets.PR_DEPLOYMENTS_SLACK_CHANNEL_URL }} ).
241
231
:warning: This deployment will be deleted when the PR is closed.
242
232
reactions : " +1"
0 commit comments