Skip to content

Latest commit

 

History

History
76 lines (61 loc) · 2.25 KB

File metadata and controls

76 lines (61 loc) · 2.25 KB

k8s-jenkins-slave-nodejs-xvfb-chrome

Kubernetes Docker image providing Jenkins Slave JNLP with Node.JS, xvfb and Google Chrome.


 

Preinstalled Tools

tool version
yarn 1.22.4
node.js 12.16.2
npm 6.14.4
google-chrome-stable 81.0.4044.122
kubernetes cli apt-get
Xvfb apt-get
git apt-get
curl, wget apt-get
zip, bzip2 apt-get
jq apt-get

 

Usage

Use with Kubernetes Jenkins Plugin like so:

podTemplate(
  name: 'nodejs-xvfb-chrome-v34',
  label: 'k8s-jenkins-slave-nodejs-xvfb-chrome-v34',
  cloud: 'mycloud',
  nodeSelector: 'failure-domain.beta.kubernetes.io/zone=eu-west-1a',
  containers: [
    containerTemplate(
      name: 'jnlp',
      image: 'cloutainer/k8s-jenkins-slave-nodejs-xvfb-chrome:v34',
      privileged: false,
      command: '/opt/docker-entrypoint.sh',
      args: '',
      alwaysPullImage: false,
      workingDir: '/home/jenkins',
      resourceRequestCpu: '500m',
      resourceLimitCpu: '1',
      resourceRequestMemory: '3000Mi',
      resourceLimitMemory: '3000Mi'
    )
  ]
) {
  node('k8s-jenkins-slave-nodejs-xvfb-chrome-v34') {
    stage('build and test') {
      sh 'mvn -version'
      sh 'git clone https://github.com/clouless/angular-4-unit-test-dummy.git'
      dir('angular-4-unit-test-dummy') {
        sh 'yarn'
        sh 'yarn test'
      }
    }
  }
}

 

License

MIT © Bernhard Grünewaldt