[ci] Verify docker contexts (#122897)

* [ci] Verify docker contexts

* bootstrap

* debug

* mkdir target

* change subdomain if snapshot

* move to separate pipeline

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Jonathan Budzenski 2022-02-15 13:46:42 -06:00 committed by GitHub
parent 292c25d947
commit 16f3eb352c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 1 deletions

View file

@ -0,0 +1,11 @@
steps:
- command: .buildkite/scripts/steps/docker_context/build.sh
label: 'Docker Build Context'
agents:
queue: n2-4
timeout_in_minutes: 30
key: build-docker-context
retry:
automatic:
- exit_status: '*'
limit: 1

View file

@ -0,0 +1,16 @@
#!/bin/bash
set -euo pipefail
.buildkite/scripts/bootstrap.sh
echo "--- Create Kibana Docker contexts"
mkdir -p target
node scripts/build --skip-initialize --skip-generic-folders --skip-platform-folders --skip-archives
echo "--- Build default context"
DOCKER_BUILD_FOLDER=$(mktemp -d)
tar -xf target/kibana-[0-9]*-docker-build-context.tar.gz -C "$DOCKER_BUILD_FOLDER"
cd $DOCKER_BUILD_FOLDER
docker build .

View file

@ -76,6 +76,7 @@ export async function runDockerGenerator(
const dockerPush = config.getDockerPush();
const dockerTagQualifier = config.getDockerTagQualfiier();
const publicArtifactSubdomain = config.isRelease ? 'artifacts' : 'snapshots-no-kpi';
const scope: TemplateContext = {
artifactPrefix,
@ -100,6 +101,7 @@ export async function runDockerGenerator(
ironbank: flags.ironbank,
architecture: flags.architecture,
revision: config.getBuildSha(),
publicArtifactSubdomain,
};
type HostArchitectureToDocker = Record<string, string>;

View file

@ -22,6 +22,7 @@ export interface TemplateContext {
baseOSImage: string;
dockerBuildDate: string;
usePublicArtifact?: boolean;
publicArtifactSubdomain: string;
ubi?: boolean;
ubuntu?: boolean;
cloud?: boolean;

View file

@ -22,7 +22,7 @@ RUN {{packageManager}} update && DEBIAN_FRONTEND=noninteractive {{packageManager
RUN cd /tmp && \
curl --retry 8 -s -L \
--output kibana.tar.gz \
https://artifacts.elastic.co/downloads/kibana/{{artifactPrefix}}-$(arch).tar.gz && \
https://{{publicArtifactSubdomain}}.elastic.co/downloads/kibana/{{artifactPrefix}}-$(arch).tar.gz && \
cd -
{{/usePublicArtifact}}