-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcircle.yml
37 lines (33 loc) · 1.18 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
machine:
node:
version: 6.3.1
environment:
S3_BUCKET: redsift-static
NAME: t3-rs-geo
checkout:
pre:
- npm install -g npm
post:
- git fetch --tags
dependencies:
override:
- npm install
- mv ./distribution ${CIRCLE_ARTIFACTS}/distribution
- cp ./tiles/*.json ${CIRCLE_ARTIFACTS}/distribution
test:
override:
- npm test
deployment:
production:
branch: /release-.*/
commands:
- sudo pip install awscli
- echo "Publishing to NPM"
- echo -e "$NPM_USERNAME\n$NPM_PASSWORD\n$NPM_EMAIL" | npm login
- npm publish --access=public
- echo "Uploading to S3 bucket..."
- aws s3 cp ${CIRCLE_ARTIFACTS}/distribution s3://$S3_BUCKET/three/$NAME/latest --recursive --acl public-read --cache-control max-age=7200,public
- |
VERSION=$(cat package.json | python -c 'import sys, json; print json.load(sys.stdin)["version"]')-$(git describe --exact-match --tags 2>/dev/null || git rev-parse --short HEAD)
aws s3 cp ${CIRCLE_ARTIFACTS}/distribution s3://$S3_BUCKET/three/$NAME/$VERSION --recursive --acl public-read --cache-control max-age=31556926,public
- echo "S3 upload complete."