Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 0c43296

Browse files
wolfi+ci: improve wolfi image annotation (#57586)
* add wolfi annotation ctx * fix formatting of annoation and use annotatedCmd * add job output link * Update wolfi-images/cadvisor.yaml Co-authored-by: Will Dollman <will.dollman@sourcegraph.com> --------- Co-authored-by: Will Dollman <will.dollman@sourcegraph.com>
1 parent d2afcf8 commit 0c43296

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

dev/ci/internal/ci/wolfi_operations.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,15 @@ func buildWolfiBaseImage(target string, tag string, dependOnPackages bool) (func
101101

102102
return func(pipeline *bk.Pipeline) {
103103

104+
cmd := fmt.Sprintf("./dev/ci/scripts/wolfi/build-base-image.sh %s %s", target, tag)
104105
opts := []bk.StepOpt{
105-
bk.Cmd(fmt.Sprintf("./dev/ci/scripts/wolfi/build-base-image.sh %s %s", target, tag)),
106+
bk.AnnotatedCmd(cmd, bk.AnnotatedCmdOpts{
107+
Annotations: &bk.AnnotationOpts{
108+
Type: bk.AnnotationTypeInfo,
109+
IncludeNames: false,
110+
MultiJobContext: "wolfi-images",
111+
},
112+
}),
106113
// We want to run on the bazel queue, so we have a pretty minimal agent.
107114
bk.Agent("queue", "bazel"),
108115
bk.Env("DOCKER_BAZEL", "true"),

dev/ci/scripts/wolfi/build-base-image.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,19 @@ fi
148148
# Show image usage message on branches
149149
if [[ "$IS_MAIN" != "true" ]]; then
150150
if [[ -n "$BUILDKITE" ]]; then
151-
echo -e "Run the \`${name}\` base image locally using:
152-
\`\`\`
151+
mkdir -p ./annotations
152+
file="${name} image.md"
153+
cat <<-EOF > "${REPO_DIR}/annotations/${file}"
154+
155+
<strong>:octopus: ${name} image &bull; [View job output](#${BUILDKITE_JOB_ID})</strong>
156+
<br />
157+
<br />
158+
Run the \`${name}\` base image locally using:
159+
160+
\`\`\`bash
153161
docker pull us.gcr.io/sourcegraph-dev/wolfi-${name}-base:${tag}
154-
\`\`\`" | "$REPO_DIR/dev/ci/scripts/annotate.sh" -m -t "info"
162+
\`\`\`
163+
164+
EOF
155165
fi
156166
fi

0 commit comments

Comments
 (0)