forked from ukparliament/data-driven
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (38 loc) · 1.45 KB
/
Makefile
File metadata and controls
51 lines (38 loc) · 1.45 KB
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
NAME = ukpds/data-driven
# GO_PIPELINE_COUNTER is the pipeline number, passed from our build agent.
GO_PIPELINE_COUNTER?="unknown"
DOCKER_SWARM_URL?="unknown"
# Construct the image tag.
VERSION=0.1.$(GO_PIPELINE_COUNTER)
build :
docker-compose build
run :
docker-compose up -d
runalone:
docker run -p 80:3000 $(NAME)
# Container port 3000 is specified in Dockerfile
# Browse to http://localhost:80 to see the application
run-docker-cloud:
docker-cloud stack up
runalone-docker-cloud:
docker-cloud stack up -f docker-cloud.standalone.yml
rebuild :
docker-compose down
docker-compose up -d
test :
docker-compose run web rake spec
docker-compose down
push:
docker build -t $(NAME):$(VERSION) -t $(NAME):latest .
docker push $(NAME):$(VERSION)
docker push $(NAME):latest
docker rmi $(NAME):$(VERSION)
docker rmi $(NAME):latest
deploy-ci:
export DOCKER_HOST=$(DOCKER_SWARM_URL) && export IMAGE_NAME=$(NAME):$(VERSION) && docker-compose -f docker-compose.ci.yml down && docker-compose -f docker-compose.ci.yml up -d
# http://serverfault.com/questions/682340/update-the-container-of-a-service-in-amazon-ecs?rq=1
deploy-ecs-ci:
aws ecs register-task-definition --cli-input-json file://./aws_ecs/data-driven.json
aws ecs update-service --service DataDriven --cluster ecs-ci --region eu-west-1 --task-definition DataDriven
scale-ci:
export DOCKER_HOST=$(DOCKER_SWARM_URL) && export IMAGE_NAME=$(NAME):$(VERSION) && docker-compose -f docker-compose.ci.yml scale web=3