[Git][noosfero/noosfero][master] 4 commits: Noosfero::VERSION: avoid git warning on shallow clones

Antonio Terceiro gitlab at mg.gitlab.com
Wed Dec 9 18:49:13 BRST 2015


Antonio Terceiro pushed to branch master at Noosfero / noosfero


Commits:
71178d9a by Antonio Terceiro at 2015-12-09T18:48:24Z
Noosfero::VERSION: avoid git warning on shallow clones

`git describe` will not be able to describe the HEAD commit in shallow
clones, which will most probably not contain any tags.

- - - - -
b867d614 by Antonio Terceiro at 2015-12-09T18:48:24Z
script/vagrant: extract APT proxy setup

- - - - -
2ea43bfd by Antonio Terceiro at 2015-12-09T18:48:24Z
Add Dockerfile to build Debian Jessie CI image

- - - - -
13eeb12b by Antonio Terceiro at 2015-12-09T18:48:24Z
.gitlab-ci.yml: use published docker image

- - - - -


5 changed files:

- .gitlab-ci.yml
- + config/docker/ci/Dockerfile
- lib/noosfero/version.rb
- + script/set-apt-proxy
- script/vagrant


Changes:

=====================================
.gitlab-ci.yml
=====================================
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,15 +1,8 @@
+image: noosfero/ci
+
 before_script:
-  - mkdir -p tmp/{pids,cache} log
-  - bundle check || bundle install
-# workaround for plugins with Gemfile
-  - perl -pi -e 's/--local //' script/noosfero-plugins
-  - script/noosfero-plugins disableall
-  - bundle exec rake makemo &>/dev/null
-# database
-  - cp config/database.yml.gitlab-ci config/database.yml
-  - createdb gitlab_ci_test || true
-  - bundle exec rake db:schema:load &>/dev/null
-  - bundle exec rake db:migrate &>/dev/null
+  - mkdir -p locale # makes quick-start skip compiling translations
+  - ./script/silent-quick-start
 
 units:
   script: bundle exec rake test:units


=====================================
config/docker/ci/Dockerfile
=====================================
--- /dev/null
+++ b/config/docker/ci/Dockerfile
@@ -0,0 +1,10 @@
+FROM debian:jessie
+MAINTAINER Noosfero Development Team <noosfero-dev at listas.softwarelivre.org>
+
+RUN apt-get update && apt-get install -y sudo git
+RUN git clone --depth 1 https://gitlab.com/noosfero/noosfero.git /var/tmp/noosfero
+RUN cd /var/tmp/noosfero && ./script/set-apt-proxy
+RUN cd /var/tmp/noosfero && ./script/quick-start
+RUN rm -rf /var/tmp/noosfero
+RUN apt-get clean
+RUN rm -f /etc/apt/apt.conf.d/01proxy


=====================================
lib/noosfero/version.rb
=====================================
--- a/lib/noosfero/version.rb
+++ b/lib/noosfero/version.rb
@@ -5,14 +5,16 @@ end
 
 root = File.expand_path(File.dirname(__FILE__) + '/../..')
 if File.exist?(File.join(root, '.git')) && system('which git >/dev/null')
-  git_version = Dir.chdir(root) { `git describe --tags`.to_s.strip.sub('-rc', '~rc') }
-  version_sort = IO.popen(['sort', '--version-sort'], 'w+')
-  version_sort.puts(Noosfero::VERSION)
-  version_sort.puts(git_version)
-  version_sort.close_write
-  new_version = version_sort.readlines.last.strip
-  if new_version != Noosfero::VERSION
-    Noosfero::VERSION.clear << git_version
+  git_version = Dir.chdir(root) { `git describe --tags 2>/dev/null`.to_s.strip.sub('-rc', '~rc') }
+  if git_version != ''
+    version_sort = IO.popen(['sort', '--version-sort'], 'w+')
+    version_sort.puts(Noosfero::VERSION)
+    version_sort.puts(git_version)
+    version_sort.close_write
+    new_version = version_sort.readlines.last.strip
+    if new_version != Noosfero::VERSION
+      Noosfero::VERSION.clear << git_version
+    end
+    version_sort.close
   end
-  version_sort.close
 end


=====================================
script/set-apt-proxy
=====================================
--- /dev/null
+++ b/script/set-apt-proxy
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+sudo apt-get install -qy netcat-traditional
+
+# apt-cacher-ng running on the host
+# 10.0.2.2 = host ip on virtualbox/qemu
+# 192.168..122.1 = host ip on default libvirt bridge
+# 172.17.42.1 = host ip on default docker bridge
+for ip in 10.0.2.2 192.168.122.1 172.17.42.1; do
+  if nc -z -w 1 $ip 3142; then
+    echo "Acquire::http::Proxy \"http://$ip:3142\";" | sudo tee /etc/apt/apt.conf.d/01proxy
+  fi
+done


=====================================
script/vagrant
=====================================
--- a/script/vagrant
+++ b/script/vagrant
@@ -1,16 +1,9 @@
 #!/bin/sh
 
 set -e
-sudo apt-get install netcat-traditional
 
-# apt-cacher-ng running on the host
-# 10.0.2.2 = host ip on virtualbox/qemu
-# 192.168..122.1 = host ip on default libvirt bridge
-for ip in 10.0.2.2 192.168.122.1; do
-  if nc -z -w 1 $ip 3142; then
-    echo "Acquire::http::Proxy \"http://$ip:3142\";" | sudo tee /etc/apt/apt.conf.d/01proxy
-  fi
-done
+cd /vagrant
+./script/set-apt-proxy
 
 sudo DEBIAN_FRONTEND=noninteractive apt-get install -qy postfix
 sudo postconf virtual_alias_maps=hash:/etc/postfix/virtual
@@ -20,5 +13,4 @@ EOF
 sudo postmap /etc/postfix/virtual
 sudo service postfix reload
 
-cd /vagrant
 ./script/quick-start



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/dbaa5364af92428ccbef9302985cf80312ea872d...13eeb12b6c9cc21c54ec77cdfa95576e9793f2fc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151209/809d6376/attachment-0001.html>


More information about the Noosfero-dev mailing list