github.com/status-im/status-go@v1.1.0/_assets/ci/Jenkinsfile.linux (about) 1 #!/usr/bin/env groovy 2 library 'status-jenkins-lib@v1.9.6' 3 4 pipeline { 5 agent { label 'linux && x86_64 && nix-2.19' } 6 7 parameters { 8 string( 9 name: 'BRANCH', 10 defaultValue: 'develop', 11 description: 'Name of branch to build.' 12 ) 13 booleanParam( 14 name: 'RELEASE', 15 defaultValue: false, 16 description: 'Enable to create build for release.', 17 ) 18 } 19 20 options { 21 timestamps() 22 ansiColor('xterm') 23 /* Prevent Jenkins jobs from running forever */ 24 timeout(time: 10, unit: 'MINUTES') 25 disableConcurrentBuilds() 26 /* manage how many builds we keep */ 27 buildDiscarder(logRotator( 28 numToKeepStr: '5', 29 daysToKeepStr: '30', 30 artifactNumToKeepStr: '1', 31 )) 32 } 33 34 environment { 35 PLATFORM = 'linux' 36 TMPDIR = "${WORKSPACE_TMP}" 37 GOPATH = "${WORKSPACE_TMP}/go" 38 GOCACHE = "${WORKSPACE_TMP}/gocache" 39 PATH = "${PATH}:${GOPATH}/bin" 40 REPO_SRC = "${GOPATH}/src/github.com/status-im/status-go" 41 VERSION = sh(script: "./_assets/scripts/version.sh", returnStdout: true) 42 ARTIFACT = utils.pkgFilename( 43 name: 'status-go', 44 type: env.PLATFORM, 45 version: env.VERSION, 46 ext: 'zip', 47 ) 48 } 49 50 stages { 51 stage('Setup') { 52 steps { /* Go needs to find status-go in GOPATH. */ 53 sh "mkdir -p \$(dirname ${REPO_SRC})" 54 sh "ln -s ${WORKSPACE} ${REPO_SRC}" 55 } 56 } 57 58 /* Sanity-check C bindings */ 59 stage('Build Static Lib') { 60 steps { script { 61 nix.shell('make statusgo-library', pure: false) 62 } } 63 } 64 65 stage('Build Shared Lib') { 66 steps { script { 67 nix.shell('make statusgo-shared-library', pure: false) 68 } } 69 } 70 71 stage('Archive') { 72 steps { 73 sh "zip -q -r ${ARTIFACT} build/bin" 74 archiveArtifacts(ARTIFACT) 75 } 76 } 77 78 stage('Upload') { 79 steps { script { 80 env.PKG_URL = s5cmd.upload(ARTIFACT) 81 } } 82 } 83 } // stages 84 post { 85 success { script { github.notifyPR(true) } } 86 failure { script { github.notifyPR(false) } } 87 cleanup { sh 'make deep-clean' } 88 } // post 89 } // pipeline