This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
81 lines (67 loc) · 2.91 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
sudo: false
language: node_js
env:
- BOTO_CONFIG=~/.boto
git:
depth: 18 # arbitrarily set, but lower than the default of 50
node_js:
- '5.10'
services:
- redis-server
cache:
directories:
- node_modules
before_install:
- psql -c 'DROP DATABASE IF EXISTS travis;' -U postgres
- psql -c 'CREATE DATABASE travis;' -U postgres
- cat core/db/*.sql | psql
# needed for istanbul coverage reports, but istanbul isn't working
#- npm install -g codeclimate-test-reporter
# reqs for SlimerJS
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# reqs. for publishing images to Google Cloud Storage
#- pip install --user gsutil
#- cp .travis/.boto ~/.boto
#- echo "[Credentials]" >> ~/.boto
#- echo "gs_oauth2_refresh_token = $gs_oauth2_refresh_token" >> ~/.boto
after_success: >
BR=$TRAVIS_BRANCH;
PR=$TRAVIS_PULL_REQUEST;
if [ "$PR" = "false" ] && ( [ "$BR" = "master" ] || [ "$BR" = "staging" ] || [ "$BR" = "production" ] ); then
openssl aes-256-cbc -K $encrypted_580911208d9b_key -iv $encrypted_580911208d9b_iv -in .travis/travis_hlrdesk.enc -out ~/.ssh/id_rsa -d;
chmod 600 ~/.ssh/id_rsa;
git config --global user.email "travis@travis-ci";
git config --global user.name "Travis CI Server";
# see addons: ssh_known_hosts: ... in Travis-CI docs
hosts="hlrdev.byu.edu hlrdesk.hlrdev.byu.edu hlrdesk-staging.byu.edu hlrdesk-prod.byu.edu";
for i in $hosts; do ssh-keyscan -t rsa,dsa -H $i 2>&1 | tee -a $HOME/.ssh/known_hosts; done
if [ "$TRAVIS_BRANCH" = "master" ]; then
npm run deploy dev;
#codeclimate < coverage/lcov.info
elif [ "$TRAVIS_BRANCH" = "staging" ]; then
npm run deploy staging;
elif [ "$TRAVIS_BRANCH" = "production" ]; then
npm run deploy production;
fi
fi
# will be run regardless of success or failure
after_script:
# TODO: Our Google Cloud storage account has been used up; we don't have anything to push.
# - export PATH=$PATH:~/.local/bin/ # gsutil is installed using pip install --user, so it's local
# # upload screenshots to Google Cloud Storage
# - gsutil cp -a public-read tests/screenshots/* "gs://byu-hlr-screenshots/$TRAVIS_BUILD_NUMBER-$TRAVIS_BRANCH-`git log --pretty=format:\"%s (%cn)\" | head -n 1`/"
# - ./.gen-gh-pages.sh
# # publish pages
# - git checkout --orphan gh-pages
# - rm -rf `find ./* -not -path "./gh-pages/*" -not -name "gh-pages" -not -path "./.git/*" -not -name ".git" -not -path "./.travis"`
# - mv ./gh-pages/* .
# - rmdir gh-pages
# - git config --global user.email "[email protected]"
# - git config --global user.name "travis-ci"
# - git add -A -f
# - git commit -m "Travis build $TRAVIS_BUILD_NUMBER"
# - git push -f --quiet "https://webnard:${GH_TOKEN}@github.com/byu-odh/hlrdesk" gh-pages:gh-pages > /dev/null 2>&1
# - echo "See build screenshots on https://byu-odh.github.io/hlrdesk"
addons:
postgresql: "9.3" # we should be using 9.1, but it doesn't work with our test runner