Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 87a7073

Browse files
committed
Switch to CircleCI
1 parent 5fb6e91 commit 87a7073

File tree

4 files changed

+6355
-66
lines changed

4 files changed

+6355
-66
lines changed

Diff for: .travis.yml

-66
This file was deleted.

Diff for: circle.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
machine:
2+
node:
3+
version: 5.12.0
4+
environment:
5+
CXX: g++-4.8
6+
7+
dependencies:
8+
pre:
9+
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
10+
- sudo apt-get update -y
11+
- sudo apt-get install g++-4.8 -y
12+
override:
13+
- node --version
14+
- npm --version
15+
- nvm --version
16+
- npm install
17+
18+
compile:
19+
override:
20+
- ls node_modules/*
21+
- npm run lint && npm run build
22+
23+
test:
24+
override:
25+
- npm test
26+
27+
deployment:
28+
development:
29+
branch: dev
30+
owner: appirio-tech
31+
commands:
32+
- ./deploy.sh DEV
33+
qa:
34+
branch: qa-integration
35+
owner: appirio-tech
36+
commands:
37+
- ./deploy.sh QA
38+
production:
39+
branch: master
40+
owner: appirio-tech
41+
commands:
42+
- ./deploy.sh PROD
43+

Diff for: deploy.sh

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
3+
ENV=$1
4+
echo $ENV
5+
AWS_ACCESS_KEY_ID=$(eval "echo \$${ENV}_AWS_ACCESS_KEY_ID")
6+
AWS_SECRET_ACCESS_KEY=$(eval "echo \$${ENV}_AWS_SECRET_ACCESS_KEY")
7+
AWS_S3_BUCKET=$(eval "echo \$${ENV}_S3_BUCKET")
8+
9+
configure_aws_cli() {
10+
aws --version
11+
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
12+
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
13+
aws configure set default.output json
14+
echo "Configured AWS CLI."
15+
}
16+
17+
deploy_s3bucket() {
18+
cat dist/app.2e9868372e0e2992d5d2.css
19+
aws s3 sync --dryrun ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*.txt" --exclude "*.js" --exclude "*.css"
20+
result=`aws s3 sync ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*.txt" --exclude "*.js" --exclude "*.css"`
21+
if [ $? -eq 0 ]; then
22+
echo "All html, font, image, map, and media files are Deployed without gzip encoding!"
23+
else
24+
echo "Deployment Failed - $result"
25+
exit 1
26+
fi
27+
aws s3 sync --dryrun ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*" --include "*.txt" --include "*.js" --include "*.css" --content-encoding gzip
28+
result=`aws s3 sync ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*" --include "*.txt" --include "*.js" --include "*.css" --content-encoding gzip`
29+
if [ $? -eq 0 ]; then
30+
echo "All txt, css, and js files are Deployed! with gzip"
31+
else
32+
echo "Deployment Failed - $result"
33+
exit 1
34+
fi
35+
36+
}
37+
38+
echo -e "application/font-woff\t\t\t\twoff2" >> /etc/mime.types
39+
echo -e "application/font-sfnt\t\t\t\tttf" >> /etc/mime.types
40+
echo -e "application/json\t\t\t\tmap" >> /etc/mime.types
41+
42+
cat /etc/mime.types | grep -i woff
43+
cat /etc/mime.types | grep -i ico
44+
cat /etc/mime.types | grep -i map
45+
cat /etc/mime.types | grep -i ttf
46+
47+
configure_aws_cli
48+
deploy_s3bucket

0 commit comments

Comments
 (0)