Fix dependencies, run bundle install only when needed

Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
This commit is contained in:
Miroslav Vadkerti 2018-02-19 13:08:10 +01:00
commit 057642bf1e
2 changed files with 4 additions and 6 deletions

View file

@ -54,7 +54,7 @@ $(METADATA): Makefile
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 60m" >> $(METADATA)
@echo "RunFor: rubygem-rails ruby" >> $(METADATA)
@echo "Requires: rubygems rubygem-rails ruby-devel sqlite-devel libxml2-devel libxslt-devel gcc-c++ net-tools procps-ng" >> $(METADATA)
@echo "Requires: rubygems rubygem-rails ruby-devel sqlite-devel libxml2-devel libxslt-devel gcc-c++ net-tools procps-ng psmisc" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)

View file

@ -38,9 +38,6 @@ bundle=""
ARCH=$(uname -m)
RAILSVER=""
# if in collection get gem dependencies locally not from rubygems.org
[ -n "$COLLECTIONS" ] && bundle="--local"
# version of Ruby on RHEL7 needs older version of rails
if rlIsRHEL 7; then RAILSVER="-v 4.2.7"; NOKOVER="-v 1.6.8"; fi
@ -76,6 +73,7 @@ rlJournalStart
if [[ ! "$COLLECTIONS" =~ "rh-ror50" ]]
then
rlRun "echo \"gem 'therubyracer'\" >> Gemfile" 0 "Adding therubyracer gem into Gemfile"
rlRun "bundle install"
fi
if [ -z "$COLLECTIONS" ] && rlIsRHEL '<=7'
@ -84,13 +82,13 @@ rlJournalStart
sed -i "s/gem 'spring'/#gem 'spring'/" Gemfile
rlRun "gem pristine nokogiri" 0 "Restore installed nokogiri to pristine condition"
rlRun "bundle config build.nokogiri --use-system-libraries" 0 "Build nokogiri with system libraries"
rlRun "bundle install"
fi
rlRun "bundle install $bundle"
rlRun "netstat -tulpn | grep 3000" 1 "Check if port 3000 isn't engaged"
rlRun "rails server &" 0 "Running rails server"
sleep 10
rlRun "wget http://0.0.0.0:3000" 0 "Wgetting running rails application"
rlRun "pkill puma" 0 "Killing rails server"
rlRun "pkill ruby" 0 "Killing rails server"
rlPhaseEnd
rlPhaseStartCleanup