Skip to content

Commit

Permalink
Merge pull request #429 from bcgov/deploy-with-cert
Browse files Browse the repository at this point in the history
testing deploy with certificates.
  • Loading branch information
roblo-cgi authored Sep 25, 2023
2 parents 8ff54f3 + 6eacd46 commit 23b6dd0
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-openshift-frontend-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
oc tag ${{ steps.push-image-frontend.outputs.registry-path }} ${{ env.REPO_NAME }}-${{ env.APP_NAME_FRONTEND }}-${{ env.BRANCH }}:${{ env.TAG }}
# Process and apply deployment template
oc process -f tools/openshift/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p BRANCH=${{ env.BRANCH }} \
oc process -f tools/openshift/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p BRANCH=${{ env.BRANCH }} -p CA_CERT="${{ env.CA_CERT }}" -p CERTIFICATE="${{ env.CERTIFICATE }}" -p PRIVATE_KEY="${{ env.PRIVATE_KEY }}" \
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
-p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }} \
| oc apply -f -
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-openshift-frontend-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_FRONTEND }}-${{ env.BRANCH }}:${{ steps.get-latest-tag.outputs.tag }} ${{ env.NAMESPACE }}-prod/${{ env.REPO_NAME }}-${{ env.APP_NAME_FRONTEND }}-${{ env.BRANCH }}:${{ steps.get-latest-tag.outputs.tag }}
# Process and apply deployment template
oc process -f tools/openshift/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p BRANCH=${{ env.BRANCH }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} -p TAG=${{ steps.get-latest-tag.outputs.tag }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\
oc process -f tools/openshift/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p BRANCH=${{ env.BRANCH }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} -p TAG=${{ steps.get-latest-tag.outputs.tag }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }} -p CA_CERT="${{ env.CA_CERT }}" -p CERTIFICATE="${{ env.CERTIFICATE }}" -p PRIVATE_KEY="${{ env.PRIVATE_KEY }}" \
| oc apply -f -
# Start rollout (if necessary) and follow it
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-openshift-frontend-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_FRONTEND }}-${{ env.BRANCH }}:${{ steps.get-latest-tag.outputs.tag }} ${{ env.NAMESPACE }}-test/${{ env.REPO_NAME }}-${{ env.APP_NAME_FRONTEND }}-${{ env.BRANCH }}:${{ steps.get-latest-tag.outputs.tag }}
# Process and apply deployment template
oc process -f tools/openshift/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p BRANCH=${{ env.BRANCH }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} -p TAG=${{ steps.get-latest-tag.outputs.tag }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }}\
oc process -f tools/openshift/frontend.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p BRANCH=${{ env.BRANCH }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} -p TAG=${{ steps.get-latest-tag.outputs.tag }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} -p HOST_ROUTE=${{ env.HOST_ROUTE }} -p CA_CERT="${{ env.CA_CERT }}" -p CERTIFICATE="${{ env.CERTIFICATE }}" -p PRIVATE_KEY="${{ env.PRIVATE_KEY }}" \
| oc apply -f -
# Start rollout (if necessary) and follow it
Expand Down
42 changes: 21 additions & 21 deletions tools/openshift/backend.dc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,27 +110,27 @@ objects:
selector:
app: "${APP_NAME}-${BRANCH}"
deploymentconfig: "${APP_NAME}-backend"
# - apiVersion: v1
# kind: Route
# metadata:
# annotations:
# openshift.io/host.generated: 'true'
# labels:
# app: "${APP_NAME}-${BRANCH}"
# name: "${APP_NAME}-backend"
# spec:
# host: "${HOST_ROUTE}"
# path: /api
# port:
# targetPort: 8080-tcp
# tls:
# insecureEdgeTerminationPolicy: Redirect
# termination: edge
# to:
# kind: Service
# name: "${APP_NAME}-backend"
# weight: 100
# wildcardPolicy: None
- apiVersion: v1
kind: Route
metadata:
annotations:
openshift.io/host.generated: 'true'
labels:
app: "${APP_NAME}-${BRANCH}"
name: "${APP_NAME}-backend"
spec:
host: "${HOST_ROUTE}"
path: /api
port:
targetPort: 8080-tcp
tls:
insecureEdgeTerminationPolicy: Redirect
termination: edge
to:
kind: Service
name: "${APP_NAME}-backend"
weight: 100
wildcardPolicy: None
- apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
Expand Down
64 changes: 32 additions & 32 deletions tools/openshift/frontend.dc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,29 +100,29 @@
selector:
app: "${APP_NAME}-${BRANCH}"
deploymentconfig: "${APP_NAME}-frontend"
# - apiVersion: v1
# kind: Route
# metadata:
# annotations:
# openshift.io/host.generated: 'true'
# labels:
# app: "${APP_NAME}-${BRANCH}"
# name: "${APP_NAME}-frontend-https"
# spec:
# host: "${HOST_ROUTE}"
# port:
# targetPort: 2015-tcp
# tls:
# caCertificate: "${CA_CERT}"
# certificate: "${CERTIFICATE}"
# insecureEdgeTerminationPolicy: Redirect
# key: "${PRIVATE_KEY}"
# termination: edge
# to:
# kind: Service
# name: "${APP_NAME}-frontend-${BRANCH}"
# weight: 100
# wildcardPolicy: None
- apiVersion: v1
kind: Route
metadata:
annotations:
openshift.io/host.generated: 'true'
labels:
app: "${APP_NAME}-${BRANCH}"
name: "${APP_NAME}-frontend-https"
spec:
host: "${HOST_ROUTE}"
port:
targetPort: 2015-tcp
tls:
caCertificate: "${CA_CERT}"
certificate: "${CERTIFICATE}"
insecureEdgeTerminationPolicy: Redirect
key: "${PRIVATE_KEY}"
termination: edge
to:
kind: Service
name: "${APP_NAME}-frontend"
weight: 100
wildcardPolicy: None
- apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
Expand Down Expand Up @@ -179,12 +179,12 @@
- name: MAX_MEM
description: The maximum amount of memory
required: true
# - name: CA_CERT
# description: The CA Certificate
# required: true
# - name: CERTIFICATE
# description: The Certificate
# required: true
# - name: PRIVATE_KEY
# description: The private key
# required: true
- name: CA_CERT
description: The CA Certificate
required: true
- name: CERTIFICATE
description: The Certificate
required: true
- name: PRIVATE_KEY
description: The private key
required: true

0 comments on commit 23b6dd0

Please sign in to comment.