-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
22 lines (17 loc) · 754 Bytes
/
Makefile
File metadata and controls
22 lines (17 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
docker_user := "ethorbit"
files := ./servers/*
git_hash := $(shell git rev-parse --short HEAD)
.PHONY: build test push
build:
docker build -t steamcmd-server ./
find $(files) -maxdepth 0 -type d -exec \
/bin/sh -c 'dirname=$$(basename {}) &&\
docker build -t $$dirname -t $(docker_user)/$$dirname:latest -t $(docker_user)/$$dirname:$(git_hash) {} &&\
[ 1 = 0 ] && docker volume rm -f $$dirname' \;
test:
docker run -it --rm -p 27015/udp -p 27015/tcp $(options) -v $(image):/home/steam/Steam/steamapps/common --name $(image) $(image) $(command)
push:
find $(files) -maxdepth 1 -type d -exec \
/bin/sh -c 'dirname=$$(basename {}) &&\
docker push $(docker_user)/$$dirname:$(git_hash) &&\
docker push $(docker_user)/$$dirname:latest' \;