[artifacts/container-image] Trigger image tag update (#149143)

After a commit is merged, tested, and images are built and pushed to the
container registry we need to send a notification that a new tag is
available.

This triggers a promotion pipeline with the latest container tag when:
1) the branch is tracked (i.e. main, and not a personal branch)
1) ~triggered from our on-merge test pipeline.~
https://github.com/elastic/kibana/pull/149350 had to remove support for
this - we're triggering via REST now which removes the from trigger
environment variable.

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
This commit is contained in:
Jon 2023-01-23 17:36:26 -06:00 committed by GitHub
parent ace3de1504
commit 598843f7ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,3 +65,23 @@ buildkite-agent artifact upload "kibana-$BASE_VERSION-docker-image.tar.gz"
buildkite-agent artifact upload "kibana-$BASE_VERSION-docker-image-aarch64.tar.gz"
buildkite-agent artifact upload "dependencies-$GIT_ABBREV_COMMIT.csv"
cd -
echo "--- Trigger image tag update"
if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]]; then
cat << EOF | buildkite-agent pipeline upload
steps:
- trigger: k8s-gitops-update-image-tag
label: "Update image tag for deployment-api"
branches: main
build:
env:
MODE: sed
TARGET_FILE: app-config-controllers.yaml
IMAGE_TAG: "$KIBANA_IMAGE"
SERVICE: app-config-controllers
EOF
else
echo "Skipping update for untracked branch $BUILDKITE_BRANCH"
fi