Skip to content

Commit

Permalink
Use same agent image version as in go.mod
Browse files Browse the repository at this point in the history
  • Loading branch information
DrJosh9000 committed Apr 2, 2024
1 parent 7832fd9 commit 634aae1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .buildkite/steps/agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ apk add --update-cache --no-progress skopeo

repo="docker.io/buildkite/agent"

echo --- Awking go.mod for agent version
agent_version="$(awk '/github\.com\/buildkite\/agent\/v3/ { print $2 }' go.mod | cut -c 2- )"
echo "Using agent version ${agent_version} as image tag"

echo --- :docker: Inspecting agent docker image manifest
digest=$(skopeo inspect "docker://${repo}:stable" --format {{.Digest}})
digest=$(skopeo inspect "docker://${repo}:${agent_version}" --format {{.Digest}})

echo Choosing image "${repo}@${digest}"
buildkite-agent meta-data set agent-image "${repo}@${digest}"

0 comments on commit 634aae1

Please sign in to comment.