Skip to content

Commit 10ac439

Browse files
authored
Merge pull request #2 from Rookout/deploy-only-on-master
deploy only on master
2 parents 2d7169b + 74484eb commit 10ac439

File tree

2 files changed

+65
-3
lines changed

2 files changed

+65
-3
lines changed

.circleci/config.yml

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
working_directory: ~/repo
77
steps:
88
- checkout
9-
9+
# Download and cache dependencies
1010
- run:
1111
name: Install Serverless CLI and dependencies
1212
command: |
@@ -16,10 +16,71 @@ jobs:
1616
sudo python get-pip.py
1717
sudo pip install -r requirements.txt -t .
1818
19+
deploy-staging:
20+
docker:
21+
- image: circleci/node:8.10
22+
working_directory: ~/repo
23+
steps:
24+
- checkout
25+
# Download and cache dependencies
26+
- run:
27+
name: Install Serverless CLI and dependencies
28+
command: |
29+
sudo npm i -g serverless
30+
sudo apt-get install python-dev -qy
31+
sudo curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
32+
sudo python get-pip.py
33+
sudo pip install -r requirements.txt -t .
1934
- run:
2035
name: Deploy application to staging
2136
command: sls deploy --stage staging --token ${STAGING_DEMO_ROOKOUT_TOKEN} --agenthost staging.cloud.agent.rookout.com
2237

38+
deploy-production:
39+
docker:
40+
- image: circleci/node:8.10
41+
working_directory: ~/repo
42+
steps:
43+
- checkout
44+
# Download and cache dependencies
45+
- run:
46+
name: Install Serverless CLI and dependencies
47+
command: |
48+
sudo npm i -g serverless
49+
sudo apt-get install python-dev -qy
50+
sudo curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
51+
sudo python get-pip.py
52+
sudo pip install -r requirements.txt -t .
53+
2354
- run:
2455
name: Deploy application to production
25-
command: sls deploy --stage production --token ${DEMO_ROOKOUT_TOKEN} --agenthost cloud.agent.rookout.com
56+
command: sls deploy --stage production --token ${DEMO_ROOKOUT_TOKEN} --agenthost cloud.agent.rookout.com
57+
58+
59+
60+
workflows:
61+
version: 2
62+
build-and-deploy:
63+
jobs:
64+
- build
65+
- deploy-staging:
66+
requires:
67+
- build
68+
filters:
69+
branches:
70+
only: master
71+
- hold-for-approval:
72+
type: approval
73+
requires:
74+
- build
75+
- deploy-staging
76+
filters:
77+
branches:
78+
only: master
79+
- deploy-production:
80+
requires:
81+
- build
82+
- deploy-staging
83+
- hold-for-approval
84+
filters:
85+
branches:
86+
only: master

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.serverless
2-
*.pyc
2+
*.pyc
3+
.history

0 commit comments

Comments
 (0)