2019-02-01 17:02:52 +00:00
|
|
|
pipeline {
|
|
|
|
agent { label 'linux' }
|
|
|
|
|
|
|
|
options {
|
2019-02-25 09:04:53 +00:00
|
|
|
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: '30',
|
|
|
|
daysToKeepStr: '30',
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
2019-02-07 12:12:35 +00:00
|
|
|
BUILD_PLATFORM = 'linux'
|
|
|
|
STATUS_PATH = 'src/github.com/status-im/status-go'
|
|
|
|
CI_DIR = "${env.STATUS_PATH}/_assets/ci"
|
|
|
|
GOPATH = "${env.WORKSPACE}"
|
|
|
|
PATH = "${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}/pkg"
|
|
|
|
sh "mkdir -p ${dest}"
|
|
|
|
/* for easier reuse */
|
|
|
|
artifact = "status-go-desktop-${lib.suffix()}.zip"
|
|
|
|
} } }
|
|
|
|
|
2019-02-07 12:12:35 +00:00
|
|
|
stage('Setup') { steps { dir(env.STATUS_PATH) {
|
|
|
|
sh 'make setup-build'
|
|
|
|
} } }
|
|
|
|
|
|
|
|
stage('Test') { steps { dir(env.STATUS_PATH) {
|
|
|
|
sh 'make ci'
|
|
|
|
} } }
|
|
|
|
|
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("pkg/${artifact}")
|
|
|
|
} }
|
|
|
|
|
|
|
|
stage('Upload') { steps { script {
|
2019-02-07 12:12:35 +00:00
|
|
|
env.PKG_URL = lib.uploadArtifact("pkg/${artifact}")
|
2019-02-01 17:02:52 +00:00
|
|
|
} } }
|
|
|
|
} // stages
|
2019-02-07 12:12:35 +00:00
|
|
|
post {
|
|
|
|
success { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(true) } }
|
|
|
|
failure { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(false) } }
|
|
|
|
} // post
|
2019-02-01 17:02:52 +00:00
|
|
|
} // pipeline
|