File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -188,14 +188,14 @@ jobs:
188
188
run : |
189
189
# Using kubectl to check if a Certificate resource already exists
190
190
# we are doing this to avoid letsenrypt rate limits
191
- if ! kubectl get certificate pr${{ env.PR_NUMBER }}-tls -n pr${{ env.PR_NUMBER }} > /dev/null 2>&1; then
191
+ if ! kubectl get certificate pr${{ env.PR_NUMBER }}-tls -n pr-deployment-certs > /dev/null 2>&1; then
192
192
echo "Certificate doesn't exist. Creating a new one."
193
193
cat <<EOF | kubectl apply -f -
194
194
apiVersion: cert-manager.io/v1
195
195
kind: Certificate
196
196
metadata:
197
197
name: pr${{ env.PR_NUMBER }}-tls
198
- namespace: pr${{ env.PR_NUMBER }}
198
+ namespace: pr-deployment-certs
199
199
spec:
200
200
secretName: pr${{ env.PR_NUMBER }}-tls
201
201
issuerRef:
@@ -206,7 +206,9 @@ jobs:
206
206
- "*.${{ env.PR_DEPLOYMENT_ACCESS_URL }}"
207
207
EOF
208
208
else
209
- echo "Certificate exists."
209
+ echo "Certificate exists. Skipping certificate creation."
210
+ echo "Copy certificate from pr-deployment-certs to pr${{ env.PR_NUMBER }} namespace"
211
+ kubectl get secret pr${{ env.PR_NUMBER }}-tls -n pr-deployment-certs -o yaml | sed 's/pr-deployment-certs/pr${{ env.PR_NUMBER }}/g' | kubectl apply -f -
210
212
fi
211
213
212
214
- name : Set up PostgreSQL database
You can’t perform that action at this time.
0 commit comments