Skip to content

Commit

Permalink
Update Git sparse-checkout configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
warrenchristian1telus committed Feb 29, 2024
1 parent 48ec9bf commit 920bd46
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ jobs:
if: ${{ needs.checkEnv.SKIP_BUILDS != 'YES' }} && (github.ref_name == 'dev' || github.ref_name == 'test' || github.ref_name == 'prod')
steps:
# Checkout the PR branch
# - name: 📤 Checkout Target Branch
# uses: actions/checkout@v2
- name: 📤 Checkout Target Branch
uses: actions/checkout@v2
with:
sparse-checkout: |
config/cron
example.env
example.versions.env
# Login to Artifactory
- name: 🔑 Login to Artifactory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/db-backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/checkout@v4
with:
sparse-checkout: |
config/mariadb
config/backup
example.env
example.versions.env
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
# with:
# path: example.versions.env
# export-variables: true
# keys-case: upper

- name: Setup All Env Vars
run: |
Expand Down Expand Up @@ -81,9 +82,9 @@ jobs:

- name: 🛠️ Pull latest DB base image then push to Artifactory
run: |
docker pull ${{ steps.dotenv.outputs.DB_IMAGE }}
docker tag ${{ steps.dotenv.outputs.DB_IMAGE }} ${{ secrets.ARTIFACTORY_URL }}/${{ steps.dotenv.outputs.DB_IMAGE }}
docker push ${{ secrets.ARTIFACTORY_URL }}/${{ steps.dotenv.outputs.DB_IMAGE }}
docker pull ${{ env.DB_IMAGE }}
docker tag ${{ env.DB_IMAGE }} ${{ secrets.ARTIFACTORY_URL }}/${{ env.DB_IMAGE }}
docker push ${{ secrets.ARTIFACTORY_URL }}/${{ env.DB_IMAGE }}
- name: Install oc
uses: redhat-actions/openshift-tools-installer@v1
Expand All @@ -101,20 +102,20 @@ jobs:
reveal_cluster_name: false
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.AUTH_TOKEN_DEV }}
namespace: ${{ steps.dotenv.outputs.OPENSHIFT_DEPLOY_PROJECT }}
namespace: ${{ env.OPENSHIFT_DEPLOY_PROJECT }}

# For a graceful termination, set the replica count of the Pods in the mariadb-galera StatefulSet to 0:
# oc scale sts ${{ steps.dotenv.outputs.DB_DEPLOYMENT_NAME }} --replicas=0
# oc scale sts ${{ env.DB_DEPLOYMENT_NAME }} --replicas=0
# To uninstall/delete the my-release release:
# helm delete --purge ${{ steps.dotenv.outputs.DB_DEPLOYMENT_NAME }}
- name: 🚀 Deploy ${{ steps.dotenv.outputs.DB_DEPLOYMENT_NAME }} to ${{ steps.dotenv.outputs.OPENSHIFT_DEPLOY_PROJECT }}
# helm delete --purge ${{ env.DB_DEPLOYMENT_NAME }}
- name: 🚀 Deploy ${{ env.DB_DEPLOYMENT_NAME }} to ${{ env.OPENSHIFT_DEPLOY_PROJECT }}
if: success()
run: |
if [[ `oc describe sts ${{ steps.dotenv.outputs.DB_DEPLOYMENT_NAME }} 2>&1` =~ "NotFound" ]]; then
echo "${{ steps.dotenv.outputs.DB_DEPLOYMENT_NAME }} NOT FOUND: Beginning deployment..."
oc create -f ./config/mariadb/config.yaml -n ${{ steps.dotenv.outputs.OPENSHIFT_DEPLOY_PROJECT }}
if [[ `oc describe sts ${{ env.DB_DEPLOYMENT_NAME }} 2>&1` =~ "NotFound" ]]; then
echo "${{ env.DB_DEPLOYMENT_NAME }} NOT FOUND: Beginning deployment..."
oc create -f ./config/mariadb/config.yaml -n ${{ env.OPENSHIFT_DEPLOY_PROJECT }}
else
echo "${{ steps.dotenv.outputs.DB_DEPLOYMENT_NAME }} Installation FOUND...UPDATING..."
oc annotate --overwrite sts/${{ steps.dotenv.outputs.DB_DEPLOYMENT_NAME }} kubectl.kubernetes.io/restartedAt=`date +%FT%T` -n ${{ steps.dotenv.outputs.OPENSHIFT_DEPLOY_PROJECT }}
oc rollout restart sts/${{ steps.dotenv.outputs.DB_DEPLOYMENT_NAME }}
echo "${{ env.DB_DEPLOYMENT_NAME }} Installation FOUND...UPDATING..."
oc annotate --overwrite sts/${{ env.DB_DEPLOYMENT_NAME }} kubectl.kubernetes.io/restartedAt=`date +%FT%T` -n ${{ env.OPENSHIFT_DEPLOY_PROJECT }}
oc rollout restart sts/${{ env.DB_DEPLOYMENT_NAME }}
fi

0 comments on commit 920bd46

Please sign in to comment.