Skip to content

Commit 2084230

Browse files
committed
POC for publishing observability SRE images
This commit adds a step to the pull_request_pipeline buildkite definition to push a docker image to the elastic container registry. It is added here to show that we have the proper creds etc in CI to push the container where it needs to go. We will likely move this into the DRA pipeline once we are confident it is pushing to the correct place with a naming convention that works for all consumers/producers. The general idea is to build the container with our gradle task, then once we have that image we can tag it with the git sha and a "latest" identifier. This would allow consumers to choose between an exact sha for a stream like 8.19.0 or the "latest". I will also need to factor in the case where we have the tag *without* the sha postfix. Obviously we will want to fold this in to the existing DRA pipeline for building/staging images but for now it seems reasonable to handle this separately.
1 parent 182f15e commit 2084230

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.buildkite/pull_request_pipeline.yml

+23
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,29 @@ steps:
142142
docker run docker.elastic.co/logstash/logstash-observability-sre:$${QUALIFIED_VERSION} \
143143
logstash -e 'input { generator { count => 3 } } output { stdout { codec => rubydebug } }'
144144
145+
- label: "Observability SRE publishing POC"
146+
key: "observability-sre-container-publishing-poc"
147+
agents:
148+
provider: gcp
149+
imageProject: elastic-images-prod
150+
image: family/platform-ingest-logstash-ubuntu-2204
151+
machineType: "n2-standard-4"
152+
diskSizeGb: 64
153+
command: |
154+
set -euo pipefail
155+
source .buildkite/scripts/common/vm-agent.sh
156+
source .buildkite/scripts/dra/docker-env-setup.sh
157+
docker_login
158+
QUALIFIED_VERSION="$(.buildkite/scripts/common/qualified-version.sh)"
159+
SHA="$(git rev-parse --short HEAD)"
160+
DOCKER_REPOSITORY=docker.elastic.co/logstash/logstash-observability-sre
161+
./gradlew --stacktrace artifactDockerObservabilitySRE -PfedrampHighMode=true
162+
docker tag $DOCKER_REPOSITORY:$QUALIFIED_VERSION $DOCKER_REPOSITORY:$QUALIFIED_VERSION-$SHA
163+
docker push $DOCKER_REPOSITORY:$QUALIFIED_VERSION-$SHA
164+
docker tag $DOCKER_REPOSITORY:$QUALIFIED_VERSION $DOCKER_REPOSITORY:$QUALIFIED_VERSION-latest
165+
docker push $DOCKER_REPOSITORY:$QUALIFIED_VERSION-latest
166+
source .buildkite/scripts/dra/docker-env-teardown.sh
167+
145168
- label: ":lab_coat: Integration Tests - FIPS mode / part 1-of-3"
146169
key: "integration-tests-fips-part-1-of-3"
147170
agents:

0 commit comments

Comments
 (0)