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

Commit c06394e

Browse files
author
sachin-maheshwari
authored
Merge pull request #1312 from appirio-tech/dev-circleci2
Dev - circleci2 miggration
2 parents 33093fd + f7dc080 commit c06394e

File tree

4 files changed

+117
-50
lines changed

4 files changed

+117
-50
lines changed

.circleci/config.yml

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
version: 2
2+
3+
# Python image to run aws utilities
4+
python_env: &python_env
5+
docker:
6+
- image: circleci/python:2.7-stretch-browsers
7+
8+
# Instructions of installing aws utilities
9+
install_awscli: &install_awscli
10+
name: "Install awscli"
11+
command: |
12+
sudo pip install awscli awsebcli --upgrade
13+
aws --version
14+
eb --version
15+
16+
# Instructinos of deployment
17+
deploy_steps: &deploy_steps
18+
- attach_workspace:
19+
at: .
20+
- run: *install_awscli
21+
- setup_remote_docker
22+
- run: ./deploy.sh $DEPLOY_ENV
23+
24+
25+
jobs:
26+
build:
27+
machine: true
28+
environment:
29+
CXX: g++-4.8
30+
steps:
31+
- run:
32+
name: Install g++-4.8
33+
command: |
34+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
35+
sudo apt-get update -y
36+
sudo apt-get install g++-4.8 -y
37+
- run:
38+
name: Install node-5.12.0
39+
command: |
40+
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | sudo bash
41+
source ~/.bashrc
42+
nvm install 5.12.0
43+
node --version
44+
npm --version
45+
nvm --version
46+
47+
- checkout
48+
- restore_cache:
49+
key: node-modules-{{ checksum "package-lock.json" }}
50+
- run: npm install
51+
- save_cache:
52+
key: node-modules-{{ checksum "package-lock.json" }}
53+
paths:
54+
- node_modules
55+
- run: ls node_modules/*
56+
- run: npm run lint && npm run build
57+
- run: npm test
58+
- persist_to_workspace:
59+
root: .
60+
paths:
61+
- ./
62+
63+
deploy_prod:
64+
<<: *python_env
65+
environment:
66+
DEPLOY_ENV: "PROD"
67+
steps: *deploy_steps
68+
69+
deploy_dev:
70+
<<: *python_env
71+
environment:
72+
DEPLOY_ENV: "DEV"
73+
steps: *deploy_steps
74+
75+
deploy_qa:
76+
<<: *python_env
77+
environemtn:
78+
DEPLOY_ENV: "QA"
79+
steps: *deploy_steps
80+
81+
workflows:
82+
version: 2
83+
build-and-deploy:
84+
jobs:
85+
- build
86+
- deploy_dev:
87+
filters:
88+
branches:
89+
only: [ dev, dev-circleci2 ]
90+
requires:
91+
- build
92+
- deploy_prod:
93+
filters:
94+
branches:
95+
only: master
96+
requires:
97+
- build
98+
- deploy_qa:
99+
filters:
100+
branches:
101+
only: qa-integration
102+
requires:
103+
- build

circle.yml

-42
This file was deleted.

deploy.sh

+10-7
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ configure_aws_cli() {
1515
}
1616

1717
deploy_s3bucket() {
18-
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"
19-
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"`
18+
aws s3 sync --dryrun ${HOME}/project/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*.txt" --exclude "*.js" --exclude "*.css"
19+
result=`aws s3 sync ${HOME}/project/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*.txt" --exclude "*.js" --exclude "*.css"`
2020
if [ $? -eq 0 ]; then
2121
echo "All html, font, image, map, and media files are Deployed without gzip encoding!"
2222
else
2323
echo "Deployment Failed - $result"
2424
exit 1
2525
fi
26-
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
27-
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`
26+
aws s3 sync --dryrun ${HOME}/project/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*" --include "*.txt" --include "*.js" --include "*.css" --content-encoding gzip
27+
result=`aws s3 sync ${HOME}/project/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*" --include "*.txt" --include "*.js" --include "*.css" --content-encoding gzip`
2828
if [ $? -eq 0 ]; then
2929
echo "All txt, css, and js files are Deployed! with gzip"
3030
else
@@ -34,14 +34,17 @@ deploy_s3bucket() {
3434

3535
}
3636

37-
echo -e "application/font-woff\t\t\t\twoff2" >> /etc/mime.types
38-
echo -e "application/font-sfnt\t\t\t\tttf" >> /etc/mime.types
39-
echo -e "application/json\t\t\t\tmap" >> /etc/mime.types
37+
#sudo chmod 666 /etc/mime.types
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+
4042

4143
cat /etc/mime.types | grep -i woff
4244
cat /etc/mime.types | grep -i ico
4345
cat /etc/mime.types | grep -i map
4446
cat /etc/mime.types | grep -i ttf
47+
cat /etc/mime.types | grep -i woff2
4548

4649
configure_aws_cli
4750
deploy_s3bucket

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
7575
"tc-angular-ellipsis": "0.1.6",
7676
"topcoder-app-r": "https://github.com/appirio-tech/topcoder-app-r.git#0.0.1",
7777
"xml2js": "0.4.17",
78-
"zepto": "1.0.1"
78+
"zepto": "1.0.1",
79+
"estraverse": "4.1.0",
80+
"bluebird": "2.9.2",
81+
"tapable": "1.0.0"
7982
}
8083
}

0 commit comments

Comments
 (0)