Skip to content

Commit

Permalink
Settings for Travis deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
rsarky authored and bhawesh96 committed Dec 21, 2018
1 parent 0044168 commit 37c8f16
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 30 deletions.
41 changes: 16 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,32 @@
language: node_js

node_js:
- '9'

cache:
directories:
- node_modules

sudo: enabled

install:
- npm install

script:
before_deploy:
- if [ "$TRAVIS_BRANCH" = "master" ]; then npm run build:stage; fi
- if [ "$TRAVIS_BRANCH" = "prod" ]; then npm run build:prod; fi

- if [ "$TRAVIS_BRANCH" = "prod" ]; then npm run build:production; fi
deploy:
- provider: script
skip_cleanup: true
script: bash deploy.sh
local_dir: build
on:
all_branches: true
condition: $TRAVIS_BRANCH =~ ^master|prod$

- provider: script
skip_cleanup: true
script: bash deploy.sh
local_dir: build
on:
all_branches: true
condition: "$TRAVIS_BRANCH =~ ^master|prod$"
git:
depth: 3

before_install:
- openssl aes-256-cbc -K $encrypted_10aae5acea6a_key -iv $encrypted_10aae5acea6a_iv
-in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar

notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/04c35213e58932123cc0
on_success: always # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
- https://webhooks.gitter.im/e/a72e8b6a596be04dcb83
on_success: always
on_failure: always
before_install:
- openssl aes-256-cbc -K $encrypted_10aae5acea6a_key -iv $encrypted_10aae5acea6a_iv
-in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MIT-Event-Booking [![Build Status](https://travis-ci.com/cribblportal/MIT-Event-Booking.svg?token=VkvSbZJB1bmjWZDEPRYh&branch=master)](https://travis-ci.com/cribblportal/MIT-Event-Booking)
# MIT-Event-Booking [![Build Status](https://travis-ci.org/cribbl/miteb-frontend.svg?branch=master)](https://travis-ci.org/cribbl/miteb-frontend)
Online portal to book events and rooms for clubs of MIT.

## Folder Structure
Expand Down
6 changes: 3 additions & 3 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set -x
# Initialize a new git repo in _site, and push it to our server.

if [ "$TRAVIS_BRANCH" = "prod" ]; then server_ip=$PROD_SERVER_IP; folder=prod; fi
if [ "$TRAVIS_BRANCH" = "master" ]; then server_ip=$STAGING_SERVER_IP; folder=stage; fi
if [ "$TRAVIS_BRANCH" = "prod" ]; then server_ip=$PROD_SERVER_IP; folder=production; fi
if [ "$TRAVIS_BRANCH" = "master" ]; then server_ip=$STAGING_SERVER_IP; folder=staging; fi

ls
mv deploy-key build
Expand All @@ -17,7 +17,7 @@ mkdir .ssh
touch ~/.ssh/known_hosts
ssh-keyscan -H $server_ip >> ~/.ssh/known_hosts

git remote add deploy "root@$server_ip:/var/www/$folder"
git remote add deploy "deploy@$server_ip:/var/www/$folder"
git config user.name "bhawesh96"
git config user.email "[email protected]"

Expand Down
Binary file modified secrets.tar.enc
Binary file not shown.
2 changes: 1 addition & 1 deletion src/components/AppBarComponent/AppBarComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class AppBarComponent extends Component {
console.log(location.pathname)
if (['/home', '/complaints', '/auth', '/'].indexOf(location.pathname) > -1) {
this.setState({ showMenuIcon: false })
}
}
})
}

Expand Down

0 comments on commit 37c8f16

Please sign in to comment.