status-go/_assets/ci/Jenkinsfile.linux

81 lines
2.2 KiB
Plaintext
Raw Normal View History

2019-02-01 17:02:52 +00:00
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.',
)
}
2019-02-01 17:02:52 +00:00
options {
timestamps()
disableConcurrentBuilds()
2019-02-01 17:02:52 +00:00
/* Go requires a certain directory structure */
checkoutToSubdirectory('src/github.com/status-im/status-go')
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '10',
2019-02-01 17:02:52 +00:00
daysToKeepStr: '30',
))
}
environment {
BUILD_PLATFORM = 'linux'
STATUS_PATH = "${env.WORKSPACE}/src/github.com/status-im/status-go"
CI_DIR = "${env.STATUS_PATH}/_assets/ci"
GOPATH = "${env.WORKSPACE}"
PATH = "/usr/local/go/bin:${env.PATH}:${env.GOPATH}/bin"
2019-02-01 17:02:52 +00:00
}
stages {
stage('Prep') { steps { script {
lib = load("${env.STATUS_PATH}/_assets/ci/lib.groovy")
/* clarify what we're building */
println("Version: ${lib.getVersion()}")
println("Git Branch: ${lib.gitBranch()}")
println("Git Commit: ${lib.gitCommit()}")
/* save and create a dir for artifacts */
dest = "${env.WORKSPACE}/out"
2019-02-01 17:02:52 +00:00
sh "mkdir -p ${dest}"
/* for easier reuse */
artifact = "status-go-desktop-${lib.suffix()}.zip"
} } }
stage('Setup') { steps { dir(env.STATUS_PATH) {
sh 'make setup-build'
} } }
2020-06-03 06:22:05 +00:00
/* Sanity-check C bindings */
stage('Sanity check bindings') { steps { dir(env.STATUS_PATH) {
sh 'make statusgo-library'
} } }
2019-02-01 17:02:52 +00:00
stage('Compress') { steps { dir(env.STATUS_PATH) {
sh "zip -q -r ${dest}/${artifact} . -x *.git"
} } }
stage('Archive') { steps {
archiveArtifacts("out/${artifact}")
2019-02-01 17:02:52 +00:00
} }
stage('Upload') { steps { script {
env.PKG_URL = lib.uploadArtifact("out/${artifact}")
2019-02-01 17:02:52 +00:00
} } }
} // stages
post {
success { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(true) } }
failure { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(false) } }
always { dir(env.STATUS_PATH) {
sh 'make clean'
sh "rm -fr ${dest}"
} }
} // post
2019-02-01 17:02:52 +00:00
} // pipeline