Skip to content

Commit

Permalink
Update schema-spy.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
JonTaylorBCGov2 committed May 29, 2024
1 parent 7631160 commit c978b4a
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions .github/workflows/schema-spy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,52 @@ jobs:
password: ${{ secrets.CAS_ARTIFACTORY_PASSWORD }}

- name: Checkout Schema Spy Repo
id: gitops
uses: actions/checkout@v4
with:
repository: bcgov/SchemaSpy.git
ref: master

# Get SHORT_SHA to tag images
- name: Get short SHA
id: short_sha
run: |
echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)"
echo "Short SHA: $SHORT_SHA"
- name: Docker Build Schema Spy Image
run: |
docker build --tag ${{ env.IMAGE_NAME }} .
docker tag ${{ env.IMAGE_NAME }} artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:latest
docker push artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}
docker tag ${{ env.IMAGE_NAME }} artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}
docker push artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}
- name: Checkout ArgoCD Repo
id: gitops
uses: actions/checkout@v4
with:
repository: bcgov-c/tenant-gitops-ac1cc8
ref: develop
token: ${{ secrets.GIT_OPS_SSH_KEY }} # `GH_PAT` is a secret that contains your PAT
path: gitops

- name: Update Helm Values and Commit
id: helm
if: steps.gitops.outcome == 'success' # Only run if the previous step (publish) was successful
run: |
# Clone the GitOps deployment configuration repository
# Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test and
cd gitops/charts
# Update the Helm values file with the new image tag and version
DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time
sed -i "s/apitag: .*/apitag: dev-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/dev_values.yaml
sed -i "s/apitag: .*/apitag: dev-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" schema-spy/values.yaml
# Commit and push the changes
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add .
git add ../deploy/dev_values.yaml

0 comments on commit c978b4a

Please sign in to comment.