git://git.onelab.eu
/
plstackapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
25b70fd
)
evolve during upgrade instead of initdb; dumpdata before upgrading
author
Scott Baker
<smbaker@gmail.com>
Thu, 15 May 2014 21:21:31 +0000
(14:21 -0700)
committer
Scott Baker
<smbaker@gmail.com>
Thu, 15 May 2014 21:21:31 +0000
(14:21 -0700)
opencloud.spec
patch
|
blob
|
history
diff --git
a/opencloud.spec
b/opencloud.spec
index
54aa962
..
16f1b23
100644
(file)
--- a/
opencloud.spec
+++ b/
opencloud.spec
@@
-1,7
+1,7
@@
Summary: OpenCloud core services
Name: opencloud
Version: 1.0.10
Summary: OpenCloud core services
Name: opencloud
Version: 1.0.10
-Release:
1
+Release:
2
License: GPL+
Group: Development/Tools
Source0: %{_tmppath}/%{name}-%{version}.tar.gz
License: GPL+
Group: Development/Tools
Source0: %{_tmppath}/%{name}-%{version}.tar.gz
@@
-75,12
+75,26
@@
rm -rf %{buildroot}
%files -f %{_tmppath}/tmp-filelist
%defattr(-,root,root,-)
%files -f %{_tmppath}/tmp-filelist
%defattr(-,root,root,-)
+%pre
+if [ "$1" == 2 ] ; then
+ echo "UPGRADE - saving current state"
+ /opt/planetstack/scripts/opencloud dumpdata
+fi
+
%post
%post
-/opt/planetstack/scripts/opencloud initdb
+if [ "$1" == 1 ] ; then
+ echo "NEW INSTALL - initializing database"
+ /opt/planetstack/scripts/opencloud initdb
+else
+ echo "UPGRADE - doing evolution"
+ /opt/planetstack/scripts/opencloud evolvedb
+fi
+# start the server
+/opt/planetstack/scripts/opencloud runserver
%preun
if [ "$1" = 0 ] ; then
%preun
if [ "$1" = 0 ] ; then
- echo "
doing preuninstall
"
+ echo "
UNINSTALL - destroying planetstack
"
rm -rf /opt/planetstack
fi
rm -rf /opt/planetstack
fi