jenkins_podtemplate - choisungwook/portfolio GitHub Wiki
- busybox ์ด๋ฏธ์ง ์ฌ์ฉ
- POD_LABEL is a new feature to automatically label the generated pod in versions 1.17.0 or higher
์ฐธ๊ณ ์๋ฃ: https://github.com/jenkinsci/kubernetes-plugin#pipeline-support
podTemplate {
node(POD_LABEL) {
stage('Run shell') {
sh 'echo hello world'
}
}
}
์ฐธ๊ณ ์๋ฃ: https://github.com/jenkinsci/kubernetes-plugin#container-group-support
podTemplate(containers: [
containerTemplate(name: 'maven', image: 'maven:3.3.9-jdk-8-alpine', ttyEnabled: true, command: 'cat')
]) {
node(POD_LABEL) {
stage('Build project') {
git 'https://gitlab.choilab.xyz/common/springboot-commontemplate.git'
container('maven') {
stage('Build a Maven project') {
sh 'mvn package'
}
}
}
}
}