77 lines
1.9 KiB
Groovy
77 lines
1.9 KiB
Groovy
#!/usr/bin/env groovy
|
|
library 'status-jenkins-lib@v1.9.1'
|
|
|
|
pipeline {
|
|
agent { label 'linux && x86_64 && nix-2.19' }
|
|
|
|
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()
|
|
ansiColor('xterm')
|
|
/* Prevent Jenkins jobs from running forever */
|
|
timeout(time: 10, unit: 'MINUTES')
|
|
disableConcurrentBuilds()
|
|
/* manage how many builds we keep */
|
|
buildDiscarder(logRotator(
|
|
numToKeepStr: '5',
|
|
daysToKeepStr: '30',
|
|
artifactNumToKeepStr: '1',
|
|
))
|
|
}
|
|
|
|
environment {
|
|
PLATFORM = 'android'
|
|
TMPDIR = "${WORKSPACE_TMP}"
|
|
GOPATH = "${WORKSPACE_TMP}/go"
|
|
GOCACHE = "${WORKSPACE_TMP}/gocache"
|
|
PATH = "${PATH}:${GOPATH}/bin"
|
|
REPO_SRC = "${GOPATH}/src/github.com/status-im/status-go"
|
|
ARTIFACT = utils.pkgFilename(name: "status-go", type: "android", ext: "aar", version: sh(script: "./_assets/scripts/version.sh", returnStdout: true))
|
|
}
|
|
|
|
stages {
|
|
stage('Setup') {
|
|
steps { /* Go needs to find status-go in GOPATH. */
|
|
sh "mkdir -p \$(dirname ${REPO_SRC})"
|
|
sh "ln -s ${WORKSPACE} ${REPO_SRC}"
|
|
}
|
|
}
|
|
|
|
stage('Compile') {
|
|
steps { script {
|
|
nix.shell('make statusgo-android', pure: false)
|
|
sh "mv build/bin/statusgo.aar ${ARTIFACT}"
|
|
} }
|
|
}
|
|
|
|
stage('Archive') {
|
|
steps { script {
|
|
archiveArtifacts(ARTIFACT)
|
|
} }
|
|
}
|
|
|
|
stage('Upload') {
|
|
steps { script {
|
|
env.PKG_URL = s5cmd.upload(ARTIFACT)
|
|
} }
|
|
}
|
|
} // stages
|
|
post {
|
|
success { script { github.notifyPR(true) } }
|
|
failure { script { github.notifyPR(false) } }
|
|
cleanup { sh 'make deep-clean' }
|
|
} // post
|
|
} // pipeline
|