status-go/_assets/ci/Jenkinsfile.android

83 lines
2.3 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: '30',
daysToKeepStr: '30',
))
}
environment {
BUILD_PLATFORM = 'android'
2019-02-01 17:02:52 +00:00
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"
ANDROID_HOME = '/usr/lib/android-sdk'
ANDROID_SDK_ROOT = '/usr/lib/android-sdk'
/* gomobile requires a specific NDK version */
ANDROID_NDK = "${env.NDK_GOMOBILE}"
ANDROID_NDK_HOME = "${env.NDK_GOMOBILE}"
2019-02-01 17:02:52 +00:00
}
stages {
stage('Prep') { steps { script {
lib = load("${CI_DIR}/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-android-${lib.suffix()}.aar"
} } }
stage('Setup') { steps { dir(env.STATUS_PATH) {
sh 'make setup-build'
} } }
stage('Compile') { steps { dir(env.STATUS_PATH) {
sh 'make statusgo-android'
sh "cp build/bin/statusgo.aar ${dest}/${artifact}"
} } }
stage('Archive') { steps {
archiveArtifacts("pkg/${artifact}")
} }
stage('Upload') { steps { script {
env.PKG_URL = lib.uploadArtifact("pkg/${artifact}")
2019-02-01 17:02:52 +00:00
} } }
stage('Cleanup') { steps { dir(env.STATUS_PATH) {
sh 'make clean'
sh "rm -fr ${dest}"
} } }
} // stages
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