-
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.
- Loading branch information
1 parent
d19e217
commit 3905510
Showing
1 changed file
with
37 additions
and
37 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 |
---|---|---|
|
@@ -147,43 +147,43 @@ jobs: | |
|
||
# The path the image was pushed to is now stored in ${{ steps.push-image.outputs.registry-path }} | ||
|
||
- name: Install oc | ||
uses: redhat-actions/openshift-tools-installer@v1 | ||
with: | ||
oc: 4 | ||
|
||
# https://github.com/redhat-actions/oc-login#readme | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Deploy API | ||
run: | | ||
set -eu | ||
# Login to OpenShift and select project | ||
oc login --token=${{ env.OPENSHIFT_TOKEN }} --server=${{ env.OPENSHIFT_SERVER }} | ||
oc project ${{ env.OPENSHIFT_NAMESPACE_DEV }} | ||
# Cancel any rollouts in progress | ||
oc rollout cancel dc/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
|| true && echo "No rollout in progress" | ||
oc tag ${{ steps.push-image.outputs.registry-path }} ${{ env.REPO_NAME }}-${{ env.BRANCH }}:${{ env.TAG }} | ||
# Process and apply deployment template | ||
oc process -f tools/openshift/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p BRANCH=${{ env.BRANCH }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS_DEV }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS_DEV }} -p MIN_CPU=${{ env.MIN_CPU_DEV }} -p MAX_CPU=${{ env.MAX_CPU_DEV }} -p MIN_MEM=${{ env.MIN_MEM_DEV }} -p MAX_MEM=${{ env.MAX_MEM_DEV }} \ | ||
| oc apply -f - | ||
curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/master/tools/config/update-configmap.sh | bash /dev/stdin dev ${{ env.APP_NAME }} ${{ env.NAMESPACE }} ${{ env.COMMON_NAMESPACE }} ${{ env.DB_JDBC_CONNECT_STRING }} ${{ env.DB_PWD }} ${{ env.DB_USER }} ${{ env.SPLUNK_TOKEN }} | ||
# 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 }} | ||
# Get status, returns 0 if rollout is successful | ||
oc rollout status dc/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
- name: ZAP Scan | ||
uses: zaproxy/[email protected] | ||
with: | ||
target: 'https://${{ env.APP_NAME }}-${{ env.OPENSHIFT_NAMESPACE_DEV }}-dev.apps.silver.devops.gov.bc.ca/v3/api-docs' | ||
# - name: Install oc | ||
# uses: redhat-actions/openshift-tools-installer@v1 | ||
# with: | ||
# oc: 4 | ||
# | ||
# # https://github.com/redhat-actions/oc-login#readme | ||
# - uses: actions/checkout@v3 | ||
|
||
# - name: Deploy API | ||
# run: | | ||
# set -eu | ||
# # Login to OpenShift and select project | ||
# oc login --token=${{ env.OPENSHIFT_TOKEN }} --server=${{ env.OPENSHIFT_SERVER }} | ||
# oc project ${{ env.OPENSHIFT_NAMESPACE_DEV }} | ||
# # Cancel any rollouts in progress | ||
# oc rollout cancel dc/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
# || true && echo "No rollout in progress" | ||
# | ||
# oc tag ${{ steps.push-image.outputs.registry-path }} ${{ env.REPO_NAME }}-${{ env.BRANCH }}:${{ env.TAG }} | ||
# | ||
# # Process and apply deployment template | ||
# oc process -f tools/openshift/api.dc.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p BRANCH=${{ env.BRANCH }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_DEV }} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS_DEV }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS_DEV }} -p MIN_CPU=${{ env.MIN_CPU_DEV }} -p MAX_CPU=${{ env.MAX_CPU_DEV }} -p MIN_MEM=${{ env.MIN_MEM_DEV }} -p MAX_MEM=${{ env.MAX_MEM_DEV }} \ | ||
# | oc apply -f - | ||
# | ||
# curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/master/tools/config/update-configmap.sh | bash /dev/stdin dev ${{ env.APP_NAME }} ${{ env.NAMESPACE }} ${{ env.COMMON_NAMESPACE }} ${{ env.DB_JDBC_CONNECT_STRING }} ${{ env.DB_PWD }} ${{ env.DB_USER }} ${{ env.SPLUNK_TOKEN }} | ||
# | ||
# # 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 }} | ||
# # Get status, returns 0 if rollout is successful | ||
# oc rollout status dc/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
# | ||
# - name: ZAP Scan | ||
# uses: zaproxy/[email protected] | ||
# with: | ||
# target: 'https://${{ env.APP_NAME }}-${{ env.OPENSHIFT_NAMESPACE_DEV }}-dev.apps.silver.devops.gov.bc.ca/v3/api-docs' | ||
|
||
deploy-test: | ||
name: Deploy to OpenShift TEST | ||
|