diff --git a/ci/vendir.lock.yml b/ci/vendir.lock.yml index 8c649779..1a7eff38 100644 --- a/ci/vendir.lock.yml +++ b/ci/vendir.lock.yml @@ -2,14 +2,14 @@ apiVersion: vendir.k14s.io/v1alpha1 directories: - contents: - git: - commitTitle: 'chore: more generic test-on-docker-host' - sha: 0c17e2d69a71a42b83b8fbd0136abd27b8d97a74 + commitTitle: 'ci: new metadata scheme (#36)' + sha: 3edfe7d25e5fe2162fd49b944dd0d512eeabd512 path: . path: ../.github/workflows/vendor - contents: - git: - commitTitle: 'chore: more generic test-on-docker-host' - sha: 0c17e2d69a71a42b83b8fbd0136abd27b8d97a74 + commitTitle: 'ci: new metadata scheme (#36)' + sha: 3edfe7d25e5fe2162fd49b944dd0d512eeabd512 path: . path: ./vendor kind: LockConfig diff --git a/ci/vendir.yml b/ci/vendir.yml index aa5d1fd7..85a8d6f2 100644 --- a/ci/vendir.yml +++ b/ci/vendir.yml @@ -8,7 +8,7 @@ directories: - path: . # Copy this folder out to .. git: url: https://github.com/GaloyMoney/concourse-shared.git - ref: 0c17e2d69a71a42b83b8fbd0136abd27b8d97a74 + ref: 3edfe7d25e5fe2162fd49b944dd0d512eeabd512 includePaths: - shared/actions/* excludePaths: @@ -20,7 +20,7 @@ directories: - path: . git: url: https://github.com/GaloyMoney/concourse-shared.git - ref: 0c17e2d69a71a42b83b8fbd0136abd27b8d97a74 + ref: 3edfe7d25e5fe2162fd49b944dd0d512eeabd512 includePaths: - shared/ci/**/* excludePaths: diff --git a/ci/vendor/pipeline-fragments.lib.yml b/ci/vendor/pipeline-fragments.lib.yml index d7323270..5bb6ab16 100644 --- a/ci/vendor/pipeline-fragments.lib.yml +++ b/ci/vendor/pipeline-fragments.lib.yml @@ -4,6 +4,10 @@ #@ return "us.gcr.io/galoy-org" #@ end +#@ def private_docker_registry(): +#@ return "gcr.io/galoy-org" +#@ end + #@ def nodejs_concourse_image(): #@ return public_docker_registry() + "/nodejs-concourse" #@ end @@ -402,14 +406,14 @@ source: private_key: #@ data.values.github_private_key #@ end -#@ def edge_image_resource(): +#@ def edge_image_resource(publicRepo = True): name: edge-image type: registry-image source: tag: edge username: #@ data.values.docker_registry_user password: #@ data.values.docker_registry_password - repository: #@ public_docker_registry() + "/" + data.values.gh_repository + repository: #@ public_docker_registry() if publicRepo else private_docker_registry() + "/" + data.values.gh_repository #@ end #@ def nodejs_deps_resource(webhook = False): diff --git a/ci/vendor/tasks/chart-open-charts-pr.sh b/ci/vendor/tasks/chart-open-charts-pr.sh index 6acf1e03..4803ce42 100755 --- a/ci/vendor/tasks/chart-open-charts-pr.sh +++ b/ci/vendor/tasks/chart-open-charts-pr.sh @@ -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 <> ../body.md # Bump ${CHARTS_SUBDIR} image diff --git a/ci/vendor/tasks/docker-bump-image-digest.sh b/ci/vendor/tasks/docker-bump-image-digest.sh index f47ad522..2616b7bc 100755 --- a/ci/vendor/tasks/docker-bump-image-digest.sh +++ b/ci/vendor/tasks/docker-bump-image-digest.sh @@ -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