-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.yml
More file actions
52 lines (51 loc) · 1.82 KB
/
Copy pathconfig.yml
File metadata and controls
52 lines (51 loc) · 1.82 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
52
version: 2
jobs:
build_and_deploy:
docker:
- image: cimg/node:15.10.0
steps:
- checkout
# Install AWS CLI
# - include aws cli ci docker:
# https://github.com/circleci/circleci-images/issues/53
# - use global install for aws and pip instead of --user:
# https://discuss.circleci.com/t/how-to-add-a-path-to-path-in-circle-2-0/11554
- run: sudo apt-get update && sudo apt-get install -qq -y python3-pip jq
- run: curl -O https://bootstrap.pypa.io/get-pip.py && sudo python3 get-pip.py
- run: sudo pip3 install -q awscli --upgrade
- run:
name: Install/Compile saas
command: |
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
source ~/.profile
npm install -g node-sass
node-sass scss/ -o css/
rm -rf scss/
rm -rf .git
rm -rf .circleci
- run:
name: Return APIGateway URL from CFN and write to file. Replace API Gateway URL in main.js
command: |
apigatewayurl=`aws cloudformation describe-stacks --region $AWS_REGION | jq -e '.Stacks[].Outputs[]? | select(.OutputValue | contains("execute-api")) | .OutputValue'`
sed -i 's,const amiLookupAPI = .*,const amiLookupAPI = '"$apigatewayurl"',g' js/main.js
- run:
name: Sync website to S3 Bucket
command: aws s3 sync . s3://$S3_BUCKET --delete --acl public-read
workflows:
version: 2
deploy-develop:
jobs:
- build_and_deploy:
filters:
branches:
only: develop
context: develop
deploy-production:
jobs:
- build_and_deploy:
filters:
branches:
only: master
context: production