Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
arcshiftsolutions committed Oct 10, 2023
1 parent d19e217 commit 3905510
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions .github/workflows/deploy-to.openshift-dev-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3905510

Please sign in to comment.