Sha256: 62f7f80063bef3125860c243931c3eac41942c6e45b8503a5fddc0ac5bf941b6

Contents?: true

Size: 1.41 KB

Versions: 5

Compression:

Stored size: 1.41 KB

Contents

#!/usr/bin/env groovy

pipeline {
  agent { label 'executor-v2' }

  options {
    timestamps()
    buildDiscarder(logRotator(numToKeepStr: '30'))
  }

  stages {
    stage('Test') {
      steps {
        milestone(1)
        sh './test.sh'

        junit 'spec/reports/*.xml'
        junit 'features/reports/*.xml'
        junit 'features_v4/reports/*.xml'
      }
    }

    // Only publish to RubyGems if branch is 'master'
    // AND someone confirms this stage within 5 minutes
    stage('Publish to RubyGems?') {
      agent { label 'releaser-v2' }

      when {
        allOf {
          branch 'master'
          expression {
            boolean publish = false

            if (env.PUBLISH_GEM == "true") {
                return true
            }

            try {
              timeout(time: 5, unit: 'MINUTES') {
                input(message: 'Publish to RubyGems?')
                publish = true
              }
            } catch (final ignore) {
              publish = false
            }

            return publish
          }
        }
      }
      steps {
        // Clean up first
        sh 'docker run -i --rm -v $PWD:/src -w /src alpine/git clean -fxd'

        sh './publish.sh'

        // Clean up again...
        sh 'docker run -i --rm -v $PWD:/src -w /src alpine/git clean -fxd'
        deleteDir()
      }
    }
  }

  post {
    always {
      cleanupAndNotify(currentBuild.currentResult)
    }
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
conjur-api-5.3.1 Jenkinsfile
conjur-api-5.3.0 Jenkinsfile
conjur-api-5.2.1 Jenkinsfile
conjur-api-5.2.0 Jenkinsfile
conjur-api-5.1.0 Jenkinsfile