|
1 | 1 | properties([buildDiscarder(logRotator(numToKeepStr: '20'))])
|
2 | 2 |
|
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 | + } |
19 | 73 | }
|
20 | 74 | }
|
21 | 75 | }
|
|
0 commit comments