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

badge updates and CI update #1232

Merged
merged 9 commits into from
Oct 3, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Switch to CircleCI
  • Loading branch information
mtwomey committed Sep 25, 2017
commit 87a707335ee1a07f5caf17182114f4da2f39fe75
66 changes: 0 additions & 66 deletions .travis.yml

This file was deleted.

43 changes: 43 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
machine:
node:
version: 5.12.0
environment:
CXX: g++-4.8

dependencies:
pre:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update -y
- sudo apt-get install g++-4.8 -y
override:
- node --version
- npm --version
- nvm --version
- npm install

compile:
override:
- ls node_modules/*
- npm run lint && npm run build

test:
override:
- npm test

deployment:
development:
branch: dev
owner: appirio-tech
commands:
- ./deploy.sh DEV
qa:
branch: qa-integration
owner: appirio-tech
commands:
- ./deploy.sh QA
production:
branch: master
owner: appirio-tech
commands:
- ./deploy.sh PROD

48 changes: 48 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash

ENV=$1
echo $ENV
AWS_ACCESS_KEY_ID=$(eval "echo \$${ENV}_AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY=$(eval "echo \$${ENV}_AWS_SECRET_ACCESS_KEY")
AWS_S3_BUCKET=$(eval "echo \$${ENV}_S3_BUCKET")

configure_aws_cli() {
aws --version
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
aws configure set default.output json
echo "Configured AWS CLI."
}

deploy_s3bucket() {
cat dist/app.2e9868372e0e2992d5d2.css
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"`
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`
if [ $? -eq 0 ]; then
echo "All txt, css, and js files are Deployed! with gzip"
else
echo "Deployment Failed - $result"
exit 1
fi

}

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

configure_aws_cli
deploy_s3bucket
Loading