Skip to content

Commit

Permalink
Set commit msg when updating gitops repo to publish new image
Browse files Browse the repository at this point in the history
This update sets the commit message to push to the gitops repository when a new Kibana image is published.

Also to align with the other services the IMAGE_TAG is prefixed by `git-` and use a 12 characters short commit
  • Loading branch information
mgreau committed Feb 13, 2023
1 parent f1046e5 commit 9a59b27
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .buildkite/scripts/steps/artifacts/docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ set -euo pipefail

source .buildkite/scripts/steps/artifacts/env.sh

GIT_ABBREV_COMMIT=${BUILDKITE_COMMIT:0:7}
KIBANA_IMAGE="docker.elastic.co/kibana-ci/kibana:$GIT_ABBREV_COMMIT"
GIT_ABBREV_COMMIT=${BUILDKITE_COMMIT:0:12}
KIBANA_IMAGE="docker.elastic.co/kibana-ci/kibana:git-$GIT_ABBREV_COMMIT"

echo "--- Verify manifest does not already exist"
echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co
Expand Down Expand Up @@ -82,16 +82,17 @@ if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]]; then
cat << EOF | buildkite-agent pipeline upload
steps:
- trigger: k8s-gitops-update-image-tag
label: ":argo: Update image tag for deployment-api"
label: ":argo: Update image tag for Kibana"
branches: main
build:
env:
MODE: sed
TARGET_FILE: kibana-controller.yaml
IMAGE_TAG: "$GIT_ABBREV_COMMIT"
IMAGE_TAG: "git-$GIT_ABBREV_COMMIT"
SERVICE: kibana-controller
NAMESPACE: kibana-ci
IMAGE_NAME: kibana
COMMIT_MESSAGE: "gitops: update kibana tag to elastic/kibana@$BUILDKITE_COMMIT"
EOF

else
Expand Down

0 comments on commit 9a59b27

Please sign in to comment.