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

Commit 29a3698

Browse files
mat007vdemeester
authored andcommitted
Speed up gradle test
The gradle test needs only the linux application, no need to compile for all platforms. Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com> Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent b6f5755 commit 29a3698

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

docker.Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ build_dev_image:
2121
shell: build_dev_image
2222
docker run -ti --rm $(IMAGE_NAME)-dev bash
2323

24+
bin/$(BIN_NAME)-linux: create_bin
25+
docker build --target=$(BIN_NAME) -t $(IMAGE_NAME)-bin $(IMAGE_BUILD_ARGS) .
26+
$(eval containerID=$(shell docker create $(IMAGE_NAME)-bin noop))
27+
docker cp $(containerID):$(PKG_PATH)/bin/$(BIN_NAME) $@
28+
docker rm $(containerID)
29+
@chmod +x $@
30+
2431
cross: create_bin
2532
docker build --target=$* -t $(IMAGE_NAME)-cross $(IMAGE_BUILD_ARGS) .
2633
$(eval containerID=$(shell docker create $(IMAGE_NAME)-cross noop))
@@ -67,7 +74,7 @@ coverage: build_dev_image
6774
docker cp $(containerID):$(PKG_PATH)/_build/cov/ ./_build/ci-cov
6875
docker rm $(containerID)
6976

70-
gradle-test: cross
77+
gradle-test: bin/$(BIN_NAME)-linux
7178
docker build -t $(IMAGE_NAME)-bin -f Dockerfile.gradle .
7279
docker run --rm $(IMAGE_NAME)-bin bash -c "./gradlew --stacktrace build && cd example && gradle renderIt"
7380

0 commit comments

Comments
 (0)