forked from SUSE/Portus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
89 lines (72 loc) · 2.69 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
language: ruby
sudo: required
dist: trusty
rvm:
# Stable supported version
- 2.4.2
# Future versions
- ruby-head
matrix:
allow_failures:
- rvm: ruby-head
cache:
directories:
- $PWD/travis_phantomjs
before_install:
# Remove the default bundler and install the expected one.
- rvm @global do gem uninstall bundler --all --executables
- gem uninstall bundler --all --executables
- gem install bundler --version '1.15.4'
- rvm reload
- bundle --version
- phantomjs --version
- export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
- if [ $(phantomjs --version) != '2.1.1' ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi
- if [ $(phantomjs --version) != '2.1.1' ]; then wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2; fi
- if [ $(phantomjs --version) != '2.1.1' ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi
- phantomjs --version
# Use the latest stable Node.js
- nvm install stable
- nvm use stable
# Install Yarn
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- sudo apt-get update
- sudo apt-get install yarn
- yarn install
before_script:
- mysql -e 'create database portus_test;'
- psql -c 'create database portus_test' -U postgres
script:
# Compile assets
- bundle exec rake portus:assets:compile
# Ruby tests
- bundle exec rspec spec packaging/suse/portusctl/spec --tag ~integration
# Style and security checks
- bundle exec rubocop -V
- bundle exec rubocop -F
- bundle exec brakeman
- bundle exec rake portus:annotate_and_exit
# Javascript style
- yarn run eslint
env:
global:
# OSC_CREDENTIALS are kept secret
# In order to update them, run:
# travis encrypt OSC_CREDENTIALS=user:password
# more info at: http://docs.travis-ci.com/user/environment-variables/#Secure-Variables
- OBS_REPO=Virtualization:containers:Portus
- OBS_BRANCH=master
- secure: "SgH8Wvm6n71GTZqTk2Ww/vLg3KK1QhgBMRSs+85TFemJvUDEWLKtANGI2szlqJOfOEWqHZ4rdzgMamtYfGmOZvjUBebaIXlYMcPyKSmcQZX/80R1/v7KFyhP2vqrb+ok/rK6lLXX06jDhohUS04vnx4i1EtoxH62dKImdlZsjzI="
# DB options for both adapters and Travis.
- PORTUS_DB_USERNAME=travis
matrix:
- PORTUS_DB_ADAPTER=mysql2
- PORTUS_DB_ADAPTER=postgresql
after_success:
- packaging/suse/package_and_push_to_obs.sh
addons:
code_climate:
repo_token: 18a0cf6c35e0c801678f12f444051c33e0390ce0efa91ec06a2aa5068b10c19e
mariadb: '10.2'
postgresql: '9.6'