-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
35 lines (27 loc) · 928 Bytes
/
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
30
31
32
33
34
MAKE=make -s
UPGRADE_SCRIPT=upgrade.sh
DOCKER_CLI=$(shell which docker.io || which docker)
DOCKER_IMAGE=phaldan/jts3servermod
DOCKER_CONTAINER=jts3servermod
VERSION?=6.5.7
.PHONY : all build update run clear logs release
all: build
build:
$(DOCKER_CLI) build \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-t $(DOCKER_IMAGE):$(VERSION) .
run:
$(DOCKER_CLI) run -d --name $(DOCKER_CONTAINER) \
-v ${PWD}/config:/JTS3ServerMod/config \
-v ${PWD}/log:/JTS3ServerMod/log \
$(DOCKER_IMAGE):$(VERSION)
clear:
$(DOCKER_CLI) stop $(DOCKER_CONTAINER)
$(DOCKER_CLI) rm $(DOCKER_CONTAINER)
logs:
$(DOCKER_CLI) logs $(DOCKER_CONTAINER)
release: build
curl -o $(UPGRADE_SCRIPT) https://raw.githubusercontent.com/phaldan/docker-tags-upgrade/master/$(UPGRADE_SCRIPT)
chmod +x $(UPGRADE_SCRIPT)
./$(UPGRADE_SCRIPT) "$(DOCKER_IMAGE)" "$(VERSION)"