-
Notifications
You must be signed in to change notification settings - Fork 8
/
.travis.yml
88 lines (77 loc) · 2.4 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
82
83
84
85
86
87
88
dist: xenial
sudo: false
language: elixir
elixir:
- 1.11.4
otp_release:
- 22.3
erlang:
- 23.3.1
node:
- 14.0.0
services:
- docker
env:
global:
- DOCKER_USERNAME=travis
addons:
chrome: stable
postgresql: "10"
cache:
directories:
- _build
- deps
- assets/node_modules
install:
- psql -c 'create database app_template_test;' -U postgres
- nvm install 12.4.0 && nvm use 12.4.0
before_script:
- sudo rm /etc/ssl/certs/DST_Root_CA_X3.pem || echo "expired LetsEncrypt root not found at /etc/ssl/certs/DST_Root_CA_X3.pem"
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
- npm install --prefix assets
jobs:
include:
- stage: "Tests" # naming the Tests stage
name: "Unit Tests" # names the first Tests stage job
services:
- postgresql
script:
- MIX_ENV=test mix test
- npm test --prefix assets
- stage: "Tests"
name: "Integration Tests"
services:
- postgresql
- xvfb
before_install:
- CHROME_VERSION=`google-chrome --version | grep -oP " ([0-9]{1,3})" | cut -d" " -f2`
- DRIVER_VERSION=`wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION}`
- wget https://chromedriver.storage.googleapis.com/${DRIVER_VERSION}/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
- sudo apt-get install libnss3
- sudo cp chromedriver /usr/local/bin/.
- sudo chmod +x /usr/local/bin/chromedriver
- pip install --user awscli
- export PATH=$PATH:$HOME/.local/bin
- mkdir -p $HOME/src
- wget http://selenium-release.storage.googleapis.com/2.48/selenium-server-standalone-2.48.2.jar
- nohup java -Dselenium.LOGGER.level=WARNING -jar selenium-server-standalone-2.48.2.jar > /dev/null 2>&1 &
- chromedriver > /dev/null 2>&1 &
script:
- mix integration_tests
- stage: docker deploy
name: "Deploy"
if: branch = main
script: skip
before_deploy:
- echo $DOCKER_PASSWORD | docker login harbor.revelry-prod.revelry.net -u $DOCKER_USERNAME --password-stdin
- export ROLLBAR_DEPLOY_ID=$(./bin/rollbar_release started)
after_deploy:
- ./bin/rollbar_release succeeded
deploy:
provider: script
script: bin/docker_pub . library/app-template harbor.revelry-prod.revelry.net
on:
branch: main