Merge lp:~jose/charms/precise/owncloud/update-version into lp:charms/owncloud

Proposed by José Antonio Rey on 2014-04-08
Status: Merged
Merged at revision: 24
Proposed branch: lp:~jose/charms/precise/owncloud/update-version
Merge into: lp:charms/owncloud
Diff against target: 135 lines (+56/-18)
3 files modified
README.md (+17/-4)
hooks/install (+3/-3)
hooks/upgrade-charm (+36/-11)
To merge this branch: bzr merge lp:~jose/charms/precise/owncloud/update-version
Reviewer Review Type Date Requested Status
Charles Butler (community) 2014-04-08 Approve on 2014-04-11
charmers 2014-04-10 Pending
Review via email: mp+214649@code.launchpad.net

Commit message

Updated owncloud version it pulls

Description of the change

Updated owncloud version it pulls

To post a comment you must log in.
Charles Butler (lazypower) wrote :

Greetings Jose,

Thanks a million for this submission! This is right on time with the U1 service closure, and a great addition to the charm store since its such a major version upgrade.

I'm going to ask that you document the behavior when deploying, and migrating an existing deployment to scale out usage with MySQL, that the file structure in the database is not preserved so users know its single host or multi-host from the git go until a patch is released to fix this behavior.

Otherwise, everything else is great. It passes all my tests.

Thanks for this submission! once the readme update is applied I'll merge this into the charmstore.

25. By José Antonio Rey on 2014-04-08

Added note on README

José Antonio Rey (jose) wrote :

All ready!

Charles Butler (lazypower) wrote :

Hello again Jose,

Prior to merging I wrote this review while I was still actively reviewing a few fringe cases I had not thought of. I did not upgrade from a 4.x to 6.x release, which is an important factor. Presently this will break owncloud for users that have existing deployments.

The upgrade-charm hook has some syntax errors on the find command, -exec blocks need to be terminated with an escaped semicolon like so:

 # Excise old installation data
 find /var/www -mindepth 2 -maxdepth 2 -type d -name 'data'\
  -exec mv {} /var/tmp/ \;

and it should be idempotent. If the upgrade hook fails, and is re run in its current state it will wipe out the backed up data. Since you didn't write this hook I spent a few cycles working over the hook and have some proposed changes, but its not 100%, as the deployment will still break the application in unknown ways.

http://paste.ubuntu.com/7220050/

Could you spend some time looking at upgrading the upgrade-charm hooks as well? This is an area that we need to pay extra special attention to as data integrity of existing deployments must be upheld. Thanks in advance for any cycles you can put into this. If it proves to be too difficult, let me know and i'll build off of the work you have here and attempt the upgrade.

I'm going to mark the review as needs work. When you are ready for another review be sure to click the request another review button and assign charmers. Someone will be along shortly to review your work.

If you have any questions, comments, concerns join us in #juju on irc.freenode.net and/or email the mailing list at <email address hidden>

Thanks again for all the diligent work!

review: Needs Fixing
26. By José Antonio Rey on 2014-04-10

Fixed various upgrade-charm bugs

José Antonio Rey (jose) wrote :

Hello,

The charm now upgrades fine from the current version in Juju.

The only problem presented is that apps do not migrate with the instance, but have to be activated manually.

Charles Butler (lazypower) wrote :

Greetings Jose,

Thanks again for your dedication in upgrading the OwnCloud charm. I'm happy to say every upgrade I've tried with this has resulted in a success.

I'm going to +1 this for now, and ask another reviewer take another look in the morning as its pretty late for me. This should go quickly and have your changes acked into the store in no time if no issues are found.

Thanks for being a champion of this effort and producing a great patch to update OwnCloud!

If you have any questions, comments, concerns join us in #juju on irc.freenode.net and/or email the mailing list at <email address hidden>

Thanks again for all the diligent work!

27. By José Antonio Rey on 2014-04-11

Hardcoded 6.0.2 instead of latest because of bug on -latest md5 hash provided by ownCloud

28. By José Antonio Rey on 2014-04-11

Removed version number from install as it may vary

José Antonio Rey (jose) wrote :

Hello!

Let me explain those last two revisions:

 * (rev 27) I basically hardcoded -latest into -6.0.2. This is something temporary, because the MD5 hash provided by the ownCloud community for the -latest bzip file is not up to date. Once it is, we should be able to change it back to -latest. At this moment, -latest is the same as -6.0.2, so no problems should be found.

 * (rev 28) This is a trivial change, as the install hook mentioned a 4.x version instead of just saying 'Downloading and validating', which is not up to date (even on the current charm on the charm store). Shouldn't affect the performance of the charm at all.

Charles Butler (lazypower) wrote :

Jose,

I have merged your changes into the charm store! Thank you so much for this submission, your dedication, and dilligence in creating an improved owncloud experience for our users. This is a welcome addition to the charm store, and again, we thank you!

