forked from yeti-switch/yeti-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
108 lines (95 loc) · 4.36 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
sudo: required
language: ruby
rvm:
- 2.3
services:
- docker
git:
depth: false
env:
secure: "V6Fww6hQLaoajQmJnS8cyUAv7AEEwtrJDXkZC08/CRs10PoozP0idzgYCk3aHM0l2BiN/dvZCb9rNL9ZLv9LYmnZCvQ/OVOC6vFZHWebcd0wf3RWAPZzRsAXrFtRxDu9JbzJcQsW95c+9rKrtiiFSIQHUni1CYEbmFx4J7hB3Fl5Hb60wMbP5aanS9LP2X0f5Rl7idkXXxxY/3eFg4ZZWIODlCnuiYNuyuU26iR5I9VsL6+bu77aFZJ85z1ywvVvqV3ZIY0rr2EWQPtg4gilAnnkFjPDGz6vYIATuMPHflK/M+gcvLJqt0B/s8wMPX2mtNWJ191um2JoYBgZh6dykg89YUIsR4DFcLGTLRyK5X/6iLiBbkl7UwKU4/UDdiKt6mnh9KG8kM5c6U9QXUglvfoA7x4KlLNRPohqbxZskw5OTnf30zMKiDSL0buCA8Y1m5PBAdqR53/ruyxDZLgGd2Qv0lTktBxYYD04PBUbrW7SSxbTkzOudvXrXbGc0B2YhJnMTl3qkUSiXcxKyrROKdhMKL+Wg96YRnkJ01eMfqK9w56iAMfe3TIl+jFnvLLUFZlKC6jClW1tb9eRs+gxW6OLuDl44ReZ6q9qJhOXAIXXsJ3uon7ZT86hyQ8C8t4rteUUEXfCT/+lPtqmlD3WmkZ3abpHhlBIY9/GfqoNoyM="
install:
- sudo /etc/init.d/postgresql stop
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- docker build -t pgsql_yeti -f ./ci/pgsql.Dockerfile .
- docker network create yeti-net
- docker run -d --network yeti-net -p 5432:5432 --name db pgsql_yeti
- cp config/database.example.yml config/database.yml
- cp config/yeti_web.yml.distr config/yeti_web.yml
stages:
- test
- stable package
- nightly package
jobs:
include:
- stage: test
script:
- bundle install --jobs=3 --retry=3 --deployment
- RAILS_ENV=test bundle exec rake db:create db:structure:load db:migrate
- RAILS_ENV=test bundle exec rake db:second_base:create db:second_base:structure:load db:second_base:migrate
- RAILS_ENV=test bundle exec rake db:seed
- bundle exec rspec
- stage: test
script:
- bundle install --jobs=3 --retry=3 --deployment
- RAILS_ENV=test bundle exec rake db:create db:structure:load db:migrate
- RAILS_ENV=test bundle exec rake db:second_base:create db:second_base:structure:load db:second_base:migrate
- RAILS_ENV=test bundle exec rake db:seed
- bundle exec cucumber
- stage: test
script:
- bundle install --jobs=3 --retry=3 --deployment
- RAILS_ENV=test bundle exec rake db:create db:structure:load db:migrate
- RAILS_ENV=test bundle exec rake db:second_base:create db:second_base:structure:load db:second_base:migrate
- RAILS_ENV=test bundle exec rake db:seed
- cd pgq-processors && bundle install --gemfile="./Gemfile" && cd ..
- cd pgq-processors && BUNDLE_GEMFILE=./Gemfile ./bin/bundle exec rspec && cd ..
- stage: stable package
if: branch != master OR tag =~ ^.*$
script: &build_jessie
- rm -vf config/database.yml
- docker build -t yeti-web -f ./ci/build_jessie.Dockerfile .
- docker run --network yeti-net --name yeti-web yeti-web && docker commit yeti-web yeti-web:built
deploy:
skip_cleanup: true
provider: script
script: docker run --name yeti-web-deploy yeti-web:built ci/deploy.sh "$API_ENDPOINT" jessie "${TRAVIS_TAG:0:3}" main /build/*.deb
on:
tags: true
condition: "$TRAVIS_TAG != *-master*"
repo: yeti-switch/yeti-web
- stage: stable package
if: branch != master OR tag =~ ^.*$
script: &build_stretch
- rm -vf config/database.yml
- docker build -t yeti-web -f ./ci/build_stretch.Dockerfile .
- docker run --network yeti-net --name yeti-web yeti-web && docker commit yeti-web yeti-web:built
deploy:
skip_cleanup: true
provider: script
script: docker run --name yeti-web-deploy yeti-web:built ci/deploy.sh "$API_ENDPOINT" stretch "${TRAVIS_TAG:0:3}" main /build/*.deb
on:
tags: true
condition: "$TRAVIS_TAG != *-master*"
repo: yeti-switch/yeti-web
- stage: nightly package
if: branch = master
script: *build_jessie
deploy:
skip_cleanup: true
provider: script
script: docker run --name yeti-web-deploy yeti-web:built ci/deploy.sh "$API_ENDPOINT" jessie nightly main /build/*.deb
on:
all_branches: true
repo: yeti-switch/yeti-web
- stage: nightly package
if: branch = master
script: *build_stretch
deploy:
skip_cleanup: true
provider: script
script: docker run --name yeti-web-deploy yeti-web:built ci/deploy.sh "$API_ENDPOINT" stretch nightly main /build/*.deb
on:
all_branches: true
repo: yeti-switch/yeti-web