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

Commit 87ce4e5

Browse files
authored
Merge pull request #138 from mnottale/gradle-plugin-test
CI: Test gradle plugin.
2 parents c9c0c02 + d5eb250 commit 87ce4e5

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Jenkinsfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pipeline {
2626
sh 'make ci-bin-all'
2727
sh 'mkdir stash'
2828
sh 'ls *.tar.gz | xargs -i tar -xf {} -C stash'
29+
sh 'make ci-gradle-test DOCKERAPP_BINARY=$PWD/stash/docker-app-linux'
2930
dir('stash') {
3031
stash name: 'e2e'
3132
}

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ RENDERERS := "none"
1010

1111
TAG ?= $(shell git describe --always --dirty)
1212
COMMIT ?= $(shell git rev-parse --short HEAD)
13+
CWD = $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
14+
15+
# Used by ci-gradle-test target
16+
DOCKERAPP_BINARY ?= $(CWD)/_build/$(BIN_NAME)-linux
1317

1418
IMAGE_NAME := docker-app
1519

@@ -67,7 +71,7 @@ test check: lint unit-test e2e-test
6771
lint:
6872
@echo "Linting..."
6973
@tar -c Dockerfile.lint gometalinter.json | docker build -t $(IMAGE_NAME)-lint $(IMAGE_BUILD_ARGS) -f Dockerfile.lint - --target=lint-volume > /dev/null
70-
@docker run --rm -v $(dir $(realpath $(lastword $(MAKEFILE_LIST)))):$(PKG_PATH):ro,cached $(IMAGE_NAME)-lint
74+
@docker run --rm -v $(CWD):$(PKG_PATH):ro,cached $(IMAGE_NAME)-lint
7175

7276
e2e-test: bin
7377
@echo "Running e2e tests..."
@@ -98,5 +102,10 @@ ci-bin-all:
98102
$(foreach OS, $(OS_LIST), docker run --rm $(IMAGE_NAME)-bin-all:$(TAG) tar -cz -C $(PKG_PATH)/_build $(BIN_NAME)-$(OS)$(if $(filter windows, $(OS)),.exe,) > $(BIN_NAME)-$(OS)-$(TAG).tar.gz || exit 1;)
99103
$(foreach OS, $(OS_LIST), docker run --rm $(IMAGE_NAME)-bin-all:$(TAG) /bin/sh -c "cp $(PKG_PATH)/_build/*-$(OS)* $(PKG_PATH)/e2e && cd $(PKG_PATH)/e2e && tar -cz * --exclude=*.go" > $(E2E_NAME)-$(OS)-$(TAG).tar.gz || exit 1;)
100104

101-
.PHONY: bin bin-all test check lint e2e-test e2e-all unit-test clean ci-lint ci-test ci-bin-all ci-e2e-all
105+
ci-gradle-test:
106+
docker run --user $(shell id -u) --rm -v $(CWD)/gradle:/gradle -v $(DOCKERAPP_BINARY):/usr/local/bin/docker-app \
107+
-e GRADLE_USER_HOME=/tmp/gradle \
108+
gradle:jdk8 bash -c "cd /gradle && gradle --stacktrace build && cd example && gradle renderIt"
109+
110+
.PHONY: bin bin-all test check lint e2e-test e2e-all unit-test clean ci-lint ci-test ci-bin-all ci-e2e-all ci-gradle-test
102111
.DEFAULT: all

0 commit comments

Comments
 (0)