-
Notifications
You must be signed in to change notification settings - Fork 3
/
circle.yml
47 lines (44 loc) · 1.64 KB
/
circle.yml
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
machine:
python:
version: 2.7.6
node:
version: v6.1.0
services:
- docker
dependencies:
override:
- pip install awscli
- docker info
- npm install codecov --global
- npm install
test:
override:
- npm run test-with-coverage-report
- npm run check-style
- docker build -t objectivetruth/graphvizzer:latest .
post:
- codecov
deployment:
production:
branch: master
commands:
# Push the new docker image to docker hub
- docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker push objectivetruth/graphvizzer:latest
# Get the instance ID that is currently hosting the MiniDoAllServer
- aws ec2 describe-instances --filters Name=ip-address,Values=52.0.80.169 --output text --query 'Reservations[0].Instances[0].InstanceId' > /tmp/instance_id
- cat /tmp/instance_id
# Terminate the instance
- aws ec2 terminate-instances --instance-ids $(cat /tmp/instance_id)
stage:
branch: stage
commands:
# Push the new docker image to docker hub
- docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker tag objectivetruth/graphvizzer:latest objectivetruth/graphvizzer:stage
- docker push objectivetruth/graphvizzer:stage
# Get the instance ID that is currently hosting the MiniDoAllServer
- aws ec2 describe-instances --filters Name=ip-address,Values=34.192.210.3 --output text --query 'Reservations[0].Instances[0].InstanceId' > /tmp/instance_id
- cat /tmp/instance_id
# Terminate the instance
- aws ec2 terminate-instances --instance-ids $(cat /tmp/instance_id)