Skip to content

Commit f6653cd

Browse files
committed
Travis fixes
1 parent 940ebaf commit f6653cd

File tree

5 files changed

+25
-12
lines changed

5 files changed

+25
-12
lines changed

.travis.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,33 @@
11
rvm: 2.7.2
22
cache: bundler
33

4-
import:
5-
- travis-ci/build-configs:db-setup.yml
6-
74
services:
85
- redis
96

10-
before_install:
11-
- gem install bundler
12-
137
env:
148
global:
159
- PATH=/snap/bin:$PATH
1610

1711
jobs:
1812
include:
1913
- stage: "testing time"
20-
script: bundle exec rspec -e test
14+
script: bundle exec rspec
15+
16+
dist: xenial
17+
18+
before_install:
19+
- gem install bundler
20+
- sudo apt-get install -yq --no-install-suggests --no-install-recommends postgresql-common
21+
- sudo service postgresql stop
22+
- sudo apt install -yq --no-install-suggests --no-install-recommends postgresql-11 postgresql-client-11
23+
- sed -e 's/^port.*/port = 5432/' /etc/postgresql/11/main/postgresql.conf > postgresql.conf
24+
- sudo chown postgres postgresql.conf
25+
- sudo mv postgresql.conf /etc/postgresql/11/main
26+
- sudo cp /etc/postgresql/{10,11}/main/pg_hba.conf
27+
- sudo service postgresql start 11
28+
29+
before_script:
30+
- psql --version
31+
- psql -c 'CREATE DATABASE travis_test;' -U postgres
32+
- psql -t -c "SELECT 1 FROM pg_roles WHERE rolname='travis'" -U postgres | grep 1 || psql -c 'CREATE ROLE travis SUPERUSER LOGIN CREATEDB;' -U postgres
33+
- psql -f db/schema.sql -v ON_ERROR_STOP=1 travis_test

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ to json files and sends them to GCE.
55

66
#### Ruby version
77

8-
2.7.0
8+
2.7.2
99

1010
#### Configuration
1111

db/schema.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
DROP SCHEMA public CASCADE;
2-
DROP SCHEMA sqitch CASCADE;
1+
DROP SCHEMA IF EXISTS public CASCADE;
2+
DROP SCHEMA IF EXISTS sqitch CASCADE;
33
CREATE SCHEMA public;
44

55
SET statement_timeout = 0;

lib/config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ def initialize(args={}) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticCom
1919
@limit = args[:limit] || ENV['BACKUP_LIMIT'] || config['backup']['limit']
2020
@delay = args[:delay] || ENV['BACKUP_DELAY'] || config['backup']['delay']
2121
@files_location = args[:files_location] || ENV['BACKUP_FILES_LOCATION'] || config['backup']['files_location']
22-
@database_url = args[:database_url] || ENV['DATABASE_URL'] || connection_details['development']
22+
@database_url = args[:database_url] || ENV['DATABASE_URL'] || connection_details[ENV['RAILS_ENV']]
2323
end
2424
end

spec/backup_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
describe Backup do
1111
before(:all) do
12-
system("psql '#{Config.new.database_url}' -f db/schema.sql > /dev/null")
12+
system("psql '#{Config.new.database_url}' -f db/schema.sql")
1313
end
1414

1515
after(:each) do

0 commit comments

Comments
 (0)