2023-04-05 14:48:47 +00:00
|
|
|
library 'status-jenkins-lib@v1.7.0'
|
2021-05-06 15:14:58 +00:00
|
|
|
|
2019-02-01 17:02:52 +00:00
|
|
|
pipeline {
|
2023-04-05 14:48:47 +00:00
|
|
|
agent { label 'linux && x86_64 && nix-2.11' }
|
2019-02-01 17:02:52 +00:00
|
|
|
|
2019-02-25 14:59:12 +00:00
|
|
|
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 {
|
2019-02-25 09:04:53 +00:00
|
|
|
timestamps()
|
|
|
|
disableConcurrentBuilds()
|
2019-02-01 17:02:52 +00:00
|
|
|
/* manage how many builds we keep */
|
|
|
|
buildDiscarder(logRotator(
|
2021-03-04 17:08:34 +00:00
|
|
|
numToKeepStr: '5',
|
2019-02-01 17:02:52 +00:00
|
|
|
daysToKeepStr: '30',
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
2022-12-02 18:03:35 +00:00
|
|
|
TARGET = 'android'
|
2023-01-03 14:40:45 +00:00
|
|
|
TMPDIR = "${WORKSPACE_TMP}"
|
2022-12-02 18:03:35 +00:00
|
|
|
GOPATH = "${WORKSPACE_TMP}/go"
|
|
|
|
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: null)
|
2019-02-01 17:02:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
2022-12-02 18:03:35 +00:00
|
|
|
stage('Setup') {
|
|
|
|
steps { /* Go needs to find status-go in GOPATH. */
|
|
|
|
sh "mkdir -p \$(dirname ${REPO_SRC})"
|
|
|
|
sh "ln -s ${WORKSPACE} ${REPO_SRC}"
|
|
|
|
}
|
|
|
|
}
|
2019-02-01 17:02:52 +00:00
|
|
|
|
2022-12-02 18:03:35 +00:00
|
|
|
stage('Compile') {
|
|
|
|
steps { script {
|
|
|
|
nix.shell('make statusgo-android', pure: false)
|
|
|
|
sh "mv build/bin/statusgo.aar ${ARTIFACT}"
|
|
|
|
} }
|
|
|
|
}
|
2019-02-01 17:02:52 +00:00
|
|
|
|
2022-12-02 18:03:35 +00:00
|
|
|
stage('Archive') {
|
|
|
|
steps { script {
|
|
|
|
archiveArtifacts(ARTIFACT)
|
|
|
|
} }
|
|
|
|
}
|
2019-12-20 12:02:44 +00:00
|
|
|
|
2022-12-02 18:03:35 +00:00
|
|
|
stage('Upload') {
|
|
|
|
steps { script {
|
|
|
|
env.PKG_URL = s3.uploadArtifact(ARTIFACT)
|
|
|
|
} }
|
|
|
|
}
|
2019-02-01 17:02:52 +00:00
|
|
|
} // stages
|
2019-02-07 12:12:35 +00:00
|
|
|
post {
|
2021-05-06 15:14:58 +00:00
|
|
|
success { script { github.notifyPR(true) } }
|
|
|
|
failure { script { github.notifyPR(false) } }
|
2022-12-02 18:03:35 +00:00
|
|
|
cleanup { sh 'make clean' }
|
2019-02-07 12:12:35 +00:00
|
|
|
} // post
|
2019-02-01 17:02:52 +00:00
|
|
|
} // pipeline
|