Skip to content

Instantly share code, notes, and snippets.

@atrakic
Forked from vfarcic/my-k8s-job.groovy
Created December 8, 2018 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atrakic/7064882bb1c62ced08bc5328db39ee00 to your computer and use it in GitHub Desktop.
Save atrakic/7064882bb1c62ced08bc5328db39ee00 to your computer and use it in GitHub Desktop.
podTemplate(
label: 'kubernetes',
containers: [
containerTemplate(name: 'maven', image: 'maven:alpine', ttyEnabled: true, command: 'cat'),
containerTemplate(name: 'golang', image: 'golang:alpine', ttyEnabled: true, command: 'cat')
]
) {
node('kubernetes') {
container('maven') {
stage('build') {
sh 'mvn --version'
}
stage('unit-test') {
sh 'java -version'
}
}
container('golang') {
stage('deploy') {
sh 'go version'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment