-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
5 changed files
with
41 additions
and
38 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 |
---|---|---|
|
@@ -28,7 +28,7 @@ env: | |
|
||
APP_NAME: 'digitalid-api' | ||
REPO_NAME: "educ-digitalid-api" | ||
BRANCH: "master" | ||
BRANCH: ${{ github.ref_name }} | ||
APP_NAME_FULL: "digitalid-api-master" | ||
NAMESPACE: ${{ secrets.COMMON_NAMESPACE_NO_ENV }} | ||
COMMON_NAMESPACE: ${{ secrets.COMMON_NAMESPACE_NO_ENV }} | ||
|
@@ -148,14 +148,14 @@ jobs: | |
oc project ${{ env.OPENSHIFT_NAMESPACE_DEV }} | ||
# 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" | ||
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 \ | ||
oc process -f tools/openshift/api.deployment.yaml \ | ||
-p APP_NAME=${{ env.APP_NAME }} \ | ||
-p REPO_NAME=${{ env.REPO_NAME }} \ | ||
-p BRANCH=${{ env.BRANCH }} \ | ||
|
@@ -169,23 +169,23 @@ jobs: | |
-p MAX_MEM=${{ env.MAX_MEM }} \ | ||
| oc apply -f - | ||
curl -s https://raw.githubusercontent.com/bcgov/\ | ||
${{ env.REPO_NAME }}/master/tools/config/update-configmap.sh | bash /dev/stdin dev \ | ||
curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/tools/config/update-configmap.sh | bash /dev/stdin dev \ | ||
${{ env.APP_NAME }} \ | ||
${{ env.NAMESPACE }} \ | ||
${{ env.DB_JDBC_CONNECT_STRING }} \ | ||
${{ env.DB_PWD }} \ | ||
${{ env.DB_USER }} \ | ||
${{ env.SPLUNK_TOKEN }} | ||
${{ env.SPLUNK_TOKEN }} \ | ||
${{ env.BRANCH }} | ||
# Start rollout (if necessary) and follow it | ||
oc rollout latest dc/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
oc rollout restart deployment/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
|| true && echo "Rollout in progress" | ||
oc logs -f dc/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
oc logs -f 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 }} | ||
- name: ZAP Scan | ||
uses: zaproxy/[email protected] | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ env: | |
|
||
APP_NAME: 'digitalid-api' | ||
REPO_NAME: "educ-digitalid-api" | ||
BRANCH: "master" | ||
BRANCH: ${{ github.ref_name }} | ||
APP_NAME_FULL: "digitalid-api-master" | ||
NAMESPACE: ${{ secrets.COMMON_NAMESPACE_NO_ENV }} | ||
COMMON_NAMESPACE: ${{ secrets.COMMON_NAMESPACE_NO_ENV }} | ||
|
@@ -116,15 +116,15 @@ jobs: | |
oc project ${{ env.OPENSHIFT_NAMESPACE_TEST }} | ||
# 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" | ||
oc tag \ | ||
${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.BRANCH }}:${{ env.TAG }} \ | ||
${{ env.NAMESPACE }}-test/${{ env.REPO_NAME }}-${{ env.BRANCH }}:${{ env.TAG }} | ||
# Process and apply deployment template | ||
oc process -f tools/openshift/api.dc.yaml \ | ||
oc process -f tools/openshift/api.deployment.yaml \ | ||
-p APP_NAME=${{ env.APP_NAME }} \ | ||
-p REPO_NAME=${{ env.REPO_NAME }} \ | ||
-p BRANCH=${{ env.BRANCH }} \ | ||
|
@@ -138,23 +138,24 @@ jobs: | |
-p MAX_MEM=${{ env.MAX_MEM }} \ | ||
| oc apply -f - | ||
curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/master/tools/config/update-configmap.sh \ | ||
curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/${{ env.BRANCH }}/tools/config/update-configmap.sh \ | ||
| bash /dev/stdin test \ | ||
${{ env.APP_NAME }} \ | ||
${{ env.NAMESPACE }} \ | ||
${{ env.DB_JDBC_CONNECT_STRING }} \ | ||
${{ env.DB_PWD }} \ | ||
${{ env.DB_USER }} \ | ||
${{ env.SPLUNK_TOKEN }} | ||
${{ env.SPLUNK_TOKEN }} \ | ||
${{ env.BRANCH }} | ||
# Start rollout (if necessary) and follow it | ||
oc rollout latest dc/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
oc rollout restart deployment/${{ env.SPRING_BOOT_IMAGE_NAME }} 2> /dev/null \ | ||
|| true && echo "Rollout in progress" | ||
oc logs -f dc/${{ env.SPRING_BOOT_IMAGE_NAME }} | ||
oc logs -f 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 }} | ||
- name: ZAP Scan | ||
uses: zaproxy/[email protected] | ||
|
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