Skip to content

Jenkins Setup for BDDStack

Angelika Ehlers edited this page Feb 19, 2018 · 15 revisions

Dockerfile for Jenkins Slave BDDStack

https://github.com/BCDevOps/openshift-tools/blob/master/provisioning/jenkins-slaves/bddstack/Dockerfile

Pipeline Example:

//See https://github.com/jenkinsci/kubernetes-plugin
podTemplate(label: 'bddstack', name: 'bddstack', serviceAccount: 'jenkins', cloud: 'openshift', containers: [
  containerTemplate(
    name: 'jnlp',
    image: '172.50.0.2:5000/openshift/jenkins-slave-bddstack',
    resourceRequestCpu: '500m',
    resourceLimitCpu: '1000m',
    resourceRequestMemory: '1Gi',
    resourceLimitMemory: '4Gi',
    workingDir: '/home/jenkins',
    command: '',
    args: '${computer.jnlpmac} ${computer.name}'
  )
]) {
     node('bddstack') {
	stage('Functional Test') {
	//the checkout is mandatory, otherwise functional test would fail
          echo "checking out source"
          checkout scm
          dir('functional-tests') {
			try {
				sh './gradlew --debug --stacktrace chromeHeadlessTest'
			} finally { 
				archiveArtifacts allowEmptyArchive: true, artifacts: 'build/reports/**/*'
                                archiveArtifacts allowEmptyArchive: true, artifacts: 'build/test-results/**/*'
                                junit 'build/test-results/**/*.xml'
			}
          }
        }
     }
   }
  1. Configure Jenkins

    Kubernetes Pod Template is created on a as needed basis with the "podTemplate" instruction.

    See https://github.com/jenkinsci/kubernetes-plugin for more info.

    Therefore there is no need to configure a kubernetes pod template in the Jenkins configuration.