-
Notifications
You must be signed in to change notification settings - Fork 102
/
Jenkinsfile
65 lines (63 loc) · 2.06 KB
/
Jenkinsfile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
def label = UUID.randomUUID().toString()
podTemplate(label: label, containers: [
containerTemplate(name: 'go', image: 'soloio/squash-build-container', ttyEnabled: true, command: 'cat',
resourceRequestCpu: '100m',
resourceLimitMemory: '1200Mi'),
containerTemplate(name: 'docker', image: 'docker:17.11', ttyEnabled: true, command: 'cat')
], envVars: [
envVar(key: 'BRANCH_NAME', value: env.BRANCH_NAME),
envVar(key: 'DOCKER_CONFIG', value: '/etc/docker'),
],
volumes: [hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock'),
secretVolume(secretName: 'soloio-docker-hub', mountPath: '/etc/docker'),],
) {
node(label) {
stage('Checkout') {
checkout scm
// git 'https://github.com/solo-io/squash'
}
stage('Setup go path') {
container('go') {
sh 'mkdir -p /go/src/github.com/solo-io/'
sh 'ln -s $PWD /go/src/github.com/solo-io/squash'
}
}
// TODO: add the go dep's cache as a persistent volume to save time.
stage('Vendor dependencies') {
container('go') {
sh 'cd /go/src/github.com/solo-io/squash/;dep ensure'
}
}
stage('Build squash binaries') {
container('go') {
sh 'cd /go/src/github.com/solo-io/squash/;make release-binaries'
}
}
stage('Build squash containers') {
container('docker') {
sh 'apk add --update git make'
sh 'make containers'
}
}
stage('Build squash manifests') {
container('go') {
sh 'make deployment'
}
}
stage('Push to container registery') {
container('docker') {
sh 'make dist'
}
}
/*
stage('Run e2e test') {
container('go') {
// setup a (mini)kube cluster?!
}
}
*/
stage('Archive artifacts') {
archiveArtifacts 'target/kubernetes/*.yml,target/squash-linux,target/squash-osx,target/squash-windows'
}
}
}