[Git][noosfero/noosfero][master] utils/debian-install: make it easy to change source

Antonio Terceiro gitlab at gitlab.com
Mon Jul 27 11:26:25 BRT 2015


Antonio Terceiro pushed to branch master at Noosfero / noosfero


Commits:
3d223846 by Antonio Terceiro at 2015-07-27T11:11:52Z
utils/debian-install: make it easy to change source

Use case: upgrade tests, as documented in README.md

- - - - -


3 changed files:

- util/debian-install/README.md
- util/debian-install/Vagrantfile
- util/debian-install/install


Changes:

=====================================
util/debian-install/README.md
=====================================
--- a/util/debian-install/README.md
+++ b/util/debian-install/README.md
@@ -20,3 +20,16 @@ $ vagrant halt
 $ vagrant destroy
 $ rm -f *.deb
 ```
+
+To test upgrades:
+
+```
+$ rm -f pkg/
+$ cd utils/debian-install/
+$ vagrant destroy
+$ rm -f *.deb
+$ REPOSITORY=wheezy vagrant up              # install current stable version
+$ cd ../../
+$ make noosfero:deb                         # build current packages
+$ REPOSITORY=wheezy-next vagrant provision  # upgrade
+```


=====================================
util/debian-install/Vagrantfile
=====================================
--- a/util/debian-install/Vagrantfile
+++ b/util/debian-install/Vagrantfile
@@ -28,6 +28,6 @@ end
 
 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
   config.vm.box = "debian-wheezy"
-  config.vm.provision :shell, path: 'install'
+  config.vm.provision :shell, path: 'install', args: [ENV['REPOSITORY']].compact
   config.vm.provision :shell, path: 'test'
 end


=====================================
util/debian-install/install
=====================================
--- a/util/debian-install/install
+++ b/util/debian-install/install
@@ -1,5 +1,12 @@
 #!/bin/sh
 
+DISTRO=wheezy
+REPOSITORY='wheezy-test'
+
+if [ -n "$1" ]; then
+  REPOSITORY="$1"
+fi
+
 set -e
 sudo apt-get install -qy netcat-traditional shunit2
 
@@ -57,11 +64,11 @@ FPQAoNmiMgP6zGF9rgOEWMEiFEryayrz
 EOF
 
 cat > /etc/apt/sources.list.d/noosfero.list <<EOF
-deb http://download.noosfero.org/debian/wheezy-test ./
-deb-src http://download.noosfero.org/debian/wheezy-test ./
+deb http://download.noosfero.org/debian/$REPOSITORY ./
+deb-src http://download.noosfero.org/debian/$REPOSITORY ./
 EOF
 
-sed -e 's/wheezy/&-backports/' \
+sed -e "s/$DISTRO/&-backports/" \
   /etc/apt/sources.list > /etc/apt/sources.list.d/backports.list
 
 export DEBIAN_FRONTEND=noninteractive



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/3d2238466423812a0e2050b29177f3d1f025f082
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150727/9493fab5/attachment.html>


More information about the Noosfero-dev mailing list