Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 57c4959

Browse files
committed
Rewrite jenkins pipeline
The linux agent now builds for all platforms and stashes the binaries for each agent to test for its own platform. For now the platform tests only consist of exercising the executable but this should in the short term be replaced with end-to-end tests. Signed-off-by: Mathieu Champlon <[email protected]>
1 parent 20917e0 commit 57c4959

File tree

1 file changed

+70
-16
lines changed

1 file changed

+70
-16
lines changed

Jenkinsfile

Lines changed: 70 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,75 @@
11
properties([buildDiscarder(logRotator(numToKeepStr: '20'))])
22

3-
node('gcp-linux-worker-0') {
4-
stage('Build') {
5-
dir('src/github.com/docker/lunchbox') {
6-
try {
7-
checkout scm
8-
sh 'rm -f *.tar.gz'
9-
sh 'docker image prune -f'
10-
sh 'make ci-lint'
11-
sh 'make ci-test'
12-
sh 'make ci-bin-linux'
13-
sh 'make ci-bin-darwin'
14-
sh 'make ci-bin-windows'
15-
archiveArtifacts '*.tar.gz'
16-
} finally {
17-
def clean_images = /docker image ls --format "{{.ID}}\t{{.Tag}}" | grep $(git describe --always --dirty) | awk '{print $1}' | xargs docker image rm/
18-
sh clean_images
3+
pipeline {
4+
agent {
5+
label 'gcp-linux-worker-0'
6+
}
7+
8+
options {
9+
checkoutToSubdirectory('src/github.com/docker/lunchbox')
10+
}
11+
12+
stages {
13+
stage('Build') {
14+
agent {
15+
label 'gcp-linux-worker-0'
16+
}
17+
steps {
18+
dir('src/github.com/docker/lunchbox') {
19+
script {
20+
try {
21+
checkout scm
22+
sh 'rm -f *.tar.gz'
23+
sh 'docker image prune -f'
24+
sh 'make ci-lint'
25+
sh 'make ci-test'
26+
sh 'make ci-bin-all'
27+
sh 'ls *.tar.gz | xargs -i tar xf {}'
28+
stash name: "binaries", includes: "docker-app-*", excludes: "*.tar.gz"
29+
archiveArtifacts '*.tar.gz'
30+
} finally {
31+
def clean_images = /docker image ls --format "{{.ID}}\t{{.Tag}}" | grep $(git describe --always --dirty) | awk '{print $1}' | xargs docker image rm/
32+
sh clean_images
33+
}
34+
}
35+
}
36+
}
37+
}
38+
stage('Test') {
39+
parallel {
40+
stage("Test Linux") {
41+
agent {
42+
label 'gcp-linux-worker-0'
43+
}
44+
steps {
45+
dir('src/github.com/docker/lunchbox') {
46+
unstash "binaries"
47+
sh './docker-app-linux version'
48+
}
49+
}
50+
}
51+
stage("Test Mac") {
52+
agent {
53+
label "macstadium13"
54+
}
55+
steps {
56+
dir('src/github.com/docker/lunchbox') {
57+
unstash "binaries"
58+
sh './docker-app-darwin version'
59+
}
60+
}
61+
}
62+
stage("Test Win") {
63+
agent {
64+
label "gcp-windows-worker-2"
65+
}
66+
steps {
67+
dir('src/github.com/docker/lunchbox') {
68+
unstash "binaries"
69+
bat 'docker-app-windows.exe version'
70+
}
71+
}
72+
}
1973
}
2074
}
2175
}

0 commit comments

Comments
 (0)