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