-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rick Anderson
authored and
Rick Anderson
committed
Jul 16, 2024
1 parent
bc4ba2d
commit a2bf123
Showing
1 changed file
with
57 additions
and
57 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 |
---|---|---|
|
@@ -196,75 +196,75 @@ jobs: | |
docker push artifacts.developer.gov.bc.ca/sf4a-strdss/frontend:dev-6cd0e88 | ||
package-h-chart-backend: | ||
needs: [docker-build-backend] | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 10 | ||
# package-h-chart-backend: | ||
# needs: [docker-build-backend] | ||
# runs-on: ubuntu-22.04 | ||
# timeout-minutes: 10 | ||
|
||
steps: | ||
- name: Checkout ArgoCD Repo | ||
id: gitops | ||
# if: steps.publish.outcome == 'success' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: bcgov-c/tenant-gitops-b0471a | ||
ref: develop | ||
token: ${{ secrets.GITOPS }} # `GITOPS` is a secret that contains your PAT | ||
path: gitops | ||
- name: Update Helm Values and Commit backend | ||
id: helm | ||
# if: steps.gitops.outcome == 'success' # Only run if the previous step (publish) was successful | ||
run: | | ||
pwd | ||
# Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test and | ||
#cd gitops | ||
cd gitops/charts/backend | ||
IMAGE="${{ steps.meta.outputs.tags || steps.meta-test.outputs.tags || steps.meta-prod.outputs.tags }} " | ||
IMAGE_TAG=$(echo "$IMAGE" | awk -F':' '{print $NF}') | ||
echo "Image Tag:" | ||
echo $IMAGE_TAG | ||
# Update the Helm values file with the new image tag or (SHA) | ||
DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time | ||
# check if branch is dev update dev_values with sed if branch is test update test value if branch is main update prod values | ||
# steps: | ||
# - name: Checkout ArgoCD Repo | ||
# id: gitops | ||
# # if: steps.publish.outcome == 'success' | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# repository: bcgov-c/tenant-gitops-b0471a | ||
# ref: develop | ||
# token: ${{ secrets.GITOPS }} # `GITOPS` is a secret that contains your PAT | ||
# path: gitops | ||
# - name: Update Helm Values and Commit backend | ||
# id: helm | ||
# # if: steps.gitops.outcome == 'success' # Only run if the previous step (publish) was successful | ||
# run: | | ||
# pwd | ||
# # Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test and | ||
# #cd gitops | ||
# cd gitops/charts/backend | ||
|
||
# IMAGE="${{ steps.meta.outputs.tags || steps.meta-test.outputs.tags || steps.meta-prod.outputs.tags }} " | ||
# IMAGE_TAG=$(echo "$IMAGE" | awk -F':' '{print $NF}') | ||
# echo "Image Tag:" | ||
# echo $IMAGE_TAG | ||
|
||
# # Update the Helm values file with the new image tag or (SHA) | ||
# DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time | ||
# # check if branch is dev update dev_values with sed if branch is test update test value if branch is main update prod values | ||
|
||
|
||
if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then | ||
echo "This is the main branch" | ||
sed -i "s/tag: .*/tag: $IMAGE_TAG # Image Updated on $DATETIME/" ../../deploy/prod_values.yaml | ||
elif [[ "$GITHUB_REF" == "refs/heads/emerald" ]]; then | ||
echo "This is the emerald branch" | ||
sed -i "s/tag: .*/tag: $IMAGE_TAG # Image Updated on $DATETIME/" ../../deploy/dev_values.yaml | ||
elif [[ "$GITHUB_REF" == "refs/heads/test" ]]; then | ||
echo "This is the test branch" | ||
sed -i "s/tag: .*/tag: $IMAGE_TAG # Image Updated on $DATETIME/" ../../deploy/test_values.yaml | ||
else | ||
echo updating dev values for CIs | ||
sed -i "s/tag: .*/tag: $IMAGE_TAG # Image Updated on $DATETIME/" ../../deploy/dev_values.yaml | ||
fi | ||
# if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then | ||
# echo "This is the main branch" | ||
# sed -i "s/tag: .*/tag: $IMAGE_TAG # Image Updated on $DATETIME/" ../../deploy/prod_values.yaml | ||
# elif [[ "$GITHUB_REF" == "refs/heads/emerald" ]]; then | ||
# echo "This is the emerald branch" | ||
# sed -i "s/tag: .*/tag: $IMAGE_TAG # Image Updated on $DATETIME/" ../../deploy/dev_values.yaml | ||
# elif [[ "$GITHUB_REF" == "refs/heads/test" ]]; then | ||
# echo "This is the test branch" | ||
# sed -i "s/tag: .*/tag: $IMAGE_TAG # Image Updated on $DATETIME/" ../../deploy/test_values.yaml | ||
# else | ||
# echo updating dev values for CIs | ||
# sed -i "s/tag: .*/tag: $IMAGE_TAG # Image Updated on $DATETIME/" ../../deploy/dev_values.yaml | ||
# fi | ||
|
||
|
||
|
||
# Commit and push the changes | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Rick Anderson" | ||
# # Commit and push the changes | ||
# git config --global user.email "[email protected]" | ||
# git config --global user.name "Rick Anderson" | ||
|
||
git add ../../deploy/dev_values.yaml | ||
git add ../../deploy/prod_values.yaml | ||
git add ../../deploy/test_values.yaml | ||
# git add ../../deploy/dev_values.yaml | ||
# git add ../../deploy/prod_values.yaml | ||
# git add ../../deploy/test_values.yaml | ||
|
||
pwd | ||
# Repackage Helm Chart | ||
cd ../gitops/charts | ||
# pwd | ||
# # Repackage Helm Chart | ||
# cd ../gitops/charts | ||
|
||
|
||
helm package ../../backend/ | ||
# helm package ../../backend/ | ||
|
||
git add . | ||
# git add . | ||
|
||
git commit -m "Update image tag to $IMAGE_TAG on $DATETIME" | ||
git push origin develop # Update the branch name as needed | ||
# git commit -m "Update image tag to $IMAGE_TAG on $DATETIME" | ||
# git push origin develop # Update the branch name as needed | ||
|
||
|
||
package-h-chart-frontend: | ||
|