-
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.
Convert deprecated DCs into Deployments (#287)
* feat: convert dev from dc to deployment fix: api for template fix: apiVersion for object squashable probably fix: DC reference * feat: use deployment for higher envs * feat: remove deprecated dc
- Loading branch information
Showing
6 changed files
with
66 additions
and
71 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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
name: 1 DEV - Deploy Dynamics API | ||
|
||
env: | ||
# 🖊️ EDIT your repository secrets to log into your OpenShift cluster and set up the context. | ||
# EDIT your repository secrets to log into your OpenShift cluster and set up the context. | ||
# See https://github.com/redhat-actions/oc-login#readme for how to retrieve these values. | ||
# To get a permanent token, refer to https://github.com/redhat-actions/oc-login/wiki/Using-a-Service-Account-for-GitHub-Actions | ||
OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }} | ||
OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }} | ||
# 🖊️ EDIT to set the kube context's namespace after login. Leave blank to use your user's default namespace. | ||
# EDIT to set the kube context's namespace after login. Leave blank to use your user's default namespace. | ||
OPENSHIFT_NAMESPACE: ${{ secrets.OFM_NAMESPACE_NO_ENV }}-dev | ||
|
||
# SPLUNK_TOKEN: ${{ secrets.SPLUNK_TOKEN }} | ||
|
||
# 🖊️ EDIT to change the image registry settings. | ||
# EDIT to change the image registry settings. | ||
# Registries such as GHCR, Quay.io, and Docker Hub are supported. | ||
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} | ||
IMAGE_REGISTRY_USER: ${{ github.actor }} | ||
|
@@ -80,19 +80,19 @@ jobs: | |
core.error(`Secret "${name}" is not set`); | ||
return true; | ||
} | ||
core.info(`✔️ Secret "${name}" is set`); | ||
core.info(`Secret "${name}" is set`); | ||
return false; | ||
}); | ||
if (missingSecrets.length > 0) { | ||
core.setFailed(`❌ At least one required secret is not set in the repository. \n` + | ||
core.setFailed(`At least one required secret is not set in the repository. \n` + | ||
"You can add it using:\n" + | ||
"GitHub UI: https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository \n" + | ||
"GitHub CLI: https://cli.github.com/manual/gh_secret_set \n" + | ||
"Also, refer to https://github.com/redhat-actions/oc-login#getting-started-with-the-action-or-see-example"); | ||
} | ||
else { | ||
core.info(`✅ All the required secrets are set`); | ||
core.info(`All the required secrets are set`); | ||
} | ||
- name: Check out repository | ||
|
@@ -146,7 +146,7 @@ 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.APP_NAME }}-${{ env.APP_NAME_BACKEND }}-${{ env.APP_ENVIRONMENT }} 2> /dev/null \ | ||
oc rollout cancel deployment/${{ env.APP_NAME }}-${{ env.APP_NAME_BACKEND }}-${{ env.APP_ENVIRONMENT }} 2> /dev/null \ | ||
|| true && echo "No rollout in progress" | ||
# Create the image stream if it doesn't exist | ||
|
@@ -156,7 +156,7 @@ jobs: | |
# Process and apply deployment template | ||
oc process \ | ||
-f tools/openshift/d365api.dc.yaml \ | ||
-f tools/openshift/d365api.deployment.yaml \ | ||
-p APP_NAME=${{ env.APP_NAME }} \ | ||
-p REPO_NAME=${{ env.REPO_NAME }} \ | ||
-p BRANCH=${{ env.BRANCH }} \ | ||
|
@@ -205,11 +205,11 @@ jobs: | |
${{ secrets.D365_INVOICE_LINES_DISTRIBUTION_ACK }} | ||
# Start rollout (if necessary) and follow it | ||
oc rollout latest dc/${{ env.APP_NAME }}-${{ env.APP_NAME_BACKEND }}-${{ env.APP_ENVIRONMENT }} 2> /dev/null \ | ||
oc rollout restart deployment/${{ env.APP_NAME }}-${{ env.APP_NAME_BACKEND }}-${{ env.APP_ENVIRONMENT }} 2> /dev/null \ | ||
|| true && echo "Rollout in progress" | ||
# Get status, returns 0 if rollout is successful | ||
oc rollout status dc/${{ env.APP_NAME }}-${{ env.APP_NAME_BACKEND }}-${{ env.APP_ENVIRONMENT }} | ||
oc rollout status deployment/${{ env.APP_NAME }}-${{ env.APP_NAME_BACKEND }}-${{ env.APP_ENVIRONMENT }} | ||
- 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
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
Oops, something went wrong.