This repository was archived by the owner on Jul 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +71
-30
lines changed Expand file tree Collapse file tree 6 files changed +71
-30
lines changed Original file line number Diff line number Diff line change 1
- .git
2
1
* .dockerapp
3
2
* .tar.gz
4
3
_build /
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ RUN curl -Ls https://download.docker.com/linux/static/$DOCKERCLI_CHANNEL/x86_64/
18
18
WORKDIR /go/src/github.com/docker/app/
19
19
20
20
FROM build AS dev
21
+ ARG DEP_VERSION=v0.4.1
22
+ RUN curl -o /usr/bin/dep -L https://github.com/golang/dep/releases/download/${DEP_VERSION}/dep-linux-amd64 && \
23
+ chmod +x /usr/bin/dep
21
24
COPY . .
22
25
23
26
FROM dev AS docker-app
Original file line number Diff line number Diff line change @@ -11,37 +11,51 @@ pipeline {
11
11
12
12
stages {
13
13
stage(' Build' ) {
14
- agent {
15
- label ' linux '
16
- }
17
- steps {
18
- dir( ' src/github.com/docker/app ' ) {
19
- script {
20
- try {
14
+ parallel {
15
+ stage( " Validate " ) {
16
+ agent {
17
+ label ' linux '
18
+ }
19
+ steps {
20
+ dir( ' src/github.com/docker/app ' ) {
21
21
checkout scm
22
- sh ' docker image prune -f'
23
22
sh ' make -f docker.Makefile lint'
24
- sh ' make -f docker.Makefile cross e2e-cross tars'
25
- dir(' bin' ) {
26
- stash name : ' binaries'
27
- }
28
- dir(' e2e' ) {
29
- stash name : ' e2e'
30
- }
31
- if (! (env. BRANCH_NAME ==~ " PR-\\ d+" )) {
32
- stash name : ' artifacts' , includes : ' bin/*.tar.gz' , excludes : ' bin/*-e2e-*'
33
- archiveArtifacts ' bin/*.tar.gz'
34
- }
35
- } finally {
36
- def clean_images = / docker image ls --format "{{.ID}}\t {{.Tag}}" | grep $(git describe --always --dirty) | awk '{print $1}' | xargs docker image rm -f/
37
- sh clean_images
23
+ sh ' make -f docker.Makefile vendor'
38
24
}
39
25
}
40
26
}
41
- }
42
- post {
43
- always {
44
- deleteDir()
27
+ stage(" Binaries" ){
28
+ agent {
29
+ label ' linux'
30
+ }
31
+ steps {
32
+ dir(' src/github.com/docker/app' ) {
33
+ script {
34
+ try {
35
+ checkout scm
36
+ sh ' make -f docker.Makefile cross e2e-cross tars'
37
+ dir(' bin' ) {
38
+ stash name : ' binaries'
39
+ }
40
+ dir(' e2e' ) {
41
+ stash name : ' e2e'
42
+ }
43
+ if (! (env. BRANCH_NAME ==~ " PR-\\ d+" )) {
44
+ stash name : ' artifacts' , includes : ' bin/*.tar.gz' , excludes : ' bin/*-e2e-*'
45
+ archiveArtifacts ' bin/*.tar.gz'
46
+ }
47
+ } finally {
48
+ def clean_images = / docker image ls --format "{{.ID}}\t {{.Tag}}" | grep $(git describe --always --dirty) | awk '{print $1}' | xargs docker image rm -f/
49
+ sh clean_images
50
+ }
51
+ }
52
+ }
53
+ }
54
+ post {
55
+ always {
56
+ deleteDir()
57
+ }
58
+ }
45
59
}
46
60
}
47
61
}
Original file line number Diff line number Diff line change 68
68
$(call rm,_build)
69
69
$(call rm,docker-app-* .tar.gz)
70
70
71
- .PHONY : cross e2e-cross test check lint test-unit test-e2e coverage coverage-bin coverage-test-unit coverage-test-e2e clean
71
+ vendor :
72
+ $(call rm,vendor)
73
+ dep ensure -v
74
+
75
+ .PHONY : cross e2e-cross test check lint test-unit test-e2e coverage coverage-bin coverage-test-unit coverage-test-e2e clean vendor
72
76
.DEFAULT : all
Original file line number Diff line number Diff line change @@ -89,8 +89,12 @@ gradle-test: bin/$(BIN_NAME)-linux
89
89
docker run --rm $(GRADLE_IMAGE_NAME ) bash -c " ./gradlew --stacktrace build && cd example && gradle renderIt"
90
90
91
91
lint :
92
- @echo " Linting..."
92
+ $( info Linting...)
93
93
docker build -t $(LINT_IMAGE_NAME ) $(IMAGE_BUILD_ARGS ) -f Dockerfile.lint .
94
94
docker run --rm $(LINT_IMAGE_NAME ) make lint
95
95
96
- .PHONY : lint test-e2e test-unit test cross e2e-cross coverage gradle-test shell build_dev_image tars
96
+ vendor : build_dev_image
97
+ $(info Vendoring...)
98
+ docker run --rm $(DEV_IMAGE_NAME ) sh -c " make BUILDTIME=${BUILDTIME} vendor && hack/check-git-diff vendor"
99
+
100
+ .PHONY : lint test-e2e test-unit test cross e2e-cross coverage gradle-test shell build_dev_image tars vendor
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -eu
4
+
5
+ DIFF_PATH=$1
6
+ DIFF=$( git status --porcelain -- " $DIFF_PATH " )
7
+
8
+ if [ " $DIFF " ]; then
9
+ echo
10
+ echo " These files were changed:"
11
+ echo
12
+ echo " $DIFF "
13
+ echo
14
+ exit 1
15
+ else
16
+ echo " $DIFF_PATH is correct"
17
+ fi ;
You can’t perform that action at this time.
0 commit comments