2019-02-25 17:48:44 +00:00
|
|
|
pipeline {
|
|
|
|
agent { label 'linux' }
|
|
|
|
|
|
|
|
parameters {
|
|
|
|
string(
|
|
|
|
name: 'BRANCH',
|
|
|
|
defaultValue: 'develop',
|
|
|
|
description: 'Name of branch to build.'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
disableConcurrentBuilds()
|
|
|
|
/* Go requires a certain directory structure */
|
|
|
|
checkoutToSubdirectory('src/github.com/status-im/status-go')
|
|
|
|
/* manage how many builds we keep */
|
|
|
|
buildDiscarder(logRotator(
|
2020-09-07 18:37:41 +00:00
|
|
|
numToKeepStr: '10',
|
2019-02-25 17:48:44 +00:00
|
|
|
daysToKeepStr: '30',
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
|
|
|
BUILD_PLATFORM = 'linux'
|
|
|
|
STATUS_PATH = 'src/github.com/status-im/status-go'
|
|
|
|
CI_DIR = "${env.STATUS_PATH}/_assets/ci"
|
|
|
|
GOPATH = "${env.WORKSPACE}"
|
2019-06-11 17:05:47 +00:00
|
|
|
PATH = "/usr/local/go/bin:${env.PATH}:${env.GOPATH}/bin"
|
2019-02-25 17:48:44 +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()}")
|
|
|
|
} } }
|
|
|
|
|
|
|
|
stage('Setup') { steps { dir(env.STATUS_PATH) {
|
2019-12-20 12:02:44 +00:00
|
|
|
sh 'GO111MODULE=off make setup-build modvendor-install'
|
2019-02-25 17:48:44 +00:00
|
|
|
} } }
|
|
|
|
|
2019-12-20 12:02:44 +00:00
|
|
|
stage('Vendoring check') { steps { dir(env.STATUS_PATH) {
|
|
|
|
/* fail build if vendoring hasn't been done */
|
|
|
|
sh 'GO111MODULE=on make vendor && git diff --exit-code --no-color --stat vendor/'
|
|
|
|
} } } // stage(Vendoring check)
|
|
|
|
|
2019-02-25 17:48:44 +00:00
|
|
|
stage('Lint') { steps { dir(env.STATUS_PATH) {
|
|
|
|
sh 'make lint'
|
|
|
|
} } }
|
|
|
|
|
|
|
|
stage('Canary') { steps { dir(env.STATUS_PATH) {
|
|
|
|
sh 'make canary-test'
|
|
|
|
} } }
|
|
|
|
|
|
|
|
stage('Unit Tests') { steps { dir(env.STATUS_PATH) {
|
|
|
|
sh 'make test-unit'
|
|
|
|
} } }
|
|
|
|
|
|
|
|
stage('Race E2E Tests') { steps { dir(env.STATUS_PATH) {
|
|
|
|
sh 'make test-e2e-race'
|
|
|
|
} } }
|
|
|
|
} // stages
|
|
|
|
} // pipeline
|