diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 4287016..4dbf95d 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -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 diff --git a/.github/workflows/db-backup.yml b/.github/workflows/db-backup.yml index ef43bb3..3292c90 100644 --- a/.github/workflows/db-backup.yml +++ b/.github/workflows/db-backup.yml @@ -34,7 +34,7 @@ jobs: uses: actions/checkout@v4 with: sparse-checkout: | - config/mariadb + config/backup example.env example.versions.env diff --git a/.github/workflows/db.yml b/.github/workflows/db.yml index 93303e1..e751d34 100644 --- a/.github/workflows/db.yml +++ b/.github/workflows/db.yml @@ -52,6 +52,7 @@ jobs: # with: # path: example.versions.env # export-variables: true + # keys-case: upper - name: Setup All Env Vars run: | @@ -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 @@ -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