2018-09-25 13:05:00 +00:00
|
|
|
pipeline {
|
|
|
|
agent { label 'linux' }
|
2017-09-15 16:14:36 +00:00
|
|
|
|
2018-09-25 13:05:00 +00:00
|
|
|
parameters {
|
|
|
|
booleanParam(
|
2018-11-27 12:01:34 +00:00
|
|
|
name: 'RELEASE',
|
|
|
|
description: 'Enable to create a new release on GitHub and DigitalOcean Space.',
|
2018-09-25 13:05:00 +00:00
|
|
|
defaultValue: false,
|
|
|
|
)
|
|
|
|
}
|
2017-09-21 18:38:25 +00:00
|
|
|
|
2018-09-25 13:05:00 +00:00
|
|
|
options {
|
|
|
|
disableConcurrentBuilds()
|
|
|
|
/* 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',
|
|
|
|
))
|
|
|
|
}
|
2017-09-15 16:14:36 +00:00
|
|
|
|
2018-09-25 13:05:00 +00:00
|
|
|
environment {
|
|
|
|
STATUS_PATH = 'src/github.com/status-im/status-go'
|
|
|
|
GOPATH = "${env.WORKSPACE}"
|
|
|
|
PATH = "${env.PATH}:${env.GOPATH}/bin"
|
|
|
|
}
|
2017-09-15 16:14:36 +00:00
|
|
|
|
2018-09-25 13:05:00 +00:00
|
|
|
stages {
|
|
|
|
stage('Prep') {
|
|
|
|
steps { script {
|
|
|
|
lib = load("${env.STATUS_PATH}/_assets/ci/lib.groovy")
|
2018-12-06 12:22:18 +00:00
|
|
|
version = readFile("${STATUS_PATH}/VERSION").trim()
|
|
|
|
println("Version: ${version}")
|
2018-09-25 13:05:00 +00:00
|
|
|
println("Git Branch: ${lib.gitBranch()}")
|
|
|
|
println("Git Commit: ${lib.gitCommit()}")
|
2018-12-06 12:22:18 +00:00
|
|
|
/* save and create a dir for artifacts */
|
|
|
|
dest = "${env.WORKSPACE}/pkg"
|
|
|
|
sh "mkdir -p ${dest}"
|
2018-09-25 13:05:00 +00:00
|
|
|
} }
|
2017-09-15 16:14:36 +00:00
|
|
|
}
|
2018-09-25 13:05:00 +00:00
|
|
|
stage('Setup') { steps { dir(env.STATUS_PATH) {
|
|
|
|
sh 'make setup'
|
2018-11-26 09:42:18 +00:00
|
|
|
sh 'make xgo'
|
2018-09-25 13:05:00 +00:00
|
|
|
} } }
|
|
|
|
stage('Lint') { steps { dir(env.STATUS_PATH) {
|
|
|
|
sh 'make ci'
|
|
|
|
} } }
|
2017-09-15 16:14:36 +00:00
|
|
|
stage('Build') {
|
2018-09-25 13:05:00 +00:00
|
|
|
parallel {
|
|
|
|
stage('Android') {
|
|
|
|
stages {
|
|
|
|
stage('Compile') { steps { dir(env.STATUS_PATH) {
|
|
|
|
sh 'make statusgo-android'
|
2018-12-06 12:22:18 +00:00
|
|
|
sh "cp build/bin/statusgo-android-16.aar ${dest}/status-go-android-${lib.suffix()}.aar"
|
2018-09-25 13:05:00 +00:00
|
|
|
} } }
|
|
|
|
stage('Archive') { steps {
|
2018-12-06 12:22:18 +00:00
|
|
|
archiveArtifacts("pkg/status-go-android-${lib.suffix()}.aar")
|
2018-09-25 13:05:00 +00:00
|
|
|
} }
|
|
|
|
stage('Upload') { steps { script {
|
2018-12-06 12:22:18 +00:00
|
|
|
lib.uploadArtifact("pkg/status-go-android-${lib.suffix()}.aar")
|
2018-11-27 12:01:34 +00:00
|
|
|
} } }
|
2018-09-25 13:05:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('iOS') {
|
|
|
|
stages {
|
|
|
|
stage('Compile') { steps { dir(env.STATUS_PATH) {
|
|
|
|
sh 'make statusgo-ios-simulator'
|
|
|
|
dir('build/bin/statusgo-ios-9.3-framework') {
|
|
|
|
sh 'zip -r status-go-ios.zip Statusgo.framework'
|
2018-12-06 12:22:18 +00:00
|
|
|
sh "cp status-go-ios.zip ${dest}/status-go-ios-${lib.suffix()}.zip"
|
2018-09-25 13:05:00 +00:00
|
|
|
}
|
|
|
|
} } }
|
|
|
|
stage('Archive') { steps {
|
2018-12-06 12:22:18 +00:00
|
|
|
archiveArtifacts("pkg/status-go-ios-${lib.suffix()}.zip")
|
2018-09-25 13:05:00 +00:00
|
|
|
} }
|
|
|
|
stage('Upload') { steps { script {
|
2018-12-06 12:22:18 +00:00
|
|
|
lib.uploadArtifact("pkg/status-go-ios-${lib.suffix()}.zip")
|
|
|
|
} } }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Desktop') {
|
|
|
|
stages {
|
|
|
|
stage('Prepare') { steps { dir(env.STATUS_PATH) {
|
|
|
|
sh "zip -r ${dest}/status-go-desktop-${lib.suffix()}.zip . -x *.git"
|
2018-09-25 13:05:00 +00:00
|
|
|
} } }
|
2018-12-06 12:22:18 +00:00
|
|
|
stage('Archive') { steps {
|
|
|
|
archiveArtifacts("pkg/status-go-desktop-${lib.suffix()}.zip")
|
|
|
|
} }
|
|
|
|
stage('Upload') { steps { script {
|
|
|
|
lib.uploadArtifact("pkg/status-go-desktop-${lib.suffix()}.zip")
|
2018-11-27 12:01:34 +00:00
|
|
|
} } }
|
2018-09-25 13:05:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-09-15 16:14:36 +00:00
|
|
|
}
|
2018-11-27 12:01:34 +00:00
|
|
|
stage('Release') { when { expression { params.RELEASE == true } }
|
2018-12-06 12:22:18 +00:00
|
|
|
steps { dir(env.STATUS_PATH) {
|
|
|
|
sh 'make prepare-release'
|
|
|
|
withCredentials([[
|
|
|
|
$class: 'UsernamePasswordMultiBinding',
|
|
|
|
credentialsId: 'status-im-auto',
|
|
|
|
usernameVariable: 'GITHUB_USER',
|
|
|
|
passwordVariable: 'GITHUB_TOKEN'
|
|
|
|
]]) {
|
|
|
|
sh "yes | make release RELEASE_BRANCH=${lib.gitBranch()}"
|
2018-09-25 13:05:00 +00:00
|
|
|
}
|
2018-12-06 12:22:18 +00:00
|
|
|
sh 'make clean-release'
|
|
|
|
} }
|
2017-09-15 16:14:36 +00:00
|
|
|
}
|
2018-12-06 12:22:18 +00:00
|
|
|
stage('Cleanup') { steps { script {
|
|
|
|
sh "rm -fr ${dest}"
|
|
|
|
} } }
|
2018-09-25 13:05:00 +00:00
|
|
|
}
|
2017-09-15 16:14:36 +00:00
|
|
|
}
|