Sha256: e297e58c578a932ccdba95aff2fd25a15a2e3615b8973c3daebd88f417beca2b

Contents?: true

Size: 1.86 KB

Versions: 6

Compression:

Stored size: 1.86 KB

Contents

#!/usr/bin/groovy

@Library('jenkins-pipeline@v0.4.4')

def setGithubStatus(String name, String description, String status) {
  gitHubStatus([
    repoSlug:    'Invoca/active_support-deprecation_test_helper',
    sha:         env.GIT_COMMIT,
    description: description,
    context:     name,
    targetURL:   env.RUN_DISPLAY_URL,
    token:       env.GITHUB_TOKEN,
    status:      status
  ])
}

pipeline {
  agent {
    kubernetes {
      defaultContainer 'ruby'
      yamlFile '.jenkins/ruby_build_pod.yml'
    }
  }

  environment { GITHUB_TOKEN = credentials('github_token') }

  stages {
    stage("Setup") {
      steps {
        setGithubStatus('clean-build', 'Running unit tests', 'pending')
        sh 'bundle install'
        sh 'bundle exec appraisal install'
      }
    }

    stage("Appraisals") {
      parallel {
        stage("Current") {
          environment { JUNIT_OUTPUT = 'spec/reports/current/rspec.xml' }
          steps { sh 'bundle exec rake' }
          post { always { junit JUNIT_OUTPUT } }
        }

        stage("Rails 4") {
          environment { JUNIT_OUTPUT = 'spec/reports/rails-4/rspec.xml' }
          steps { sh 'bundle exec appraisal rails-4 rake' }
          post { always { junit JUNIT_OUTPUT } }
        }

        stage("Rails 5") {
          environment { JUNIT_OUTPUT = 'spec/reports/rails-5/rspec.xml' }
          steps { sh 'bundle exec appraisal rails-5 rake' }
          post { always { junit JUNIT_OUTPUT } }
        }

        stage("Rails 6") {
          environment { JUNIT_OUTPUT = 'spec/reports/rails-6/rspec.xml' }
          steps { sh 'bundle exec appraisal rails-6 rake' }
          post { always { junit JUNIT_OUTPUT } }
        }
      }
    }
  }

  post {
    success { setGithubStatus('clean-build', 'Passed all unit tests!', 'success') }
    failure { setGithubStatus('clean-build', 'Failure during unit tests!', 'failure') }
  }
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activesupport-deprecation_test_helper-0.1.2 .jenkins/Jenkinsfile
activesupport-deprecation_test_helper-0.1.2.pre.1 .jenkins/Jenkinsfile
activesupport-deprecation_test_helper-0.1.1 .jenkins/Jenkinsfile
activesupport-deprecation_test_helper-0.1.0 .jenkins/Jenkinsfile
activesupport-deprecation_test_helper-0.1.0.pre.2 .jenkins/Jenkinsfile
activesupport-deprecation_test_helper-0.1.0.pre.1 .jenkins/Jenkinsfile