-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (45 loc) · 1.59 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
56
ifneq ("$(wildcard ./.env)","")
include .env
endif
help: ## Shows this help message.
@echo 'usage: make [target] ...'
@echo
@echo 'targets:'
@egrep '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ':#'
install:
docker-compose run --rm nodejs npm install
.PHONY: install
watch: up-proxy
docker-compose up -d mongo mongo-express
docker-compose run --rm --service-ports nodejs-watch
.PHONY: watch
up: up-proxy
docker-compose run --rm nodejs npm run build
docker-compose up -d mongo mongo-express nodejs-http
.PHONY: up
down:
docker-compose down
.PHONY: down
up-proxy:
docker-compose up -d proxy rabbitmq
.PHONY: up-proxy
test:
docker-compose run --rm nodejs npm run test
.PHONY: test
build-image:
docker build -f docker/node-http/Dockerfile -t lissenburg/shinkansen-travel-node-http:latest .
.PHONY: build-image
build-dev-image:
docker build -f docker/node-http/Dockerfile --target=dev -t lissenburg/shinkansen-travel-node-http:dev .
.PHONY: build-dev-image
push-image:
docker login -u '$(DOCKER_USER)' -p '${DOCKER_PASSWORD}'
docker push lissenburg/shinkansen-travel-node-http:latest
docker logout
.PHONY: push-image
deploy:
ssh -i ./travis/deploy_key $(SSH_USER)@$(SSH_HOST) 'mkdir -p ~/www/shinkansen-travel/'
scp -r ./deploy/vps/* $(SSH_USER)@$(SSH_HOST):~/www/shinkansen-travel/
ssh -i ./travis/deploy_key $(SSH_USER)@$(SSH_HOST) 'cd ~/www/shinkansen-travel && touch acme.json && chmod 600 acme.json'
ssh -i ./travis/deploy_key $(SSH_USER)@$(SSH_HOST) 'cd ~/www/shinkansen-travel/ && docker-compose pull && docker stack deploy -c <(docker-compose config) shinkasen-travel'
.PHONY: deploy