mirror of https://github.com/waku-org/nwaku.git
add Jenkinsfile and some Makefile targets for CI (#302)
Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com>
This commit is contained in:
parent
3545a7e1ab
commit
cec9288598
|
@ -0,0 +1,61 @@
|
|||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
parameters {
|
||||
string(
|
||||
name: 'BRANCH',
|
||||
defaultValue: 'master',
|
||||
description: 'Name of branch to build.'
|
||||
)
|
||||
string(
|
||||
name: 'IMAGE_TAG',
|
||||
defaultValue: 'wakunode2',
|
||||
description: 'Name of Docker tag to push.'
|
||||
)
|
||||
string(
|
||||
name: 'IMAGE_NAME',
|
||||
defaultValue: 'statusteam/nim-waku',
|
||||
description: 'Name of Docker image to push.'
|
||||
)
|
||||
string(
|
||||
name: 'NIM_PARAMS',
|
||||
defaultValue: '-d:disableMarchNative -d:chronicles_colors:none -d:insecure',
|
||||
description: 'Flags for Nim compilation.'
|
||||
)
|
||||
}
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
/* manage how many builds we keep */
|
||||
buildDiscarder(logRotator(
|
||||
numToKeepStr: '10',
|
||||
daysToKeepStr: '30',
|
||||
))
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps { script {
|
||||
image = docker.build(
|
||||
"${params.IMAGE_NAME}:${env.GIT_COMMIT.take(6)}",
|
||||
"--build-arg=MAKE_TARGET='${params.IMAGE_TAG}' " +
|
||||
"--build-arg=NIM_PARAMS='${params.NIM_PARAMS}' ."
|
||||
)
|
||||
} }
|
||||
}
|
||||
|
||||
stage('Push') {
|
||||
steps { script {
|
||||
withDockerRegistry([credentialsId: "dockerhub-statusteam-auto", url: ""]) {
|
||||
image.push()
|
||||
}
|
||||
withDockerRegistry([credentialsId: "dockerhub-statusteam-auto", url: ""]) {
|
||||
image.push(params.IMAGE_TAG)
|
||||
}
|
||||
} }
|
||||
}
|
||||
} // stages
|
||||
post {
|
||||
always { sh 'docker image prune -f' }
|
||||
} // post
|
||||
} // pipeline
|
Loading…
Reference in New Issue