forked from hyphacoop/link.hypha.coop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
28 lines (26 loc) · 1.65 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
dist: xenial
sudo: required
language: generic
addons:
ssh_known_hosts: bw1.hypha.coop
before_install:
# Here, we decrypt a passwordless ssh key for acting as a user on the server named "travis"
# # See: https://docs.travis-ci.com/user/encrypting-files/#Automated-Encryption
- if [ "$TRAVIS_SECURE_ENV_VARS" == true ] && [ "$TRAVIS_BRANCH" = "master" ]; then openssl aes-256-cbc -K $encrypted_f217180e22ee_key -iv $encrypted_f217180e22ee_iv -in .scripts/id_rsa-production.enc -out .scripts/id_rsa-production -d; fi
- if [ "$TRAVIS_SECURE_ENV_VARS" == true ] && [ "$TRAVIS_BRANCH" = "master" ]; then chmod 400 .scripts/id_rsa-production; fi
- if [ "$TRAVIS_SECURE_ENV_VARS" == true ] && [ "$TRAVIS_BRANCH" = "staging" ]; then openssl aes-256-cbc -K $encrypted_d3974dc451dd_key -iv $encrypted_d3974dc451dd_iv -in .scripts/id_rsa-staging.enc -out .scripts/id_rsa-staging -d; fi
- if [ "$TRAVIS_SECURE_ENV_VARS" == true ] && [ "$TRAVIS_BRANCH" = "staging" ]; then chmod 400 .scripts/id_rsa-staging; fi
deploy:
# Cleanup removes keys and build artefacts.
# See: https://docs.travis-ci.com/user/deployment/#Uploading-Files-and-skip_cleanup
skip_cleanup: true
provider: script
script:
- if [ "$TRAVIS_BRANCH" = "staging" ]; then echo "Deploying to staging"; bash -x .scripts/deploy.sh deploy .scripts/id_rsa-staging bw1.staging.hypha.coop 8003 /var/www/link.staging.hypha.coop; elif [ "$TRAVIS_BRANCH" = "master" ]; then echo "Deploying to production"; bash -x .scripts/deploy.sh deploy .scripts/id_rsa-production bw1.hypha.coop 1003 /var/www/link.hypha.coop; fi
on:
branch:
- master
- staging
- travis.ci
notifications:
email: false