Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit ce01608

Browse files
authored
Merge branch 'master' into feature/stashv2
2 parents 06d853f + eccd15c commit ce01608

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.ci/buildDockerImages.groovy

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,14 +345,15 @@ pipeline {
345345
dir("opbot-latest"){
346346
script {
347347
def creds = getVaultSecret('secret/k8s/elastic-apps/apm/opbot-google-creds')
348-
writeFile(file: 'credentials.json', text: creds.data.value)
348+
def writeClosure = {writeFile(file: 'credentials.json', text: creds.data.value)}
349+
buildDockerImage(
350+
repo: 'https://github.com/elastic/opbot.git',
351+
tag: "opbot",
352+
version: "latest",
353+
prepareWith: writeClosure,
354+
push: true)
349355
}
350356
}
351-
buildDockerImage(
352-
repo: 'https://github.com/elastic/opbot.git',
353-
tag: "opbot",
354-
version: "latest",
355-
push: true)
356357
}
357358
post {
358359
cleanup {
@@ -382,6 +383,7 @@ def buildDockerImage(args){
382383
def env = args.containsKey('env') ? args.env : []
383384
String options = args.containsKey('options') ? args.options : ""
384385
boolean push = args.containsKey('push') ? args.push : false
386+
def prepareWith = args.containsKey('prepareWith') ? args.prepareWith : {}
385387

386388
def image = "${params.registry}"
387389
if(params.tag_prefix != null && params.tag_prefix != ""){
@@ -392,6 +394,7 @@ def buildDockerImage(args){
392394
git credentialsId: '2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken', url: "${repo}"
393395
dir("${folder}"){
394396
withEnv(env){
397+
prepareWith()
395398
sh(label: "build docker image", script: "docker build ${options} -t ${image} .")
396399
if(push){
397400
retry(3){

0 commit comments

Comments
 (0)