If you have any questions, comments, concerns join us in #juju on irc.freenode.net and/or email the mailing list at <email address hidden>

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'README.md'
--- README.md 2014-04-03 15:21:21 +0000
+++ README.md 2014-04-11 03:48:25 +0000
@@ -5,9 +5,14 @@
55
6# Overview6# Overview
77
8ownCloud provides universal access to your files via the web, your computer or your mobile devices — wherever you are. It also provides a platform to easily view & sync your contacts, calendars and bookmarks across all your devices and enables basic editing right on the web.8ownCloud provides universal access to your files via the web, your computer or
9your mobile devices — wherever you are. It also provides a platform to easily
10view & sync your contacts, calendars and bookmarks across all your devices and
11enables basic editing right on the web.
912
10This charm installs Apache2, Apache-Mod-PHP5, and configures OwnCloud with sqlite as a standalone server. Provides relationship hooks with NFS file storage, MySQL Databases, and HAProxy reverse proxy charms. 13This charm installs Apache2, Apache-Mod-PHP5, and configures OwnCloud with
14sqlite as a standalone server. Provides relationship hooks with NFS file
15storage, MySQL Databases, and HAProxy reverse proxy charms.
1116
12## Preparation:17## Preparation:
1318
@@ -31,7 +36,8 @@
3136
32#### 3a. Standalone Instance37#### 3a. Standalone Instance
3338
34 Access owncloud service directly, and complete the setup, providing user credentials and initializing sqlite database.39 Access C service directly, and complete the setup, providing user
40 credentials and initializing sqlite database.
3541
36#### 3b. Shared Instances42#### 3b. Shared Instances
3743
@@ -43,7 +49,7 @@
4349
44#### 4. Access 50#### 4. Access
4551
46http://$owncloud-machine-addr/. To find out the public address of owncloud,52http://$owncloud-machine-addr/. To find out the public address of ownCloud,
47look for it in the output of the `juju status` command.53look for it in the output of the `juju status` command.
4854
4955
@@ -58,5 +64,12 @@
58 juju add-unit owncloud64 juju add-unit owncloud
5965
6066
67## Known Limitations
68
69If you have been using a standalone instance and want to migrate to a shared
70instance, please note that adding the mysql relation will not preserve the file
71structure in the database. This means that your file listing will not be
72available. Make sure to have this in mind when doing the migration.
73
61#TODO74#TODO
62Genericize shared-fs-relation-* for non-nfs shared-fs providers75Genericize shared-fs-relation-* for non-nfs shared-fs providers
6376
=== modified file 'hooks/install'
--- hooks/install 2013-10-22 00:40:09 +0000
+++ hooks/install 2014-04-11 03:48:25 +0000
@@ -10,12 +10,12 @@
10 php5-gd php5-mysql php5-sqlite curl libcurl3 \10 php5-gd php5-mysql php5-sqlite curl libcurl3 \
11 php5-curl rpcbind nfs-common11 php5-curl rpcbind nfs-common
1212
13juju-log "Downloading and validating ownCloud 4.5"13juju-log "Downloading and validating ownCloud"
14# Load charm helper and download owncloud14# Load charm helper and download owncloud
15. /usr/share/charm-helper/sh/net.sh15. /usr/share/charm-helper/sh/net.sh
16LURL="http://download.owncloud.org/community/owncloud-5.0.12.tar.bz2"16LURL="http://download.owncloud.org/community/owncloud-6.0.2.tar.bz2"
1717
18LHASH="b1aafcba4823c011b19b60353394d81455e2b3e9c169d4e444b27c740695ed7a"18LHASH="a5a194ad07fca7cbf158b660cc098c6364590bdd15d086069221faf4386b713f"
19source_file=`ch_get_file $LURL $LHASH`19source_file=`ch_get_file $LURL $LHASH`
2020
21juju-log "Downloaded"21juju-log "Downloaded"
2222
=== modified file 'hooks/upgrade-charm'
--- hooks/upgrade-charm 2012-07-21 16:31:08 +0000
+++ hooks/upgrade-charm 2014-04-11 03:48:25 +0000
@@ -1,22 +1,47 @@
1#!/bin/bash1#!/bin/bash
2set -e2set -ex
33
4juju-log "Upgrading ownCloud"4juju-log "Upgrading ownCloud"
5# Pause during upgrade5# Pause during upgrade
6hooks/stop6hooks/stop
77
8# Excise old installation data8#we are under active migration, dont do anything more than once
9find /var/www -mindepth 2 -maxdepth 2 -type d -name 'data'\9if [ ! -f $CHARM_DIR/.migrating ]; then
10 -exec mv {} /var/tmp/10
11find /var/www -mindepth 2 -maxdepth 2 -type d -name 'config'\11 # Excise old installation data
12 -exec mv {} /var/tmp/12 find /var/www -mindepth 2 -maxdepth 2 -type d -name 'data'\
1313 -exec mv {} /var/tmp/ \;
14# Upgrade14 find /var/www -mindepth 2 -maxdepth 2 -type d -name 'config'\
15hooks/install15 -exec mv {} /var/tmp/ \;
1616 touch $CHARM_DIR/.migrating
17# Migrate data17
18fi
19
20# Deleting all traces of the old ownCloud install
21rm -rf /var/www/owncloud/
22cd /var/www/
23
24# Getting new ownCloud version and MD5 checking it
25wget download.owncloud.org/community/owncloud-6.0.2.tar.bz2
26wget download.owncloud.org/community/owncloud-6.0.2.tar.bz2.md5
27
28while [ `md5sum owncloud-6.0.2.tar.bz2 | awk '{print $1}'` != `cat owncloud-6.0.2.tar.bz2.md5 | awk '{print $1}'` ]; do
29 rm owncloud-6.0.2.tar.bz2
30 wget download.owncloud.org/community/owncloud-6.0.2.tar.bz2
31done
32
33tar xfj owncloud-6.0.2.tar.bz2
34cd $CHARM_DIR
35
36# Migrating data
37mkdir /var/www/owncloud/data
38rm -rf /var/www/owncloud/config
39mkdir /var/www/owncloud/config
18cp -pr /var/tmp/data/* /var/www/owncloud/data/40cp -pr /var/tmp/data/* /var/www/owncloud/data/
19cp -pr /var/tmp/config/* /var/www/owncloud/config/41cp -pr /var/tmp/config/* /var/www/owncloud/config/
42sudo chown -R www-data:www-data /var/www/owncloud
2043
21# Finish upgrade44# Finish upgrade
22hooks/config-changed45hooks/config-changed
46
47rm $CHARM_DIR/.migrating

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: