aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRubén Beltrán del Río <ben@nsovocal.com>2017-02-18 17:55:13 -0600
committerGitHub <noreply@github.com>2017-02-18 17:55:13 -0600
commit5e981bca19ace2a7704f267175b6aa368e63bda0 (patch)
treed38e6cbd1762837d3fae81b5029a9c0b48fa08b4 /Makefile
parentdc10b1de1a73effd6d0ab5744709913ef5cbe5b3 (diff)
Initial Setup (#1)
* Add git ignore * Add eslint config * Add dummy project files * Add jsdoc config * Add docker files * Add changelog, contributing and readme * Add travis files * Add Paw helper * Add travis test docker compose file * Name the ci service appropriately
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..c13645c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,34 @@
+
+# Never directly modify the default environment
+environment = development
+
+repo_full_name = $(shell git remote -v | grep origin | grep push | grep -o '[^:/]\+\/[^/]\+\s\+' | grep -o '[^:]\+\/[^. ]\+')
+git_sha = $(shell git rev-parse --short HEAD)
+git_branch = $(shell git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3)
+whoami = $(shell whoami)
+
+default: build
+
+build: docker-build
+
+run: build
+ docker-compose up
+
+package: build
+
+upload: build
+ docker push $(repo_full_name)
+
+clean: clean-docker-build
+
+test_ci:
+ docker-compose --project-name ci_build -f test/docker-compose-ci.yml run dead-drop
+
+docker-build:
+ docker build --force-rm -t $(repo_full_name):$(git_sha) .
+ docker tag $(repo_full_name):$(git_sha) $(repo_full_name):latest
+
+# Dashes before the commands below indicate a non-zero exit status is okay.
+clean-docker-build:
+ -docker rm $(repo_full_name):$(git_sha)
+ -docker rmi $(repo_full_name):$(git_sha)