Skip to content

Commit 34dfbfa

Browse files
authored
ci: add DB to PR deploys (coder#8770)
* ci: add DB to PR deploys * add bitnami remo * fix namespace * change ingress host * remove wildcard host
1 parent 975424b commit 34dfbfa

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/pr-deploy.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,18 @@ jobs:
198198
EOF
199199
kubectl apply -f ingress.yaml
200200
201+
- name: Set up PostgreSQL database
202+
run: |
203+
helm repo add bitnami https://charts.bitnami.com/bitnami
204+
helm install coder-db bitnami/postgresql \
205+
--namespace pr${{ env.PR_NUMBER }} \
206+
--set auth.username=coder \
207+
--set auth.password=coder \
208+
--set auth.database=coder \
209+
--set persistence.size=10Gi
210+
kubectl create secret generic coder-db-url -n pr${{ env.PR_NUMBER }} \
211+
--from-literal=url="postgres://coder:coder@coder-db-postgresql.pr${{ env.PR_NUMBER }}.svc.cluster.local:5432/coder?sslmode=disable"
212+
201213
- name: Create values.yaml
202214
run: |
203215
cat <<EOF > pr-deploy-values.yaml
@@ -215,6 +227,11 @@ jobs:
215227
value: "*--pr${{ env.PR_NUMBER }}.${{ secrets.PR_DEPLOYMENTS_DOMAIN }}"
216228
- name: "CODER_EXPERIMENTS"
217229
value: "*"
230+
- name: CODER_PG_CONNECTION_URL
231+
valueFrom:
232+
secretKeyRef:
233+
name: coder-db-url
234+
key: url
218235
- name: "CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS"
219236
value: "true"
220237
- name: "CODER_OAUTH2_GITHUB_CLIENT_ID"

0 commit comments

Comments
 (0)