1
1
#! /bin/bash
2
2
# Script to create and push Docker manifest for multi-architecture support
3
- # This MUST be fun after build-and-push-observabilty-sre.sh!
3
+ # This MUST be run after build-and-push-observabilty-sre.sh!
4
4
5
5
source .buildkite/scripts/common/vm-agent.sh
6
6
source .buildkite/scripts/dra/docker-env-setup.sh
7
7
8
8
docker_login
9
+
10
+ # Set INCLUDE_SHA to include git SHA in version
11
+ export INCLUDE_SHA=1
9
12
QUALIFIED_VERSION=" $( .buildkite/scripts/common/qualified-version.sh) "
10
- SHA=" $( git rev-parse --short HEAD) "
11
13
REGISTRY_PATH=docker.elastic.co/logstash/logstash-observability-sre
12
14
13
15
# Architecture-specific tags (created by the build steps)
14
- X86_64_TAG=" ${QUALIFIED_VERSION} -${SHA} - x86_64"
15
- AARCH64_TAG=" ${QUALIFIED_VERSION} -${SHA} - aarch64"
16
+ X86_64_TAG=" ${QUALIFIED_VERSION} -x86_64"
17
+ AARCH64_TAG=" ${QUALIFIED_VERSION} -aarch64"
16
18
17
- # Target manifest tags
18
- SHA_MANIFEST_TAG=" ${QUALIFIED_VERSION} -${SHA} "
19
+ # Target manifest tags - already has SHA from QUALIFIED_VERSION
19
20
VERSION_MANIFEST_TAG=" ${QUALIFIED_VERSION} "
20
21
21
- # Create and push manifest with SHA
22
- echo " Creating manifest list for: ${REGISTRY_PATH} :${SHA_MANIFEST_TAG } "
23
- docker manifest create ${REGISTRY_PATH} :${SHA_MANIFEST_TAG } \
22
+ # Create and push manifest with version (which already includes SHA)
23
+ echo " Creating manifest list for: ${REGISTRY_PATH} :${VERSION_MANIFEST_TAG } "
24
+ docker manifest create ${REGISTRY_PATH} :${VERSION_MANIFEST_TAG } \
24
25
${REGISTRY_PATH} :${X86_64_TAG} \
25
26
${REGISTRY_PATH} :${AARCH64_TAG}
26
27
27
- docker manifest annotate ${REGISTRY_PATH} :${SHA_MANIFEST_TAG } \
28
+ docker manifest annotate ${REGISTRY_PATH} :${VERSION_MANIFEST_TAG } \
28
29
${REGISTRY_PATH} :${X86_64_TAG} --os linux --arch amd64
29
30
30
- docker manifest annotate ${REGISTRY_PATH} :${SHA_MANIFEST_TAG } \
31
+ docker manifest annotate ${REGISTRY_PATH} :${VERSION_MANIFEST_TAG } \
31
32
${REGISTRY_PATH} :${AARCH64_TAG} --os linux --arch arm64
32
33
33
- echo " Pushing manifest: ${REGISTRY_PATH} :${SHA_MANIFEST_TAG } "
34
- docker manifest push ${REGISTRY_PATH} :${SHA_MANIFEST_TAG }
34
+ echo " Pushing manifest: ${REGISTRY_PATH} :${VERSION_MANIFEST_TAG } "
35
+ docker manifest push ${REGISTRY_PATH} :${VERSION_MANIFEST_TAG }
35
36
36
- # Create and push manifest without SHA (just version)
37
- echo " Creating manifest list for: ${REGISTRY_PATH} :${VERSION_MANIFEST_TAG} "
38
- docker manifest create ${REGISTRY_PATH} :${VERSION_MANIFEST_TAG} \
37
+ # Also create version without SHA for effective "latest" tag
38
+ export INCLUDE_SHA=" "
39
+ BASE_VERSION=" $( .buildkite/scripts/common/qualified-version.sh) "
40
+ echo " Creating manifest list for: ${REGISTRY_PATH} :${BASE_VERSION} "
41
+ docker manifest create ${REGISTRY_PATH} :${BASE_VERSION} \
39
42
${REGISTRY_PATH} :${X86_64_TAG} \
40
43
${REGISTRY_PATH} :${AARCH64_TAG}
41
44
42
- docker manifest annotate ${REGISTRY_PATH} :${VERSION_MANIFEST_TAG } \
45
+ docker manifest annotate ${REGISTRY_PATH} :${BASE_VERSION } \
43
46
${REGISTRY_PATH} :${X86_64_TAG} --os linux --arch amd64
44
47
45
- docker manifest annotate ${REGISTRY_PATH} :${VERSION_MANIFEST_TAG } \
48
+ docker manifest annotate ${REGISTRY_PATH} :${BASE_VERSION } \
46
49
${REGISTRY_PATH} :${AARCH64_TAG} --os linux --arch arm64
47
50
48
- echo " Pushing manifest: ${REGISTRY_PATH} :${VERSION_MANIFEST_TAG } "
49
- docker manifest push ${REGISTRY_PATH} :${VERSION_MANIFEST_TAG }
51
+ echo " Pushing manifest: ${REGISTRY_PATH} :${BASE_VERSION } "
52
+ docker manifest push ${REGISTRY_PATH} :${BASE_VERSION }
50
53
51
54
# Teardown Docker environment
52
55
source .buildkite/scripts/dra/docker-env-teardown.sh
0 commit comments