Merge lp:~ce-infrastructure/capomastro/deploy-mojo-jumpstart into lp:~ubuntuone-hackers/capomastro/deploy

Proposed by Caio Begotti on 2014-12-19
Status: Merged
Approved by: Daniel Manrique on 2015-01-05
Approved revision: 44
Merged at revision: 41
Proposed branch: lp:~ce-infrastructure/capomastro/deploy-mojo-jumpstart
Merge into: lp:~ubuntuone-hackers/capomastro/deploy
Diff against target: 57 lines (+53/-0)
1 file modified
mojo.sh (+53/-0)
To merge this branch: bzr merge lp:~ce-infrastructure/capomastro/deploy-mojo-jumpstart
Reviewer Review Type Date Requested Status
Daniel Manrique 2014-12-19 Approve on 2015-01-05
Review via email: mp+245185@code.launchpad.net

Description of the change

Self-explanatory in case other people want to try Mojo with Capomastro's new spec :-)

I'm going to write a README file once the spec is accepted and merged so we can clean up the deploy branch and we'll only use this script with more documentation, no worries.

To post a comment you must log in.
42. By Caio Begotti on 2015-01-05

necessary to get the mojo spec processing the only external config template in the charm

43. By Caio Begotti on 2015-01-05

this doesnt matter much but okay...

Daniel Manrique (roadmr) wrote :

Looks OK to me, just two small comments but one is mostly a curiosity, the other may need fixing but is not mandatory (just confusing).

review: Needs Fixing
44. By Caio Begotti on 2015-01-05

oops

Caio Begotti (caio1982) wrote :

Oh, right! That sudo is indeed weird and IMHO it's a bug in how mojo commands run, because if I wrap it all with just one sudo to run the script the other mojo commands failed to me for no reason. Also, thanks for the spotting that typo :-)

Daniel Manrique (roadmr) wrote :

+1 then, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'mojo.sh'
2--- mojo.sh 1970-01-01 00:00:00 +0000
3+++ mojo.sh 2015-01-05 17:20:02 +0000
4@@ -0,0 +1,53 @@
5+#!/bin/bash
6+#
7+# caio.begotti@canonical.com
8+#
9+# in case you need to setup the host machine:
10+#
11+# sudo apt-add-repository --yes ppa:mojo-maintainers/ppa && sudo apt-get update
12+# sudo apt-get --yes install mojo juju-local
13+#
14+# juju init
15+# juju switch local
16+# juju bootstrap
17+
18+echo "
19+WARNING: this script is meant for testing mojo specs only,
20+ please do not use this for real production work
21+ as the script creates temporary unique LXC environments
22+ and it never cleans them up... you've been warned!
23+
24+ [press any key to continue]
25+ "
26+read
27+
28+# env vars are used for practical reasons only
29+# as mojo still have problems parsing them so
30+# you should stick with command line parameters
31+
32+export MOJO_TIMESTAMP=$(date +%s)
33+export MOJO_PROJECT=capomastro-${MOJO_TIMESTAMP}
34+export MOJO_WORKSPACE=capomastro-${MOJO_TIMESTAMP}
35+export MOJO_SERIES=trusty
36+export MOJO_STAGE=pes/mojo-pes-capomastro/devel
37+export MOJO_REPO=lp:~ce-infrastructure/canonical-mojo-specs/capomastro
38+
39+set -xev
40+
41+# not sure why it can't call sudo itself
42+sudo --preserve-env mojo project-new --series ${MOJO_SERIES} ${MOJO_PROJECT}
43+
44+# known bug with mojo
45+sudo chmod 755 /var/lib/lxc/${MOJO_PROJECT}.${MOJO_SERIES}
46+
47+# creates a temporary workspace for the repo
48+mojo workspace-new --series ${MOJO_SERIES} --project ${MOJO_PROJECT} --stage ${MOJO_STAGE} ${MOJO_REPO} ${MOJO_WORKSPACE}
49+
50+# prepare the secrets for local deployment
51+sudo mkdir -p /srv/mojo/LOCAL/${MOJO_PROJECT}/pes/mojo-pes-capomastro/devel/
52+sudo cp secrets /srv/mojo/LOCAL/${MOJO_PROJECT}/pes/mojo-pes-capomastro/devel/
53+
54+# will execute all phases listed inside the manifest file
55+mojo run --series ${MOJO_SERIES} --project ${MOJO_PROJECT} --stage ${MOJO_STAGE} ${MOJO_REPO} ${MOJO_WORKSPACE}
56+
57+exit 0

Subscribers

People subscribed via source and target branches