forked from fusor/fusor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.sh
More file actions
executable file
·62 lines (54 loc) · 3.24 KB
/
Copy path.travis.sh
File metadata and controls
executable file
·62 lines (54 loc) · 3.24 KB
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
#!/bin/bash
if [ $1 == "install" ]; then
cd ..
gem install bundler
# I don't think these are needed in Travis Ci environment, will have to test though
#sudo su -c 'echo "local all all trust" > /etc/postgresql/9.1/main/pg_hba.conf'
#sudo su -c 'echo "host all all 127.0.0.1/32 trust" >> /etc/postgresql/9.1/main/pg_hba.conf'
#sudo su -c 'echo "host all all ::1/128 trust" >> /etc/postgresql/9.1/main/pg_hba.conf'
#sudo service postgresql restart
#sudo -u postgres createuser katello --superuser
# Our db migrations don't apply to foreman 1.8-stable and katello-2.2, but we don't want our tests breaking everytime develop and master branches are unstable either. There may be a better way to do this, but for now let's get develop / master branches and then checkout out a known working state.
git clone -b develop https://github.com/theforeman/foreman.git
git clone -b master https://github.com/Katello/katello.git
git clone https://github.com/fusor/foretello_api_v21.git
cd katello
git checkout 21bee8252e50b1b9d0ef3e08177f5084f63dbf18
cp script/ci/katello.yml config/katello.yml
# Hack out some qpid dependencies in katello so that it can build on ubuntu 12.04
sed -i 's/gem.add_dependency "qpid_messaging"/#gem.add_dependency "qpid_messaging"/' katello.gemspec
sed -i "s/require 'qpid_messaging'/#require 'qpid_messaging'/" lib/katello.rb
sed -i "s/Qpid::Messaging::Connection/#Qpid::Messaging::Connection'/" app/lib/actions/candlepin/candlepin_listening_service.rb
sed -i "s/Qpid::Messaging::Duration/1#Qpid::Messaging::Duration'/" app/lib/actions/candlepin/candlepin_listening_service.rb
cd ../foreman
git checkout 996b3db5141564f3a177df7766047de94a3b2acd
sed -e 's/:locations_enabled: false/:locations_enabled: true/' config/settings.yaml.example > config/settings.yaml
sed -i 's/:organizations_enabled: false/:organizations_enabled: true/' config/settings.yaml
cp ../fusor/.foreman_database.yml config/database.yml
echo "gem 'fusor_server', :path => '../fusor/server'" >> bundler.d/local.rb
echo "gem 'katello', :path => '../katello'" >> bundler.d/local.rb
echo "gem 'foretello_api_v21', :path => '../foretello_api_v21'" >> bundler.d/local.rb
echo "gem 'foreman_discovery', '< 4.2.0'" >> bundler.d/local.rb
echo "gem 'dynflow'" >> bundler.d/local.rb
echo "gem 'less-rails'" >> bundler.d/local.rb
echo "gem 'logger'" >> bundler.d/local.rb
echo "gem 'egon'" >> bundler.d/local.rb
echo "gem 'coveralls', require: false" >> bundler.d/local.rb
echo "gem 'foreman_docker', '< 2.0.0'" >> bundler.d/local.rb
echo "gem 'jwt', '< 1.5.3'" >> bundler.d/local.rb
echo "gem 'rake', '< 11'" >> bundler.d/local.rb
# TODO: use the latest version of foreman once this PR is merged
# https://github.com/theforeman/foreman/pull/3034
sed -i "s/gem 'net-ldap', '>= 0.8.0'/gem 'net-ldap', '>= 0.8.0', '< 0.13.0'/" Gemfile
bundle install --retry 3 --without development mysql2 libvirt
# hacky, find a better way to do this...
# rails only supports loading fixtures from one directory, so link the
# katello / fusor fixtures in to forman so they all will be loaded
cd test/fixtures
ln -s ../../../fusor/server/test/fixtures/* .
ln -s ../../../katello/test/fixtures/models/* .
else
cd ../foreman
rake db:create
rake db:migrate
fi