status-go/_assets/ci/Jenkinsfile.docker
Jakub Sokołowski 9dd80e7f1e
ci: use Nix shell to provide Android SDK for builds
Installing the SDK via Ansible is prone to error and not exactly
reproduceable. This way we can also track the exact tooling version as
used in Status Mobile app:
https://github.com/status-im/status-mobile/blob/develop/nix/pkgs.nix

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-12-05 15:48:27 +01:00

73 lines
1.9 KiB
Docker

library 'status-jenkins-lib@v1.6.4'
pipeline {
agent { label 'linux' }
parameters {
string(
name: 'BRANCH',
defaultValue: 'develop',
description: 'Name of branch to build.'
)
booleanParam(
name: 'RELEASE',
defaultValue: false,
description: 'Enable to create build for release.',
)
}
options {
timestamps()
disableConcurrentBuilds()
/* Go requires a certain directory structure */
checkoutToSubdirectory('src/github.com/status-im/status-go')
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '5',
daysToKeepStr: '30',
))
}
environment {
TARGET = "docker"
REPO = "${env.WORKSPACE}/src/github.com/status-im/status-go"
GOPATH = "${env.WORKSPACE}"
PATH = "/usr/local/go/bin:${env.PATH}:${env.GOPATH}/bin"
/* docker image settings */
IMAGE_NAME = "statusteam/status-go"
IMAGE_TAG = "deploy-test"
}
stages {
stage('Prep') { steps { dir(env.REPO) { script {
println("Output: ${env.IMAGE_NAME}:${env.IMAGE_TAG}")
} } } }
stage('Build') { steps { dir(env.REPO) { script {
sh 'make docker-image'
image = docker.image("${env.IMAGE_NAME}:v${utils.getVersion()}")
} } } }
stage('Push') { steps { dir(env.REPO) { script {
withDockerRegistry([credentialsId: "dockerhub-statusteam-auto", url: ""]) {
image.push()
}
} } } }
stage('Deploy') {
when { expression { params.RELEASE == true } }
steps { dir(env.REPO) { script {
withDockerRegistry([credentialsId: "dockerhub-statusteam-auto", url: ""]) {
image.push(env.IMAGE_TAG)
}
} } } }
} // stages
post {
success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } }
always { dir(env.REPO) {
sh 'make clean-docker-images'
} }
} // post
} // pipeline