Merge lp:~dave-cheney/charms/precise/wordpress/trunk into lp:charms/wordpress

Proposed by Dave Cheney
Status: Merged
Merged at revision: 69
Proposed branch: lp:~dave-cheney/charms/precise/wordpress/trunk
Merge into: lp:charms/wordpress
Diff against target: 34 lines (+11/-7)
1 file modified
hooks/install (+11/-7)
To merge this branch: bzr merge lp:~dave-cheney/charms/precise/wordpress/trunk
Reviewer Review Type Date Requested Status
Marco Ceppi (community) Approve
Review via email: mp+184243@code.launchpad.net

Description of the change

Fixes lp # 1064846

To post a comment you must log in.
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

This looks great, though you've removed the save_pwd bits, which is fine, but the hook needs to cd back to $CHARM_DIR or other hooks will fail when they call hooks/install inline. If you could add the cd back to $CHARM_DIR at the bottom of the hooks/install then I can merge this.

review: Needs Fixing
Revision history for this message
Dave Cheney (dave-cheney) wrote :

Ok, I'll fix that with pushd / popd.

On 06/09/2013, at 21:59, Marco Ceppi <email address hidden> wrote:

> Review: Needs Fixing
>
> This looks great, though you've removed the save_pwd bits, which is fine, but the hook needs to cd back to $CHARM_DIR or other hooks will fail when they call hooks/install inline. If you could add the cd back to $CHARM_DIR at the bottom of the hooks/install then I can merge this.
> --
> https://code.launchpad.net/~dave-cheney/charms/precise/wordpress/trunk/+merge/184243
> You are the owner of lp:~dave-cheney/charms/precise/wordpress/trunk.

69. By Dave Cheney

responding to review feedback

Revision history for this message
Dave Cheney (dave-cheney) wrote :

ping

Revision history for this message
Dave Cheney (dave-cheney) wrote :

ping

Revision history for this message
Marco Ceppi (marcoceppi) wrote :

LGTM, Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/install'
2--- hooks/install 2012-12-13 17:13:17 +0000
3+++ hooks/install 2013-09-09 05:54:25 +0000
4@@ -1,5 +1,7 @@
5 #!/bin/bash
6
7+set -xe
8+
9 add-apt-repository ppa:charmers/charm-helpers
10 apt-get update && apt-get -y upgrade
11
12@@ -35,13 +37,15 @@
13 fi
14
15 juju-log "Installing wp-cli to make this charm's life a little easier ..."
16-save_pwd=`pwd`
17 git clone https://github.com/wp-cli/wp-cli.git /usr/src/wp-cli
18-cd /usr/src/wp-cli
19-# 20120926: v0.6.0 is confirmed working, so use it rather than alpha.
20-git reset --hard v0.6.0
21-git submodule update --init
22-utils/dev-build
23-cd $save_pwd
24+# other hooks call hooks/install and don't expect the CWD to change so
25+# run this section in a subshell
26+(
27+ cd /usr/src/wp-cli
28+ # 20120926: v0.6.0 is confirmed working, so use it rather than alpha.
29+ git reset --hard v0.6.0
30+ git submodule update --init
31+ utils/dev-build
32+)
33
34 juju-log "So, environment is setup. We'll wait for some hooks to fire off before we get all crazy"

Subscribers

People subscribed via source and target branches

to all changes: