-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted DeploymentConfig to Deployment
- Loading branch information
Showing
6 changed files
with
100 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,8 @@ env: | |
IMAGE_REGISTRY_USER: ${{ github.actor }} | ||
IMAGE_REGISTRY_PASSWORD: ${{ github.token }} | ||
|
||
SPRING_BOOT_IMAGE_NAME: educ-grad-trax-api-dc | ||
SPRING_BOOT_IMAGE_NAME: educ-grad-trax-api | ||
|
||
REPO_NAME: "educ-grad-trax-api" | ||
APP_DOMAIN: ${{ vars.APP_DOMAIN }} | ||
BRANCH: "grad-release" | ||
|
@@ -108,16 +109,23 @@ jobs: | |
oc login --token=${{ env.OPENSHIFT_TOKEN }} --server=${{ env.OPENSHIFT_SERVER }} | ||
oc project ${{ env.OPENSHIFT_NAMESPACE }} | ||
# Cancel any rollouts in progress | ||
oc rollout cancel dc/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
oc rollout cancel deployment/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
|| true && echo "No rollout in progress" | ||
# tag image stream | ||
oc -n ${{ env.OPENSHIFT_NAMESPACE }} tag ${{ steps.push-image.outputs.registry-path }} ${{ env.REPO_NAME }}:${{ env.TAG }} | ||
# Process and apply deployment template | ||
oc process -f tools/openshift/api.dc.yaml -p IS_NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} -p REPO_NAME=${{ env.REPO_NAME }} \ | ||
-p TAG_NAME=${{ env.TAG }} -p HOST_ROUTE=${{ env.REPO_NAME }}-${{ env.OPENSHIFT_NAMESPACE }}.${{ env.APP_DOMAIN }} \ | ||
-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 }} | oc apply -f - | ||
oc process -f tools/openshift/api.dc.yaml \ | ||
-p IS_NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \ | ||
-p REPO_NAME=${{ env.REPO_NAME }} \ | ||
-p TAG_NAME=${{ env.TAG }} \ | ||
-p HOST_ROUTE=${{ env.REPO_NAME }}-${{ env.OPENSHIFT_NAMESPACE }}.${{ env.APP_DOMAIN }} \ | ||
-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 }} | oc apply -f - | ||
# UPDATE Configmaps | ||
curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ github.event.inputs.choice }}/tools/config/update-configmap.sh \ | ||
|
@@ -144,14 +152,13 @@ jobs: | |
${{ secrets.STUDENT_ADMIN_URL_ROOT }} | ||
# Start rollout (if necessary) and follow it | ||
oc rollout latest dc/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
|| true && echo "Rollout in progress" | ||
oc logs -f dc/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
oc rollout restart deployment/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
# Get status, returns 0 if rollout is successful | ||
oc rollout status dc/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
oc rollout status deployment/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
# now hit it with a zap scan | ||
- name: ZAP Scan | ||
uses: zaproxy/[email protected] | ||
with: | ||
target: 'https://${{ env.REPO_NAME }}-${{ env.OPENSHIFT_NAMESPACE }}.apps.silver.devops.gov.bc.ca/api/v1/api-docs' | ||
target: 'https://${{ env.REPO_NAME }}-${{ env.OPENSHIFT_NAMESPACE }}.apps.silver.devops.gov.bc.ca/api/v1/api-docs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ env: | |
IMAGE_REGISTRY_USER: ${{ github.actor }} | ||
IMAGE_REGISTRY_PASSWORD: ${{ github.token }} | ||
|
||
SPRING_BOOT_IMAGE_NAME: educ-grad-trax-api-dc | ||
SPRING_BOOT_IMAGE_NAME: educ-grad-trax-api | ||
|
||
REPO_NAME: "educ-grad-trax-api" | ||
APP_DOMAIN: ${{ vars.APP_DOMAIN }} | ||
|
@@ -96,16 +96,23 @@ jobs: | |
oc login --token=${{ env.OPENSHIFT_TOKEN }} --server=${{ env.OPENSHIFT_SERVER }} | ||
oc project ${{ env.OPENSHIFT_NAMESPACE }} | ||
# Cancel any rollouts in progress | ||
oc rollout cancel dc/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
oc rollout cancel deployment/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
|| true && echo "No rollout in progress" | ||
# tag image stream | ||
oc -n ${{ env.OPENSHIFT_NAMESPACE }} tag ${{ steps.push-image.outputs.registry-path }} ${{ env.REPO_NAME }}:${{ env.TAG }} | ||
# Process and apply deployment template | ||
oc process -f tools/openshift/api.dc.yaml -p IS_NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} -p REPO_NAME=${{ env.REPO_NAME }} \ | ||
-p TAG_NAME=${{ env.TAG }} -p HOST_ROUTE=${{ env.REPO_NAME }}-${{ env.OPENSHIFT_NAMESPACE }}.${{ env.APP_DOMAIN }} \ | ||
-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 }} | oc apply -f - | ||
oc process -f tools/openshift/api.dc.yaml \ | ||
-p IS_NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \ | ||
-p REPO_NAME=${{ env.REPO_NAME }} \ | ||
-p TAG_NAME=${{ env.TAG }} \ | ||
-p HOST_ROUTE=${{ env.REPO_NAME }}-${{ env.OPENSHIFT_NAMESPACE }}.${{ env.APP_DOMAIN }} \ | ||
-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 }} | oc apply -f - | ||
# UPDATE Configmaps | ||
curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/tools/config/update-configmap.sh \ | ||
|
@@ -132,14 +139,13 @@ jobs: | |
${{ secrets.STUDENT_ADMIN_URL_ROOT }} | ||
# Start rollout (if necessary) and follow it | ||
oc rollout latest dc/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
|| true && echo "Rollout in progress" | ||
oc logs -f dc/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
oc rollout restart deployment/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
# Get status, returns 0 if rollout is successful | ||
oc rollout status dc/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
oc rollout status deployment/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
# now hit it with a zap scan | ||
- name: ZAP Scan | ||
uses: zaproxy/[email protected] | ||
with: | ||
target: 'https://${{ env.REPO_NAME }}-${{ env.OPENSHIFT_NAMESPACE }}.apps.silver.devops.gov.bc.ca/api/v1/api-docs' | ||
target: 'https://${{ env.REPO_NAME }}-${{ env.OPENSHIFT_NAMESPACE }}.apps.silver.devops.gov.bc.ca/api/v1/api-docs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,8 @@ env: | |
IMAGE_REGISTRY_USER: ${{ github.actor }} | ||
IMAGE_REGISTRY_PASSWORD: ${{ github.token }} | ||
|
||
SPRING_BOOT_IMAGE_NAME: educ-grad-trax-api-dc | ||
SPRING_BOOT_IMAGE_NAME: educ-grad-trax-api | ||
|
||
REPO_NAME: "educ-grad-trax-api" | ||
APP_DOMAIN: ${{ vars.APP_DOMAIN }} | ||
BRANCH: "grad-release" | ||
|
@@ -103,17 +104,24 @@ jobs: | |
oc login --token=${{ env.OPENSHIFT_TOKEN }} --server=${{ env.OPENSHIFT_SERVER }} | ||
oc project ${{ env.OPENSHIFT_NAMESPACE }} | ||
# Cancel any rollouts in progress | ||
oc rollout cancel dc/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
oc rollout cancel deployment/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
|| true && echo "No rollout in progress" | ||
# tag image stream | ||
oc -n ${{ env.OPENSHIFT_NAMESPACE }} tag ${{ steps.push-image.outputs.registry-path }} ${{ env.REPO_NAME }}:${{ env.TAG }} | ||
# Process and apply deployment template | ||
oc process -f tools/openshift/api.dc.yaml -p IS_NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} -p REPO_NAME=${{ env.REPO_NAME }} \ | ||
-p TAG_NAME=${{ env.TAG }} -p HOST_ROUTE=${{ env.REPO_NAME }}-${{ env.OPENSHIFT_NAMESPACE }}.${{ env.APP_DOMAIN }} \ | ||
-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 }} | oc apply -f - | ||
oc process -f tools/openshift/api.dc.yaml \ | ||
-p IS_NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \ | ||
-p REPO_NAME=${{ env.REPO_NAME }} \ | ||
-p TAG_NAME=${{ env.TAG }} \ | ||
-p HOST_ROUTE=${{ env.REPO_NAME }}-${{ env.OPENSHIFT_NAMESPACE }}.${{ env.APP_DOMAIN }} \ | ||
-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 }} | oc apply -f - | ||
# UPDATE Configmaps | ||
curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/tools/config/update-configmap.sh \ | ||
| bash /dev/stdin \ | ||
|
@@ -139,14 +147,13 @@ jobs: | |
${{ secrets.STUDENT_ADMIN_URL_ROOT }} | ||
# Start rollout (if necessary) and follow it | ||
oc rollout latest dc/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
|| true && echo "Rollout in progress" | ||
oc logs -f dc/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
oc rollout restart deployment/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
# Get status, returns 0 if rollout is successful | ||
oc rollout status dc/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
oc rollout status deployment/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
# now hit it with a zap scan | ||
- name: ZAP Scan | ||
uses: zaproxy/[email protected] | ||
with: | ||
target: 'https://${{ env.REPO_NAME }}-${{ env.OPENSHIFT_NAMESPACE }}.apps.silver.devops.gov.bc.ca/api/v1/api-docs' | ||
target: 'https://${{ env.REPO_NAME }}-${{ env.OPENSHIFT_NAMESPACE }}.apps.silver.devops.gov.bc.ca/api/v1/api-docs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters