forked from openstreetmap/openstreetmap-website
/
.travis.yml
59 lines (59 loc) · 2.28 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
jobs:
include:
- name: "Website Code"
dist: bionic
language: ruby
rvm:
- 2.7.0
cache:
- bundler
addons:
postgresql: 9.5
apt:
packages:
- firefox-geckodriver
- libarchive-dev
- libgd-dev
- libffi-dev
- libbz2-dev
services:
- memcached
before_script:
- sed -e 's/ IMMUTABLE / /' -e "/^--/d" db/structure.sql > db/structure.expected
- psql -U postgres -c "CREATE DATABASE openstreetmap"
- psql -U postgres -c "CREATE EXTENSION btree_gist" openstreetmap
- psql -U postgres -f db/functions/functions.sql openstreetmap
- cp config/travis.database.yml config/database.yml
- cp config/example.storage.yml config/storage.yml
- touch config/settings.local.yml
- echo -e "---\nmemcache_servers:\n - 127.0.0.1" > config/settings/test.local.yml
- bundle exec rake db:migrate
- bundle exec rake i18n:js:export
- bundle exec rake yarn:install
script:
- bundle exec rubocop -f fuubar
- bundle exec rake eslint
- bundle exec erblint .
- bundle exec brakeman -q
- bundle exec rake db:structure:dump
- sed -e "/idle_in_transaction_session_timeout/d" -e 's/ IMMUTABLE / /' -e "/^--/d" db/structure.sql > db/structure.actual
- diff -uw db/structure.expected db/structure.actual
- bundle exec rake test:db
- name: "Docker-Compose Configuration"
language: minimal
services:
- docker
before_script:
- cp config/example.storage.yml config/storage.yml
- cp config/docker.database.yml config/database.yml
- touch config/settings.local.yml
script:
- docker-compose build
- docker-compose up -d
- sleep 15 # let the DB warm up a little
- docker-compose run --rm web rake db:migrate
- docker-compose run --rm web osmosis --rx docker/null-island.osm.xml --wd host=db database=openstreetmap user=openstreetmap password=openstreetmap validateSchemaVersion=no
- docker-compose run web bundle exec rake yarn:install
- curl -siL http://127.0.0.1:3000 | egrep '^HTTP/1.1 200 OK'
- curl -siL http://127.0.0.1:3000 | grep 'OpenStreetMap is the free wiki world map'
- curl -siL http://127.0.0.1:3000/api/0.6/node/1 | grep 'Null Island'