48 lines
1.3 KiB
Groovy
48 lines
1.3 KiB
Groovy
#!/usr/bin/env groovy
|
|
|
|
def label = "build-jenkins-operator-${UUID.randomUUID().toString()}"
|
|
def home = "/home/jenkins"
|
|
def workspace = "${home}/workspace/build-jenkins-operator"
|
|
def workdir = "${workspace}/src/github.com/jenkinsci/kubernetes-operator/"
|
|
|
|
podTemplate(label: label,
|
|
containers: [
|
|
containerTemplate(name: 'jnlp', image: 'jenkins/inbound-agent:alpine'),
|
|
containerTemplate(name: 'go', image: 'golang:1-alpine', command: 'cat', ttyEnabled: true),
|
|
],
|
|
envVars: [
|
|
envVar(key: 'GOPATH', value: workspace),
|
|
],
|
|
) {
|
|
|
|
node(label) {
|
|
dir(workdir) {
|
|
stage('Init') {
|
|
timeout(time: 3, unit: 'MINUTES') {
|
|
checkout scm
|
|
}
|
|
container('go') {
|
|
sh 'apk --no-cache --update add make git gcc libc-dev'
|
|
}
|
|
}
|
|
|
|
stage('Dep') {
|
|
container('go') {
|
|
sh 'make dep'
|
|
}
|
|
}
|
|
|
|
stage('Test') {
|
|
container('go') {
|
|
sh 'make test'
|
|
}
|
|
}
|
|
|
|
stage('Build') {
|
|
container('go') {
|
|
sh 'make build'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |