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

Dev - circleci2 miggration #1312

Merged
merged 33 commits into from
Jul 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0355df6
Delete circle.yml
nkumar-topcoder Jul 17, 2018
3d3225e
Create config.yml
nkumar-topcoder Jul 17, 2018
6274992
added estraverse: 4.1.0
nkumar-topcoder Jul 17, 2018
252a06c
update babel-polyfil.js
nkumar-topcoder Jul 17, 2018
b0f5609
added missing comma
nkumar-topcoder Jul 17, 2018
d06469d
Update karma.conf.js
nkumar-topcoder Jul 17, 2018
0b59693
Update karma.conf.js
nkumar-topcoder Jul 17, 2018
66e15a2
add bluebird dependency
nkumar-topcoder Jul 17, 2018
eeff412
Remove babel-polyfill
nkumar-topcoder Jul 17, 2018
46da46c
attach workspace fix
nkumar-topcoder Jul 17, 2018
0ced8a8
fix circleci working directory
nkumar-topcoder Jul 17, 2018
aa59b46
Update deploy.sh
nkumar-topcoder Jul 17, 2018
3f3842c
Update config.yml
nkumar-topcoder Jul 17, 2018
a2a30e5
Update config.yml
nkumar-topcoder Jul 17, 2018
40e2543
fix permission issue for mime.types
nkumar-topcoder Jul 17, 2018
dc65a42
Update README.md
Gunasekar-K Jul 19, 2018
7f12917
Update README.md
Gunasekar-K Jul 19, 2018
4ff62c8
update to nvm 6.8
nkumar-topcoder Jul 19, 2018
57c3ed9
add html-webpack-plugin & webpack-dev-server, webpack
nkumar-topcoder Jul 19, 2018
faee0b1
Update package.json
nkumar-topcoder Jul 19, 2018
42ceb91
revert to "webpack": "1.15.0"
nkumar-topcoder Jul 19, 2018
8ca737d
Update package.json
nkumar-topcoder Jul 19, 2018
a6c04dd
comments line 37,38,39
nkumar-topcoder Jul 20, 2018
122bf70
Update deploy.sh
nkumar-topcoder Jul 20, 2018
c68b911
revert to 5.8
nkumar-topcoder Jul 20, 2018
8e8ca57
Update deploy.sh
nkumar-topcoder Jul 20, 2018
508790d
Update config.yml
nkumar-topcoder Jul 20, 2018
a5b8a86
Update package.json
nkumar-topcoder Jul 20, 2018
6a6191e
Update config.yml
nkumar-topcoder Jul 20, 2018
3e75459
Update package.json
nkumar-topcoder Jul 20, 2018
fcc5427
Update package.json
nkumar-topcoder Jul 20, 2018
9a59cbd
add tapable
nkumar-topcoder Jul 20, 2018
f7dc080
resolving conflict..
sachin-maheshwari Jul 27, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
version: 2

# Python image to run aws utilities
python_env: &python_env
docker:
- image: circleci/python:2.7-stretch-browsers

# Instructions of installing aws utilities
install_awscli: &install_awscli
name: "Install awscli"
command: |
sudo pip install awscli awsebcli --upgrade
aws --version
eb --version

# Instructinos of deployment
deploy_steps: &deploy_steps
- attach_workspace:
at: .
- run: *install_awscli
- setup_remote_docker
- run: ./deploy.sh $DEPLOY_ENV


jobs:
build:
machine: true
environment:
CXX: g++-4.8
steps:
- run:
name: Install g++-4.8
command: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -y
sudo apt-get install g++-4.8 -y
- run:
name: Install node-5.12.0
command: |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | sudo bash
source ~/.bashrc
nvm install 5.12.0
node --version
npm --version
nvm --version

- checkout
- restore_cache:
key: node-modules-{{ checksum "package-lock.json" }}
- run: npm install
- save_cache:
key: node-modules-{{ checksum "package-lock.json" }}
paths:
- node_modules
- run: ls node_modules/*
- run: npm run lint && npm run build
- run: npm test
- persist_to_workspace:
root: .
paths:
- ./

deploy_prod:
<<: *python_env
environment:
DEPLOY_ENV: "PROD"
steps: *deploy_steps

deploy_dev:
<<: *python_env
environment:
DEPLOY_ENV: "DEV"
steps: *deploy_steps

deploy_qa:
<<: *python_env
environemtn:
DEPLOY_ENV: "QA"
steps: *deploy_steps

workflows:
version: 2
build-and-deploy:
jobs:
- build
- deploy_dev:
filters:
branches:
only: [ dev, dev-circleci2 ]
requires:
- build
- deploy_prod:
filters:
branches:
only: master
requires:
- build
- deploy_qa:
filters:
branches:
only: qa-integration
requires:
- build
42 changes: 0 additions & 42 deletions circle.yml

This file was deleted.

17 changes: 10 additions & 7 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ configure_aws_cli() {
}

deploy_s3bucket() {
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"
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"`
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"
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"`
if [ $? -eq 0 ]; then
echo "All html, font, image, map, and media files are Deployed without gzip encoding!"
else
echo "Deployment Failed - $result"
exit 1
fi
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
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`
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
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`
if [ $? -eq 0 ]; then
echo "All txt, css, and js files are Deployed! with gzip"
else
Expand All @@ -34,14 +34,17 @@ deploy_s3bucket() {

}

echo -e "application/font-woff\t\t\t\twoff2" >> /etc/mime.types
echo -e "application/font-sfnt\t\t\t\tttf" >> /etc/mime.types
echo -e "application/json\t\t\t\tmap" >> /etc/mime.types
#sudo chmod 666 /etc/mime.types
#echo -e "application/font-woff\t\t\t\twoff2" >> /etc/mime.types
#echo -e "application/font-sfnt\t\t\t\tttf" >> /etc/mime.types
#echo -e "application/json\t\t\t\tmap" >> /etc/mime.types


cat /etc/mime.types | grep -i woff
cat /etc/mime.types | grep -i ico
cat /etc/mime.types | grep -i map
cat /etc/mime.types | grep -i ttf
cat /etc/mime.types | grep -i woff2

configure_aws_cli
deploy_s3bucket
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
"tc-angular-ellipsis": "0.1.6",
"topcoder-app-r": "https://github.com/appirio-tech/topcoder-app-r.git#0.0.1",
"xml2js": "0.4.17",
"zepto": "1.0.1"
"zepto": "1.0.1",
"estraverse": "4.1.0",
"bluebird": "2.9.2",
"tapable": "1.0.0"
}
}