Skip to content

Commit

Permalink
Add Jenkinsfile to produce the builder images
Browse files Browse the repository at this point in the history
  • Loading branch information
vpavlin committed May 15, 2023
1 parent 18a57eb commit c84ae74
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
34 changes: 34 additions & 0 deletions ci/Jenkinsfile.builders
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
pipeline {
agent { label 'linux' }

options {
timestamps()
timeout(time: 20, unit: 'MINUTES')
buildDiscarder(logRotator(
numToKeepStr: '10',
daysToKeepStr: '30',
))
}

parameters {
string(
name: 'REPOSITORY',
description: 'Name of container registry repository',
defaultValue: params.REPOSITORY ?: 'wakuorg',
)
}

stages {
stage('Build & Push') {
steps {
withDockerRegistry([credentialsId: "dockerhub-vacorgbot-api-token", url: ""]) {
dir("docker/base") {
sh "./build.sh --registry docker.io --repository ${params.REPOSITORY} --latest --push all"
}
}
}
}
} // stages

} // pipeline

6 changes: 6 additions & 0 deletions docker/base/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ BUILDER=
PUSH=
LOAD=
LATEST=
NO_CACHE="--no-cache"
IMAGE_NAME="nwaku-builder"

for i in `seq 1 $#`;do
Expand Down Expand Up @@ -39,6 +40,10 @@ for i in `seq 1 $#`;do
shift
LATEST="1"
;;
"--use-cache")
shift
NO_CACHE=""
;;
*)
break
;;
Expand Down Expand Up @@ -66,6 +71,7 @@ for arch in $(echo ${ARCH}); do
${BUILDER}\
${PUSH}\
${LOAD}\
${NO_CACHE}\
-t ${IMAGE_NAME}:${TAG}_${arch}\
--build-arg USER_ID=$(id -u)\
--build-arg GROUP_ID=$(id -g)\
Expand Down

0 comments on commit c84ae74

Please sign in to comment.