Skip to content

Commit

Permalink
[CI] Build docker image during packer_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
brianseeders committed Oct 30, 2020
1 parent 70807c9 commit 39c6158
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
10 changes: 10 additions & 0 deletions .ci/build_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -euo pipefail

cd "$(dirname "${0}")"

cp /usr/local/bin/runbld ./
cp /usr/local/bin/bash_standard_lib.sh ./

docker build -t kibana-ci -f ./Dockerfile .
2 changes: 2 additions & 0 deletions .ci/packer_cache_for_branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ find . -type d -name node_modules -not -path '*__fixtures__*' -prune -print0 | x

echo "created $HOME/.kibana/bootstrap_cache/$branch.tar"

.ci/build_docker.sh

if [[ "$branch" != "master" ]]; then
rm --preserve-root -rf "$checkoutDir"
fi
21 changes: 8 additions & 13 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@
library 'kibana-pipeline-library'
kibanaLibrary.load()

kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true, setCommitStatus: true) {
slackNotifications.onFailure(disabled: !params.NOTIFY_ON_FAILURE) {
githubPr.withDefaultPrComments {
ciStats.trackBuild {
catchError {
retryable.enable()
kibanaPipeline.allCiTasks()
}
}
}
}
kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true) {
githubPr.withDefaultPrComments {
workers.base(name: 'packer-cache', size: 's', ramDisk: false, bootstrapped: false) {
kibanaPipeline.bash('./.ci/packer_cache.sh', 'Execute packer_cache')

if (params.NOTIFY_ON_FAILURE) {
kibanaPipeline.sendMail()
kibanaPipeline.bash("""
./ci/build_docker.sh
""", "Testing bootstrap cache")
}
}
}
7 changes: 1 addition & 6 deletions vars/kibanaPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,7 @@ def scriptTaskDocker(description, script) {

def buildDocker() {
sh(
script: """
cp /usr/local/bin/runbld .ci/
cp /usr/local/bin/bash_standard_lib.sh .ci/
cd .ci
docker build -t kibana-ci -f ./Dockerfile .
""",
script: "./ci/build_docker.sh",
label: 'Build CI Docker image'
)
}
Expand Down

0 comments on commit 39c6158

Please sign in to comment.