forked from jenkinsci/kubernetes-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multi-container.groovy
30 lines (26 loc) · 969 Bytes
/
multi-container.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* This pipeline describes a multi container job, running Maven and Golang builds
*/
podTemplate(label: 'maven-golang', containers: [
containerTemplate(name: 'maven', image: 'maven:3.3.9-jdk-8-alpine', ttyEnabled: true, command: 'cat'),
containerTemplate(name: 'golang', image: 'golang:1.8.0', ttyEnabled: true, command: 'cat')
]) {
node('maven-golang') {
stage('Build a Maven project') {
git 'https://github.com/jenkinsci/kubernetes-plugin.git'
container('maven') {
sh 'mvn -B clean package'
}
}
stage('Build a Golang project') {
git url: 'https://github.com/terraform-providers/terraform-provider-aws.git'
container('golang') {
sh """
mkdir -p /go/src/github.com/terraform-providers
ln -s `pwd` /go/src/github.com/terraform-providers/terraform-provider-aws
cd /go/src/github.com/terraform-providers/terraform-provider-aws && make build
"""
}
}
}
}