Sha256: 305ec4b1cdb2bb51e835df6a2c83504553b40eab64539b8ef4ca8dc39910cdc2

Contents?: true

Size: 1.02 KB

Versions: 8

Compression:

Stored size: 1.02 KB

Contents

#!/usr/bin/groovy
@Library('jenkins-pipeline@v0.4.4')
import com.invoca.docker.*;

pipeline {
  agent { 
    kubernetes {
      defaultContainer 'ruby'
      yaml '''
apiVersion: v1
kind: Pod
metadata:
  labels:
    jenkins/attr-default: true
  namespace: jenkins
  name: attr-default
spec:
  containers:
  - name: ruby
    image: ruby:2.6.1
    tty: true
    command:
    - cat
'''
    }
  }
  stages {
    stage('Unit Tests') {
      environment { 
        GITHUB_KEY = credentials('github_key') 
      }

      steps {
        script {
          sh '''
            # get SSH setup inside the container
            eval `ssh-agent -s`
            echo "$GITHUB_KEY" | ssh-add -
            mkdir -p /root/.ssh
            ssh-keyscan -t rsa github.com > /root/.ssh/known_hosts

            # run tests
            bundle install --path vendor/bundle
            bundle exec rake
          '''
        }
      }

      post {
        always { junit 'test/reports/*.xml' }
      }
    }
  }

  post { always { notifySlack(currentBuild.result) } }
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
attr_default-0.8.0 Jenkinsfile
attr_default-0.8.0.pre.7 Jenkinsfile
attr_default-0.7.2 Jenkinsfile
attr_default-0.8.0.pre.6 Jenkinsfile
attr_default-0.8.0.pre.5 Jenkinsfile
attr_default-0.8.0.pre.4 Jenkinsfile
attr_default-0.8.0.pre.3 Jenkinsfile
attr_default-0.8.0.pre.2 Jenkinsfile