Merge lp:~hatch/charms/precise/ghost/trunk into lp:charms/ghost

Proposed by Jeff Pihach on 2015-04-03
Status: Merged
Merged at revision: 7
Proposed branch: lp:~hatch/charms/precise/ghost/trunk
Merge into: lp:charms/ghost
Diff against target: 80 lines (+13/-32)
3 files modified
config.yaml (+5/-0)
hooks/database-relation-changed (+0/-30)
hooks/install (+8/-2)
To merge this branch: bzr merge lp:~hatch/charms/precise/ghost/trunk
Reviewer Review Type Date Requested Status
Whit Morriss (community) Approve on 2015-04-16
charmers 2015-04-03 Pending
Review via email: mp+255168@code.launchpad.net

Description of the change

Removes the included Ghost asset in favour of a remote release link because Ghost updates so often that it gets out of date very fast.

To post a comment you must log in.
Whit Morriss (whitmo) wrote :

LGTM +1. Merged cleanly, deployed fine w/ mysql, comes up with default empty blog content.

Jeff thanks for this update, it's a much better way of tracking the current releases.

-w

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'assets/Ghost-0.5.5.zip'
2Binary files assets/Ghost-0.5.5.zip 2014-11-27 04:04:09 +0000 and assets/Ghost-0.5.5.zip 1970-01-01 00:00:00 +0000 differ
3=== modified file 'config.yaml'
4--- config.yaml 2014-11-27 04:04:09 +0000
5+++ config.yaml 2015-04-03 04:11:24 +0000
6@@ -11,6 +11,11 @@
7 description: Port to be passed to node's net.Server listen().
8 type: int
9 default: 2368
10+ release_location:
11+ description: |
12+ Location of the Ghost blogging platform release archive to deploy.
13+ type: string
14+ default: https://github.com/TryGhost/Ghost/releases/download/0.5.10/Ghost-0.5.10.zip
15 mail_service:
16 description: |
17 Pick one of the supported email services to allow Ghost to send emails
18
19=== removed file 'hooks/database-relation-changed'
20--- hooks/database-relation-changed 2013-11-26 03:43:17 +0000
21+++ hooks/database-relation-changed 1970-01-01 00:00:00 +0000
22@@ -1,30 +0,0 @@
23-#!/usr/bin/env node
24-
25-var utils = require('../utils/utils'),
26- dbutils = require('../utils/dbutils'),
27- exec = require('child_process').exec;
28-// create the mysql switch so config-changed knows to leave db config alone.
29-exec('touch mysql');
30-exec('relation-get --format=json', dbutils.configureMysql);
31-
32-/*
33- Setup the mysql db config file.
34-
35- @method configureMysql
36- @param {Object} err Exec function error
37- @param {Object} config The json config data
38-*/
39-function configureMysql(err, config) {
40- config = JSON.parse(config);
41- var required_keys = ['user', 'database', 'password', 'private-address'];
42- required_keys.map(function(key) {
43- if(!(key in config)) {
44- // We don't have the keys we need, exit silently by convention.
45- exec('juju-log DB Relation doesn\'t provide required keys.', noop);
46- return;
47- }
48- });
49- utils.renderTemplate(config, 'mysql.js.template', 'dbconfig.js');
50-};
51-
52-exec('relation-get --format=json', configureMysql);
53
54=== modified file 'hooks/install'
55--- hooks/install 2014-11-27 04:04:09 +0000
56+++ hooks/install 2015-04-03 04:11:24 +0000
57@@ -3,7 +3,10 @@
58 set -e
59
60 juju-log "Adding Node PPA."
61-add-apt-repository ppa:chris-lea/node.js -y
62+wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
63+
64+echo "deb https://deb.nodesource.com/node $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/nodesource.list
65+echo "deb-src https://deb.nodesource.com/node $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list
66
67 juju-log "Updating APT."
68 apt-get update
69@@ -17,7 +20,10 @@
70 chmod 644 /etc/init/ghost.conf
71 # Unzip and move to it's proper location
72 mkdir -p /var/www/ghost
73-unzip -uo assets/Ghost-0.5.5.zip -d /var/www/ghost
74+LOCATION=$(config-get release_location)
75+juju-log "Fetching Ghost from location: ${LOCATION}"
76+wget -O /tmp/ghost.zip ${LOCATION}
77+unzip -uo /tmp/ghost.zip -d /var/www/ghost
78
79 cd /var/www/ghost
80 npm install --production

Subscribers

People subscribed via source and target branches

to all changes: