-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
55 lines (40 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
SHELL = /usr/bin/env bash
# Customize name and img for your project:
name = tiddlymap
img = testedminds/$(name)
latest = $(img):latest
number = `cat ./next-version.txt`
version = `date +%y.%m.%d`.$(number)
dev: stop build run sleep-2 open
version:
@echo $(version)
sleep-%:
sleep $*
build:
echo "<div class='version'>v$(version)</div>" > ./version.html
docker build -t $(latest) .
# https://devcenter.heroku.com/articles/container-registry-and-runtime#get-the-port-from-the-environment-variable
run:
docker run -d -p 8080:8080 -v `pwd`/wiki:/var/lib/tiddlywiki/wiki -e PORT=8080 --rm --name $(name) $(latest)
# run a container without mounting the local volume so that any changes to the wiki are scoped to the container:
test:
docker run -d -p 8080:8080 -e PORT=8080 --rm --name $(name) $(latest)
exec:
docker exec -it $(name) sh
stop:
-docker stop $(name)
open:
open http://`docker-machine ip dev`:8080
release: push tag update-version
push:
docker tag $(latest) $(img):$(version)
docker push $(latest)
docker push $(img):$(version)
tag:
git tag v$(version)
git push --tags
update-version:
echo $$(($(number) + 1)) > ./next-version.txt
git add ./next-version.txt
git commit -m "Bump version"
git push