-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
21 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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]" | ||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters