Merge lp:~teknico/charms/precise/discourse/add-cheetah-pkg-misc-fixes into lp:~marcoceppi/charms/precise/discourse/trunk

Proposed by Nicola Larosa
Status: Needs review
Proposed branch: lp:~teknico/charms/precise/discourse/add-cheetah-pkg-misc-fixes
Merge into: lp:~marcoceppi/charms/precise/discourse/trunk
Diff against target: 111 lines (+12/-11)
6 files modified
README.md (+1/-1)
contrib/nginx/discourse (+1/-1)
hooks/db-relation-changed (+2/-2)
hooks/install (+4/-4)
hooks/upgrade-charm (+3/-2)
revision (+1/-1)
To merge this branch: bzr merge lp:~teknico/charms/precise/discourse/add-cheetah-pkg-misc-fixes
Reviewer Review Type Date Requested Status
Marco Ceppi Pending
Review via email: mp+174248@code.launchpad.net

Description of the change

1) Add the python-cheetah package to the packages installed by the install hook.

2) Fix removal of existing conf file in the install hook.

3) Misc. fixes to typos in comments and strings.

Note: this incorporates and improves the fix proposed in the lp:~george-edison55/charms/precise/discourse/trunk branch (point #2 above).

To post a comment you must log in.

Unmerged revisions

47. By Nicola Larosa

Add the python-cheetah package to the installed ones in hooks/install, and fix typos in code and comments.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'README.md'
--- README.md 2013-05-29 23:47:47 +0000
+++ README.md 2013-07-11 16:56:24 +0000
@@ -74,7 +74,7 @@
74is pointed at the latest version of Discourse.74is pointed at the latest version of Discourse.
7575
76For production deployments of Discourse it's recommended you change this version76For production deployments of Discourse it's recommended you change this version
77either during deployment or shortly after to the corrosponding [release](https://github.com/discourse/discourse/tags)77either during deployment or shortly after to the corresponding [release](https://github.com/discourse/discourse/tags)
78of Discourse you deployed. Doing so will ensure that during scale-out you'll78of Discourse you deployed. Doing so will ensure that during scale-out you'll
79maintain the same version of Discourse between units. Failure to do so may79maintain the same version of Discourse between units. Failure to do so may
80result in broken behavior due to version inconsistency between units.80result in broken behavior due to version inconsistency between units.
8181
=== modified file 'contrib/nginx/discourse'
--- contrib/nginx/discourse 2013-05-29 23:29:41 +0000
+++ contrib/nginx/discourse 2013-07-11 16:56:24 +0000
@@ -44,7 +44,7 @@
44 proxy_set_header Host $http_host;44 proxy_set_header Host $http_host;
4545
46 # If the file exists as a static file serve it directly without46 # If the file exists as a static file serve it directly without
47 # running all the other rewite tests on it47 # running all the other rewrite tests on it.
48 # Brandon would have a fit if he saw these if statements. You apparently48 # Brandon would have a fit if he saw these if statements. You apparently
49 # don't use if statements in nginx. Should replaces these with try_files49 # don't use if statements in nginx. Should replaces these with try_files
50 if (-f $request_filename) {50 if (-f $request_filename) {
5151
=== modified file 'hooks/db-relation-changed'
--- hooks/db-relation-changed 2013-05-30 00:25:57 +0000
+++ hooks/db-relation-changed 2013-07-11 16:56:24 +0000
@@ -21,7 +21,7 @@
21fi21fi
2222
23cat > /home/discourse/discourse/config/database.yml <<EOF23cat > /home/discourse/discourse/config/database.yml <<EOF
24# This file was generated by Juju DON'T EDIT IT!24# This file was generated by Juju. DON'T EDIT IT!
25production:25production:
26 adapter: postgresql26 adapter: postgresql
27 database: $database27 database: $database
@@ -39,7 +39,7 @@
3939
40if [ ! -f ".psql" ]; then40if [ ! -f ".psql" ]; then
41 cat > .psql <<EOF41 cat > .psql <<EOF
42# This file was generated by Juju!42# This file was generated by Juju. DON'T EDIT IT!
43db_host=$host43db_host=$host
44db_port=$port44db_port=$port
45db_user=$user45db_user=$user
4646
=== modified file 'hooks/install'
--- hooks/install 2013-05-30 01:56:08 +0000
+++ hooks/install 2013-07-11 16:56:24 +0000
@@ -9,7 +9,7 @@
99
10apt-get install -qy ruby1.9.3 git-core build-essential libxml2-dev \10apt-get install -qy ruby1.9.3 git-core build-essential libxml2-dev \
11 libxslt1-dev libpq-dev nginx redis-server postgresql-client-common \11 libxslt1-dev libpq-dev nginx redis-server postgresql-client-common \
12 postgresql-client-9.1 sendmail libtcmalloc-minimal012 postgresql-client-9.1 sendmail libtcmalloc-minimal0 python-cheetah
1313
14export LANG=en_US.UTF-814export LANG=en_US.UTF-8
15export LC_ALL=en_US.UTF-815export LC_ALL=en_US.UTF-8
@@ -27,7 +27,7 @@
27 adduser --disabled-password --gecos 'Discourse' discourse27 adduser --disabled-password --gecos 'Discourse' discourse
28fi28fi
2929
30# Discourse should probably use gunicon. gunicorn is cool.30# Discourse should probably use gunicorn. gunicorn is cool.
31juju-log "Placing nginx configuration files"31juju-log "Placing nginx configuration files"
32rsync -az contrib/nginx/ /etc/nginx/sites-available/32rsync -az contrib/nginx/ /etc/nginx/sites-available/
33rm -f /etc/nginx/sites-enabled/default33rm -f /etc/nginx/sites-enabled/default
@@ -108,9 +108,9 @@
108 echo "$token" > $CHARM_DIR/.secret_token108 echo "$token" > $CHARM_DIR/.secret_token
109fi109fi
110110
111if [ -f "/etc/init/discoruse.conf" ]; then111if [ -f "/etc/init/discourse.conf" ]; then
112 juju-log "Replacing old discourse upstart"112 juju-log "Replacing old discourse upstart"
113 rm -f /etc/init/discoruse.conf113 rm -f /etc/init/discourse.conf
114fi114fi
115115
116. $CHARM_DIR/lib/file.bash116. $CHARM_DIR/lib/file.bash
117117
=== modified file 'hooks/upgrade-charm'
--- hooks/upgrade-charm 2013-05-28 22:33:22 +0000
+++ hooks/upgrade-charm 2013-07-11 16:56:24 +0000
@@ -4,7 +4,7 @@
4repository=`config-get repository`4repository=`config-get repository`
55
6if [ "$current_repository" != "$repository" ]; then6if [ "$current_repository" != "$repository" ]; then
7 # Yikes, they want to really blow this up. Lets try a live migration!7 # Yikes, they want to really blow this up. Let's try a live migration!
8 # Move installation out of the way, so we can re-do the whole setup thing.8 # Move installation out of the way, so we can re-do the whole setup thing.
9 mv /home/discourse/discourse /home/discourse/.backup/$(date "+%Y%m%d-%H%M")9 mv /home/discourse/discourse /home/discourse/.backup/$(date "+%Y%m%d-%H%M")
10 touch $charm_dir/.migrate10 touch $charm_dir/.migrate
@@ -20,7 +20,8 @@
20 if [ -f "$charm_dir/.database.yml.bak" ]; then20 if [ -f "$charm_dir/.database.yml.bak" ]; then
21 cat $charm_dir/.database.yml.bak > config/database.yml21 cat $charm_dir/.database.yml.bak > config/database.yml
22 elif [ -f "config/database.yml" ] && [ ! -f "$charm_dir/.database.yml.bak" ]; then22 elif [ -f "config/database.yml" ] && [ ! -f "$charm_dir/.database.yml.bak" ]; then
23 # For backwards compatibility. Remove and favor running relation hook again when bug is fixed in juju-core23 # For backwards compatibility. Remove and favor running relation hook again
24 # when bug is fixed in juju-core.
24 cp config/database.yml $charm_dir/.database.yml.bak25 cp config/database.yml $charm_dir/.database.yml.bak
25 fi26 fi
2627
2728
=== modified file 'revision'
--- revision 2013-02-08 18:06:56 +0000
+++ revision 2013-07-11 16:56:24 +0000
@@ -1,1 +1,1 @@
1314

Subscribers

People subscribed via source and target branches

to all changes: