mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[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:
parent
292c25d947
commit
16f3eb352c
5 changed files with 31 additions and 1 deletions
11
.buildkite/pipelines/docker_context.yml
Normal file
11
.buildkite/pipelines/docker_context.yml
Normal 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
|
16
.buildkite/scripts/steps/docker_context/build.sh
Normal file
16
.buildkite/scripts/steps/docker_context/build.sh
Normal 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 .
|
|
@ -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>;
|
||||
|
|
|
@ -22,6 +22,7 @@ export interface TemplateContext {
|
|||
baseOSImage: string;
|
||||
dockerBuildDate: string;
|
||||
usePublicArtifact?: boolean;
|
||||
publicArtifactSubdomain: string;
|
||||
ubi?: boolean;
|
||||
ubuntu?: boolean;
|
||||
cloud?: boolean;
|
||||
|
|
|
@ -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}}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue