-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix test level of action implementation
- Loading branch information
1 parent
af52c06
commit 87f5ea2
Showing
1 changed file
with
30 additions
and
30 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 |
---|---|---|
|
@@ -58,38 +58,38 @@ jobs: | |
# image_tag: ${{ env.IMAGE_TAG_PREFIX }}-${{ steps.short_sha.outputs.SHORT_SHA }} | ||
# helm_property: /webtag | ||
# helm_paths: web/values.yaml ../develop/values.yaml | ||
|
||
- name: Checkout ArgoCD Repo | ||
id: gitops | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: bcgov-c/tenant-gitops-${{ inputs.licence_plate }} | ||
ref: ${{ inputs.gitops_branch }} | ||
token: ${{ inputs.gitops_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' | ||
shell: bash | ||
run: | | ||
# Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test and | ||
cd gitops/charts | ||
- name: Checkout ArgoCD Repo | ||
id: gitops | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: bcgov-c/tenant-gitops-${{ inputs.licence_plate }} | ||
ref: ${{ inputs.gitops_branch }} | ||
token: ${{ inputs.gitops_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' | ||
shell: bash | ||
run: | | ||
# 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 | ||
# 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 | ||
# Split incoming helm_paths by space into an array and loop through each path update the image tag in each file | ||
IFS=' ' read -r -a paths <<< "${{ inputs.helm_paths }}" | ||
for path in "${paths[@]}"; do | ||
sed -i "s/${{ inputs.helm_property }}: .*/${{ inputs.helm_property }}: ${{ inputs.image_tag }} # Image Updated on $DATETIME/" $path | ||
# Stage the changed path immediately for upcoming commit | ||
git add $path | ||
done | ||
# Split incoming helm_paths by space into an array and loop through each path update the image tag in each file | ||
IFS=' ' read -r -a paths <<< "${{ inputs.helm_paths }}" | ||
for path in "${paths[@]}"; do | ||
sed -i "s/${{ inputs.helm_property }}: .*/${{ inputs.helm_property }}: ${{ inputs.image_tag }} # Image Updated on $DATETIME/" $path | ||
# Stage the changed path immediately for upcoming commit | ||
git add $path | ||
done | ||
# Commit and push the changes | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
# Commit and push the changes | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
git commit -m "Update API image tag" | ||
git push origin ${{ inputs.gitops_branch }} | ||
git commit -m "Update API image tag" | ||
git push origin ${{ inputs.gitops_branch }} |