-
Notifications
You must be signed in to change notification settings - Fork 37
/
Makefile
29 lines (21 loc) · 1.21 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
.PHONY: default
UPSTREAM_VERSION_FILE = UPSTREAM_VERSION.txt
UPSTREAM_VERSION = `cat $(UPSTREAM_VERSION_FILE)`
DEFAULT_BUILD_ARGS = --build-arg http_proxy=$(http_proxy) --build-arg https_proxy=$(https_proxy) --build-arg no_proxy=$(no_proxy)
default: build-alpine
build-all: build-alpine build-debian build-jdk11 build-jdk17
build-alpine:
docker build --rm --force-rm -t odavid/jenkins-jnlp-slave:alpine $(DEFAULT_BUILD_ARGS) --build-arg=FROM_TAG=$(UPSTREAM_VERSION)-alpine .
docker tag odavid/jenkins-jnlp-slave:alpine odavid/jenkins-jnlp-slave:latest
build-debian:
docker build --rm --force-rm -t odavid/jenkins-jnlp-slave:debian $(DEFAULT_BUILD_ARGS) --build-arg=FROM_TAG=$(UPSTREAM_VERSION) .
build-jdk11:
docker build --rm --force-rm -t odavid/jenkins-jnlp-slave:jdk11 $(DEFAULT_BUILD_ARGS) --build-arg=FROM_TAG=$(UPSTREAM_VERSION)-jdk11 .
build-jdk17:
docker build --rm --force-rm -t odavid/jenkins-jnlp-slave:jdk17 $(DEFAULT_BUILD_ARGS) --build-arg=FROM_TAG=$(UPSTREAM_VERSION)-jdk17 .
publish: build-all
./publish.sh
release:
$(eval NEW_INCREMENT := $(shell expr `git describe --tags --abbrev=0 | cut -d'-' -f3` + 1))
git tag v$(UPSTREAM_VERSION)-$(NEW_INCREMENT)
git push origin v$(UPSTREAM_VERSION)-$(NEW_INCREMENT)