forked from dfulgham/widget-web-page
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
34 lines (34 loc) · 1.97 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
machine:
environment:
awscli: $HOME/aws/bin/aws
dependencies:
cache_directories:
- /home/ubuntu/aws
pre:
- if [ -z "$BUCKET_NAME" ]; then echo Bucket name must be specified as an environment variable; exit 1; fi
- if [ -z $(grep version package.json |grep -o '[0-9.]*') ]; then echo Version must be specified in package.json; exit 1; fi
- if [[ ! -d $HOME/aws ]]; then curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" && unzip awscli-bundle.zip && sudo ./awscli-bundle/install -i $HOME/aws; fi
- npm install -g gulp
- npm install -g casperjs
post:
- bower install
- wget http://selenium-release.storage.googleapis.com/2.44/selenium-server-standalone-2.44.0.jar
- nohup bash -c "java -jar selenium-server-standalone-2.44.0.jar &"
test:
override:
- NODE_ENV=dev npm run test
deployment:
staging:
branch: /(feature|fix|chore).*/
commands:
- NODE_ENV=test npm run build
- echo Deploying version $(grep version package.json |grep -o '[0-9.]*') to $BUCKET_NAME-test
- $awscli s3 ls s3://$BUCKET_NAME-test || ($awscli s3 mb s3://$BUCKET_NAME-test && $awscli s3api put-bucket-acl --bucket $BUCKET_NAME-test --grant-read 'uri="http://acs.amazonaws.com/groups/global/AllUsers"')
- $awscli s3 sync ./dist s3://$BUCKET_NAME-test/$(grep version package.json |grep -o '[0-9.]*')/dist --delete --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
production:
branch: master
commands:
- NODE_ENV=prod npm run build
- echo Deploying version $(grep version package.json |grep -o '[0-9.]*') to $BUCKET_NAME
- $awscli s3 ls s3://$BUCKET_NAME || ($awscli s3 mb s3://$BUCKET_NAME && $awscli s3api put-bucket-acl --bucket $BUCKET_NAME --grant-read 'uri="http://acs.amazonaws.com/groups/global/AllUsers"')
- $awscli s3 sync ./dist s3://$BUCKET_NAME/$(grep version package.json |grep -o '[0-9.]*')/dist --delete --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers