mirror of
https://github.com/waku-org/telemetry.git
synced 2025-02-21 12:18:18 +00:00
add Jenkinsfile for Docker image CI builds
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
96fded1b9b
commit
705c5b1689
53
Jenkinsfile
vendored
Normal file
53
Jenkinsfile
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
parameters {
|
||||
booleanParam(
|
||||
name: 'DEPLOY',
|
||||
description: 'Enable to deploye the Docker image.',
|
||||
defaultValue: false,
|
||||
)
|
||||
}
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
disableConcurrentBuilds()
|
||||
/* manage how many builds we keep */
|
||||
buildDiscarder(logRotator(
|
||||
numToKeepStr: '10',
|
||||
daysToKeepStr: '30',
|
||||
))
|
||||
}
|
||||
|
||||
environment {
|
||||
IMAGE_NAME = "statusteam/telemetry"
|
||||
IMAGE_DEFAULT_TAG = "${env.GIT_COMMIT.take(7)}"
|
||||
IMAGE_DEPLOY_TAG = "deploy"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Build') { steps { script {
|
||||
image = docker.build(
|
||||
"${env.IMAGE_NAME}:${env.IMAGE_DEFAULT_TAG}"
|
||||
)
|
||||
} } }
|
||||
|
||||
stage('Push') { steps { script {
|
||||
withDockerRegistry([
|
||||
credentialsId: "dockerhub-statusteam-auto"
|
||||
]) {
|
||||
image.push()
|
||||
}
|
||||
} } }
|
||||
|
||||
stage('Deploy') {
|
||||
when { expression { params.DEPLOY } }
|
||||
steps { script {
|
||||
withDockerRegistry([
|
||||
credentialsId: "dockerhub-statusteam-auto"
|
||||
]) {
|
||||
image.push(env.IMAGE_DEPLOY_TAG)
|
||||
}
|
||||
} } }
|
||||
} // stages
|
||||
} // pipeline
|
Loading…
x
Reference in New Issue
Block a user