[Git][noosfero/noosfero][master] 5 commits: script/quick-start: wait for postgresql to start
Antonio Terceiro
gitlab at mg.gitlab.com
Tue Jan 5 16:16:29 BRST 2016
Antonio Terceiro pushed to branch master at Noosfero / noosfero
Commits:
cbb798cf by Antonio Terceiro at 2016-01-05T16:15:40Z
script/quick-start: wait for postgresql to start
Depending on the setup PostgreSQL might still be starting up when we get
to the first point where Rails will try connecting, and will fail with:
PG::ConnectionBad: FATAL: the database system is starting up
So we wait for PostgreSQL to be ready.
- - - - -
29486555 by Antonio Terceiro at 2016-01-05T16:15:40Z
ci:smoke: fail explicitly if git is not installed
- - - - -
54d52b81 by Antonio Terceiro at 2016-01-05T16:15:40Z
.gitlab-ci.yml: separate tests in stages
- - - - -
9f233c8b by Antonio Terceiro at 2016-01-05T16:15:40Z
.gitlab-ci.yml: set APT proxy
- - - - -
2c1471ae by Antonio Terceiro at 2016-01-05T16:15:40Z
group all non-smoke tests
- - - - -
3 changed files:
- .gitlab-ci.yml
- lib/tasks/ci.rake
- script/quick-start
Changes:
=====================================
.gitlab-ci.yml
=====================================
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,18 +2,37 @@ image: noosfero/ci
before_script:
- mkdir -p locale # makes quick-start skip compiling translations
+ - ./script/set-apt-proxy
- ./script/silent-quick-start
+stages:
+ - smoke-tests
+ - all-tests
+
+smoke:
+ script: bundle exec rake ci:smoke
+ stage: smoke-tests
+
units:
script: bundle exec rake test:units
+ stage: all-tests
+
functionals:
script: bundle exec rake test:functionals
+ stage: all-tests
+
integration:
script: bundle exec rake test:integration
+ stage: all-tests
+
cucumber:
script: bundle exec rake cucumber
+ stage: all-tests
+
selenium:
script: bundle exec rake selenium
+ stage: all-tests
+
plugins:
script: bundle exec rake test:noosfero_plugins
-
+ stage: all-tests
=====================================
lib/tasks/ci.rake
=====================================
--- a/lib/tasks/ci.rake
+++ b/lib/tasks/ci.rake
@@ -3,7 +3,12 @@ namespace :ci do
desc 'Continuous integration smoke test'
task :smoke do
- current_branch = `git rev-parse --abbrev-ref HEAD`.strip
+ current_branch = `git rev-parse --abbrev-ref HEAD`
+ if current_branch
+ current_branch.strip!
+ else
+ fail 'Could not determine current branch. Is git installed?'
+ end
from = ENV['PREV_HEAD'] || "origin/#{current_branch}"
if !system("git show-ref --verify --quiet refs/remotes/#{from}")
from = 'origin/master'
@@ -46,6 +51,7 @@ namespace :ci do
if tests.empty? && features.empty? && changed_plugins.empty?
puts "Could not figure out specific changes to be tested in isolation!"
+ puts "Assuming it's all good"
end
puts
=====================================
script/quick-start
=====================================
--- a/script/quick-start
+++ b/script/quick-start
@@ -96,6 +96,9 @@ fi
# Ensure database is running
sudo service postgresql start
+while ! sudo -u postgres psql < /dev/null >/dev/null 2>&1; do
+ sleep 5s
+done
if test -e config/database.yml && test "$force_install" = 'false'; then
say 'Not updating existent database.yml.'
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/bb680e0a5499382ea1f478cf04f44504cdbfd1af...2c1471aedb1c2a32af3ef3278e2896eade542332
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160105/878120c7/attachment.html>
More information about the Noosfero-dev
mailing list