-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
33 lines (25 loc) · 973 Bytes
/
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
REPO= # operatorequals/
IMAGE=git-course
VERSION=0.1.0
# 'ssh' and 'http'
TYPE=http
challenges:
for repo in challenge*; do mkdir -p repos/$${repo}.git/hooks; cp generic/* repos/$${repo}.git/hooks/ && cp $${repo}/* repos/$${repo}.git/hooks/; done
image: challenges
docker build -t $(REPO)$(IMAGE)-$(TYPE):$(VERSION) . -f deploy/$(TYPE).Dockerfile
docker tag $(REPO)$(IMAGE)-$(TYPE):$(VERSION) $(REPO)$(IMAGE)-$(TYPE):latest
run: image
docker run -ti --rm -p 8000:8000 $(REPO)$(IMAGE)-$(TYPE):latest
push: image
docker push $(REPO)$(IMAGE)-$(TYPE):$(VERSION)
heroku-push: challenges
cd deploy/ && \
cp $(TYPE).Dockerfile Dockerfile && \
heroku container:push web -a git-interactive-course -v --context-path ../ && \
rm Dockerfile && \
cd ../
heroku-release: heroku-push
heroku container:release -a git-interactive-course web
clean:
for repo in repos/challenge*.git; do rm -rf $${repo}/hooks/*; done
docker image rm $(REPO)$(IMAGE)-$(TYPE):$(VERSION)