]> git.r.bdr.sh - rbdr/junction/blob - server/Makefile
153bf67ca51f410fb2ef94abd45259bc1ebb4668
[rbdr/junction] / server / Makefile
1 # Never directly modify the default environment
2 environment = development
3
4 repo_full_name = $(shell git remote -v | grep origin | grep push | grep -o '[^:/]\+\/[^/]\+\s\+' | grep -o '[^:]\+\/[^. ]\+')
5 git_sha = $(shell git rev-parse --short HEAD)
6
7 default: build
8
9 build: docker-build
10
11 run: build
12 docker-compose up
13
14 package: build
15
16 upload: build
17 docker push $(repo_full_name)
18
19 clean: clean-docker-build
20
21 test_ci:
22 docker-compose --project-name ci_build -f test/docker-compose-ci.yml run junction
23
24 docker-build:
25 docker build --force-rm -t $(repo_full_name):$(git_sha) .
26 docker tag $(repo_full_name):$(git_sha) $(repo_full_name):latest
27
28 # Dashes before the commands below indicate a non-zero exit status is okay.
29 clean-docker-build:
30 -docker rm $(repo_full_name):$(git_sha)
31 -docker rmi $(repo_full_name):$(git_sha)