Created
December 27, 2016 04:47
-
-
Save otaviosoares/fc132dcb863e75161431ed00b95f06ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
podTemplate(label: 'mypod', cloud: 'Kubernetes', | |
containers: [ | |
containerTemplate(name: 'jenkins-jnlp', image: 'artyou/jenkins-slave:0.1.2', command: 'cat', ttyEnabled: true, privileged: true), | |
containerTemplate(name: 'jnlp', image: 'jenkinsci/jnlp-slave:alpine', args: '${computer.jnlpmac} ${computer.name}', privileged: true), | |
], | |
volumes: [hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock')]) { | |
node('mypod') { | |
stage('build and test') { | |
checkout scm | |
docker.image('mhart/alpine-node:4.4.3').inside { | |
env.NODE_ENV = "test" | |
sh 'apk add --update make gcc g++ python git' | |
sh 'npm install' | |
sh 'npm test' | |
} | |
} | |
stage('push-image') { | |
docker.withRegistry('http://localhost:5000') { | |
def img = docker.build("artyou/company") | |
img.push(commit) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment