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

Proposed by Jeff Pihach
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
charmers 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.
Revision history for this message
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
=== removed file 'assets/Ghost-0.5.5.zip'
0Binary 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 differ0Binary 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
=== modified file 'config.yaml'
--- config.yaml 2014-11-27 04:04:09 +0000
+++ config.yaml 2015-04-03 04:11:24 +0000
@@ -11,6 +11,11 @@
11 description: Port to be passed to node's net.Server listen().11 description: Port to be passed to node's net.Server listen().
12 type: int12 type: int
13 default: 236813 default: 2368
14 release_location:
15 description: |
16 Location of the Ghost blogging platform release archive to deploy.
17 type: string
18 default: https://github.com/TryGhost/Ghost/releases/download/0.5.10/Ghost-0.5.10.zip
14 mail_service:19 mail_service:
15 description: |20 description: |
16 Pick one of the supported email services to allow Ghost to send emails21 Pick one of the supported email services to allow Ghost to send emails
1722
=== removed file 'hooks/database-relation-changed'
--- hooks/database-relation-changed 2013-11-26 03:43:17 +0000
+++ hooks/database-relation-changed 1970-01-01 00:00:00 +0000
@@ -1,30 +0,0 @@
1#!/usr/bin/env node
2
3var utils = require('../utils/utils'),
4 dbutils = require('../utils/dbutils'),
5 exec = require('child_process').exec;
6// create the mysql switch so config-changed knows to leave db config alone.
7exec('touch mysql');
8exec('relation-get --format=json', dbutils.configureMysql);
9
10/*
11 Setup the mysql db config file.
12
13 @method configureMysql
14 @param {Object} err Exec function error
15 @param {Object} config The json config data
16*/
17function configureMysql(err, config) {
18 config = JSON.parse(config);
19 var required_keys = ['user', 'database', 'password', 'private-address'];
20 required_keys.map(function(key) {
21 if(!(key in config)) {
22 // We don't have the keys we need, exit silently by convention.
23 exec('juju-log DB Relation doesn\'t provide required keys.', noop);
24 return;
25 }
26 });
27 utils.renderTemplate(config, 'mysql.js.template', 'dbconfig.js');
28};
29
30exec('relation-get --format=json', configureMysql);
310
=== modified file 'hooks/install'
--- hooks/install 2014-11-27 04:04:09 +0000
+++ hooks/install 2015-04-03 04:11:24 +0000
@@ -3,7 +3,10 @@
3set -e3set -e
44
5juju-log "Adding Node PPA."5juju-log "Adding Node PPA."
6add-apt-repository ppa:chris-lea/node.js -y6wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
7
8echo "deb https://deb.nodesource.com/node $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/nodesource.list
9echo "deb-src https://deb.nodesource.com/node $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list
710
8juju-log "Updating APT."11juju-log "Updating APT."
9apt-get update12apt-get update
@@ -17,7 +20,10 @@
17chmod 644 /etc/init/ghost.conf20chmod 644 /etc/init/ghost.conf
18# Unzip and move to it's proper location21# Unzip and move to it's proper location
19mkdir -p /var/www/ghost22mkdir -p /var/www/ghost
20unzip -uo assets/Ghost-0.5.5.zip -d /var/www/ghost23LOCATION=$(config-get release_location)
24juju-log "Fetching Ghost from location: ${LOCATION}"
25wget -O /tmp/ghost.zip ${LOCATION}
26unzip -uo /tmp/ghost.zip -d /var/www/ghost
2127
22cd /var/www/ghost28cd /var/www/ghost
23npm install --production29npm install --production

Subscribers

People subscribed via source and target branches

to all changes: