Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Commit

Permalink
ci: test new values templating
Browse files Browse the repository at this point in the history
  • Loading branch information
krtk6160 committed Oct 27, 2023
1 parent 07670e8 commit b95ef85
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions ci/vendor/pipeline-fragments.lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ plan:
platform: linux
image_resource: #@ nodejs_task_image_config()
inputs:
- name: repo
- name: pipeline-tasks
- name: edge-image
- name: charts-repo
Expand Down
7 changes: 5 additions & 2 deletions ci/vendor/tasks/chart-open-charts-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
set -eu

export digest=$(cat ./edge-image/digest)
export ref=$(cat ./repo/.git/short_ref)

pushd charts-repo

ref=$(yq e '.image.git_ref' charts/${CHARTS_SUBDIR}/values.yaml)
git checkout ${BRANCH}
old_ref=$(yq e '.image.git_ref' charts/${CHARTS_SUBDIR}/values.yaml)

old_digest=$(yq e '.image.digest' "./charts/${CHARTS_SUBDIR}/values.yaml")
old_ref=$(grep "digest: \"${old_digest}\"" "./charts/${CHARTS_SUBDIR}/values.yaml" \
| sed -n 's/.*commit_ref=\([^;]*\);.*/\1/p' | tr -d ' \n')

cat <<EOF >> ../body.md
# Bump ${CHARTS_SUBDIR} image
Expand Down
6 changes: 4 additions & 2 deletions ci/vendor/tasks/docker-bump-image-digest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export app_version=$(cat version/version)
pushd charts-repo

yq -i e '.image.digest = strenv(digest)' ./charts/${CHARTS_SUBDIR}/values.yaml
yq -i e '.image.git_ref = strenv(ref)' ./charts/${CHARTS_SUBDIR}/values.yaml

sed -i "s|\(digest: \"${digest}\"\).*$|\1 # METADATA:: repository=https://github.com/GaloyMoney/${CHARTS_SUBDIR};commit_ref=${ref};app=${CHARTS_SUBDIR};|g" "./charts/${CHARTS_SUBDIR}/values.yaml"

yq -i e '.appVersion = strenv(app_version)' ./charts/${CHARTS_SUBDIR}/Chart.yaml

if [[ -z $(git config --global user.email) ]]; then
Expand All @@ -27,5 +29,5 @@ fi
git merge --no-edit ${BRANCH}
git add -A
git status
git commit -m "chore(${CHARTS_SUBDIR}): bump ${CHARTS_SUBDIR} image to '${digest}'"
git commit -m "chore(deps): bump ${CHARTS_SUBDIR} image to '${digest}'"
)

0 comments on commit b95ef85

Please sign in to comment.