github.com/status-im/status-go@v1.1.0/_assets/ci/Jenkinsfile.android (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 = 'android'
    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:     'aar',
    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      stage('Compile') {
    59        steps { script {
    60          nix.shell('make statusgo-android', pure: false)
    61          sh "mv build/bin/statusgo.aar ${ARTIFACT}"
    62        } }
    63      }
    64  
    65      stage('Archive') {
    66        steps { script {
    67          archiveArtifacts(ARTIFACT)
    68        } }
    69      }
    70  
    71      stage('Upload') {
    72        steps { script {
    73          env.PKG_URL = s5cmd.upload(ARTIFACT)
    74        } }
    75      }
    76    } // stages
    77    post {
    78      success { script { github.notifyPR(true) } }
    79      failure { script { github.notifyPR(false) } }
    80      cleanup { sh 'make deep-clean' }
    81    } // post
    82  } // pipeline