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

Commit 19274a2

Browse files
author
Ian Campbell
committed
ci: Use ansiColor plugin to avoid escape codes in logs
Also renders more prettily. Signed-off-by: Ian Campbell <ijc@docker.com>
1 parent 60d6d5a commit 19274a2

2 files changed

Lines changed: 41 additions & 17 deletions

File tree

Jenkinsfile

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ pipeline {
1919
steps {
2020
dir('src/github.com/docker/app') {
2121
checkout scm
22-
sh 'make -f docker.Makefile lint'
23-
sh 'make -f docker.Makefile check-vendor'
22+
ansiColor('xterm') {
23+
sh 'make -f docker.Makefile lint'
24+
sh 'make -f docker.Makefile check-vendor'
25+
}
2426
}
2527
}
2628
post {
@@ -38,7 +40,9 @@ pipeline {
3840
script {
3941
try {
4042
checkout scm
41-
sh 'make -f docker.Makefile cli-cross cross e2e-cross tars'
43+
ansiColor('xterm') {
44+
sh 'make -f docker.Makefile cli-cross cross e2e-cross tars'
45+
}
4246
dir('bin') {
4347
stash name: 'binaries'
4448
}
@@ -72,9 +76,11 @@ pipeline {
7276
steps {
7377
dir('src/github.com/docker/app') {
7478
checkout scm
75-
sh 'make -f docker.Makefile save-invocation-image'
76-
sh 'make -f docker.Makefile INVOCATION_IMAGE_TAG=$BUILD_TAG-coverage OUTPUT=coverage-invocation-image.tar save-invocation-image-tag'
77-
sh 'make -f docker.Makefile INVOCATION_IMAGE_TAG=$BUILD_TAG-coverage-experimental OUTPUT=coverage-experimental-invocation-image.tar save-invocation-image-tag'
79+
ansiColor('xterm') {
80+
sh 'make -f docker.Makefile save-invocation-image'
81+
sh 'make -f docker.Makefile INVOCATION_IMAGE_TAG=$BUILD_TAG-coverage OUTPUT=coverage-invocation-image.tar save-invocation-image-tag'
82+
sh 'make -f docker.Makefile INVOCATION_IMAGE_TAG=$BUILD_TAG-coverage-experimental OUTPUT=coverage-experimental-invocation-image.tar save-invocation-image-tag'
83+
}
7884
dir('_build') {
7985
stash name: 'invocation-image', includes: 'invocation-image.tar'
8086
stash name: 'coverage-invocation-image', includes: 'coverage-invocation-image.tar'
@@ -108,7 +114,9 @@ pipeline {
108114
unstash "coverage-invocation-image"
109115
sh 'docker load -i coverage-invocation-image.tar'
110116
}
111-
sh 'make -f docker.Makefile BUILD_TAG=$BUILD_TAG-coverage coverage'
117+
ansiColor('xterm') {
118+
sh 'make -f docker.Makefile BUILD_TAG=$BUILD_TAG-coverage coverage'
119+
}
112120
archiveArtifacts '_build/ci-cov/all.out'
113121
archiveArtifacts '_build/ci-cov/coverage.html'
114122
}
@@ -134,7 +142,9 @@ pipeline {
134142
unstash "coverage-experimental-invocation-image"
135143
sh 'docker load -i coverage-experimental-invocation-image.tar'
136144
}
137-
sh 'make EXPERIMENTAL=on -f docker.Makefile BUILD_TAG=$BUILD_TAG-coverage-experimental coverage'
145+
ansiColor('xterm') {
146+
sh 'make EXPERIMENTAL=on -f docker.Makefile BUILD_TAG=$BUILD_TAG-coverage-experimental coverage'
147+
}
138148
}
139149
}
140150
post {
@@ -154,7 +164,9 @@ pipeline {
154164
dir("bin") {
155165
unstash "binaries"
156166
}
157-
sh 'make -f docker.Makefile gradle-test'
167+
ansiColor('xterm') {
168+
sh 'make -f docker.Makefile gradle-test'
169+
}
158170
}
159171
}
160172
post {
@@ -185,7 +197,9 @@ pipeline {
185197
dir('e2e'){
186198
unstash "e2e"
187199
}
188-
sh './gotestsum-linux --format short-verbose --junitfile e2e-linux.xml --raw-command -- ./test2json-linux -t -p docker-app/e2e-linux ./docker-app-e2e-linux -test.v --e2e-path=e2e'
200+
ansiColor('xterm') {
201+
sh './gotestsum-linux --format short-verbose --junitfile e2e-linux.xml --raw-command -- ./test2json-linux -t -p docker-app/e2e-linux ./docker-app-e2e-linux -test.v --e2e-path=e2e'
202+
}
189203
}
190204
}
191205
post {

Jenkinsfile.baguette

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ pipeline {
2121
script {
2222
try {
2323
checkout scm
24-
sh 'make -f docker.Makefile lint'
25-
sh 'make -f docker.Makefile cli-cross cross e2e-cross tars'
24+
ansiColor('xterm') {
25+
sh 'make -f docker.Makefile lint'
26+
sh 'make -f docker.Makefile cli-cross cross e2e-cross tars'
27+
}
2628
dir('bin') {
2729
stash name: 'binaries'
2830
}
@@ -56,8 +58,10 @@ pipeline {
5658
steps {
5759
dir('src/github.com/docker/app') {
5860
checkout scm
59-
sh 'make -f docker.Makefile save-invocation-image'
60-
sh 'make -f docker.Makefile save-invocation-image-tag INVOCATION_IMAGE_TAG=$BUILD_TAG-coverage OUTPUT=coverage-invocation-image.tar'
61+
ansiColor('xterm') {
62+
sh 'make -f docker.Makefile save-invocation-image'
63+
sh 'make -f docker.Makefile save-invocation-image-tag INVOCATION_IMAGE_TAG=$BUILD_TAG-coverage OUTPUT=coverage-invocation-image.tar'
64+
}
6165
dir('_build') {
6266
stash name: 'invocation-image', includes: 'invocation-image.tar'
6367
stash name: 'coverage-invocation-image', includes: 'coverage-invocation-image.tar'
@@ -93,7 +97,9 @@ pipeline {
9397
unstash "coverage-invocation-image"
9498
sh 'docker load -i coverage-invocation-image.tar'
9599
}
96-
sh 'make -f docker.Makefile BUILD_TAG=$BUILD_TAG-coverage coverage'
100+
ansiColor('xterm') {
101+
sh 'make -f docker.Makefile BUILD_TAG=$BUILD_TAG-coverage coverage'
102+
}
97103
archiveArtifacts '_build/ci-cov/all.out'
98104
archiveArtifacts '_build/ci-cov/coverage.html'
99105
sh 'curl -s https://codecov.io/bash | bash -s - -f _build/ci-cov/all.out -K'
@@ -119,7 +125,9 @@ pipeline {
119125
dir("bin") {
120126
unstash "binaries"
121127
}
122-
sh 'make -f docker.Makefile gradle-test'
128+
ansiColor('xterm') {
129+
sh 'make -f docker.Makefile gradle-test'
130+
}
123131
}
124132
}
125133
post {
@@ -254,7 +262,9 @@ pipeline {
254262
unstash "invocation-image"
255263
sh 'docker load -i invocation-image.tar'
256264
}
257-
sh 'make -f docker.Makefile push-invocation-image'
265+
ansiColor('xterm') {
266+
sh 'make -f docker.Makefile push-invocation-image'
267+
}
258268
}
259269
unstash 'artifacts'
260270
echo "Releasing $TAG_NAME"

0 commit comments

Comments
 (0)