Skip to content

Commit

Permalink
feat: convert other environments to deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
trev-dev committed Nov 12, 2024
1 parent d632846 commit da2379f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/deploy-to-openshift-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@ jobs:
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: 4.16

# https://github.com/redhat-actions/oc-login#readme
# - uses: actions/checkout@v2
- name: Deploy
run: |
set -eux
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-to-openshift-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,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.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }} 2> /dev/null \
oc rollout cancel deployment/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }} 2> /dev/null \
|| true && echo "No rollout in progress"
# Create tag for PROD env from DEV env image
Expand All @@ -118,7 +118,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 }} \
Expand Down Expand Up @@ -146,9 +146,9 @@ jobs:
/tmp/authentication_settings
# Start rollout (if necessary) and follow it
oc rollout latest dc/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }} 2> /dev/null \
oc rollout restart deployment/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}-${{ 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.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }}
oc rollout status deployment/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }}
10 changes: 5 additions & 5 deletions .github/workflows/deploy-to-openshift-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ env:
MAX_CPU: "100m"
MIN_MEM: "200Mi"
MAX_MEM: "250Mi"

on:
workflow_dispatch:

Expand Down Expand Up @@ -107,7 +107,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.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }} 2> /dev/null \
oc rollout cancel deployment/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }} 2> /dev/null \
|| true && echo "No rollout in progress"
# Create tag for TEST env from DEV env image
Expand All @@ -117,7 +117,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 }} \
Expand Down Expand Up @@ -145,9 +145,9 @@ jobs:
/tmp/authentication_settings
# Start rollout (if necessary) and follow it
oc rollout latest dc/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }} 2> /dev/null \
oc rollout restart deployment/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}-${{ 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.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }}
oc rollout status deployment/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }}
8 changes: 4 additions & 4 deletions .github/workflows/deploy-to-openshift-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,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.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }} 2> /dev/null \
oc rollout cancel deployment/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }} 2> /dev/null \
|| true && echo "No rollout in progress"
# Create tag for TEST env from DEV env image
Expand All @@ -117,7 +117,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 }} \
Expand Down Expand Up @@ -145,9 +145,9 @@ jobs:
/tmp/authentication_settings
# Start rollout (if necessary) and follow it
oc rollout latest dc/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }} 2> /dev/null \
oc rollout restart deployment/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}-${{ 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.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }}
oc rollout status deployment/${{ env.APP_NAME }}-${{ env.IMAGE_NAME }}-${{ env.APP_ENVIRONMENT }}

0 comments on commit da2379f

Please sign in to comment.