Merge lp:~marcoceppi/juju-core/prettyprint-code-formatting-fixes into lp:juju-core/docs

Proposed by Marco Ceppi
Status: Superseded
Proposed branch: lp:~marcoceppi/juju-core/prettyprint-code-formatting-fixes
Merge into: lp:juju-core/docs
Diff against target: 1664 lines (+464/-517)
18 files modified
htmldocs/charms-constraints.html (+39/-44)
htmldocs/charms-deploying.html (+1/-1)
htmldocs/charms-destroy.html (+29/-30)
htmldocs/charms-exposing.html (+37/-26)
htmldocs/charms-relations.html (+62/-66)
htmldocs/charms-scaling.html (+12/-10)
htmldocs/charms-service-groups.html (+11/-32)
htmldocs/charms-upgrading.html (+12/-5)
htmldocs/charms.html (+1/-8)
htmldocs/commands.html (+43/-41)
htmldocs/config-hpcloud.html (+32/-37)
htmldocs/config-maas.html (+17/-13)
htmldocs/config-openstack.html (+29/-28)
htmldocs/css/main.css (+11/-1)
htmldocs/getting-started.html (+66/-69)
htmldocs/glossary.html (+12/-13)
htmldocs/howto-node.html (+49/-91)
htmldocs/reference-constraints.html (+1/-2)
To merge this branch: bzr merge lp:~marcoceppi/juju-core/prettyprint-code-formatting-fixes
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+183333@code.launchpad.net

This proposal has been superseded by a proposal from 2013-08-31.

Description of the change

Formatting fixes for code blocks on a few pages

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'htmldocs/charms-constraints.html'
2--- htmldocs/charms-constraints.html 2013-08-30 17:22:50 +0000
3+++ htmldocs/charms-constraints.html 2013-08-31 16:07:11 +0000
4@@ -53,101 +53,95 @@
5
6 <section id="content" class="container-12">
7 <div class="grid-12 doc-container">
8- <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
9+ <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
10 <div class="grid-9 doc-content">
11 <article>
12 <section id ="charms-constraints">
13 <h1>Machine Constraints</h1>
14 <p>Machine constraints allow you to pick the hardware to which your services will be deployed.</p>
15 <p>Constraints can be set for environments and services, with lookups for each key falling back from more specific to more general settings, and with default values set by juju when otherwise unspecified. Changes to constraints do not affect any unit that has already been assigned to a machine.</p>
16- <p>Constraints will be controlled with a new command, <span class="pre">juju set-constraints</span>, taking an optional <span class="pre">--service</span> arg, and any number of <span class="pre">key=value</span> pairs. When the service name is specified, the constraints are set on that service; otherwise they are set on the environment.</p>
17- <p>Valid choices for the <span class="pre">value</span> are generally dependent on the particular constraint, with two exceptions:</p>
18+ <p>Constraints will be controlled with a new command, <code>juju set-constraints</code>, taking an optional <code>--service</code> arg, and any number of <code>key=value</code> pairs. When the service name is specified, the constraints are set on that service; otherwise they are set on the environment.</p>
19+ <p>Valid choices for the <code>value</code> are generally dependent on the particular constraint, with two exceptions:</p>
20
21 <ul>
22- <li>An empty value always means &quot;use the juju default setting&quot;. This allows you to ignore environment settings at the service level without having to explicitly remember and re-set the juju default values. Note that there is no way to change the juju default values.</li>
23- <li>A value of <span class="pre">any</span> explicitly unsets a constraint, and will cause it to be chosen completely arbitrarily.</li>
24+ <li>An empty value always means &quot;use the juju default setting&quot;. This allows you to ignore environment settings at the service level without having to explicitly remember and re-set the juju default values. Note that there is no way to change the juju default values.</li>
25+ <li>A value of <code>any</code> explicitly unsets a constraint, and will cause it to be chosen completely arbitrarily.</li>
26 </ul>
27
28- <p>We also extend the syntax for <span class="pre">juju deploy</span>, and <span class="pre">juju bootstrap</span>, such that <span class="pre">--constraints</span> expects a single string of space-separated constraints, understood as above; deployment constraints will be set on the service before the first unit is deployed, and bootstrap constraints will be set on the environment and used to provision the initial master machine.</p>
29- <p>Please note that there are no changes to the <span class="pre">juju add-unit</span> command; juju is explicitly focused on <strong>service</strong> orchestration, and it is counterproductive to encourage users to consider individual units. This can be worked around by setting new service constraints before adding new units, but is not encouraged.</p>
30- <p>The new <span class="pre">juju get-constraints</span> command is used to see the currently applicable constraints. When called without arguments, it outputs the environment constraints as a single yaml-formatted dict; alternatively, it can be called with any number of arguments referencing any mix of services, service units, or machines, and will output a yaml-formatted dict of dicts with the outer dict keyed on the requested entities.</p>
31-
32- <h1>Examples</h1>
33-
34+ <p>We also extend the syntax for <code>juju deploy</code>, and <code>juju bootstrap</code>, such that <code>--constraints</code> expects a single string of space-separated constraints, understood as above; deployment constraints will be set on the service before the first unit is deployed, and bootstrap constraints will be set on the environment and used to provision the initial master machine.</p>
35+ <p>Please note that there are no changes to the <code>juju add-unit</code> command; juju is explicitly focused on <strong>service</strong> orchestration, and it is counterproductive to encourage users to consider individual units. This can be worked around by setting new service constraints before adding new units, but is not encouraged.</p>
36+ <p>The new <code>juju get-constraints</code> command is used to see the currently applicable constraints. When called without arguments, it outputs the environment constraints as a single yaml-formatted dict; alternatively, it can be called with any number of arguments referencing any mix of services, service units, or machines, and will output a yaml-formatted dict of dicts with the outer dict keyed on the requested entities.</p>
37+ <h2>Examples</h2>
38 <p>Deploy MySQL on a machine with at least 32GiB of RAM, and at least 8 ECU of CPU power (architecture will be inherited from the environment, or default to amd64):</p>
39- <pre><code>juju deploy --constraints "cpu-cores=8 mem=32G" mysql</code></pre>
40+ <pre class="prettyprint">juju deploy --constraints "cpu-cores=8 mem=32G" mysql</pre>
41
42 <p>Deploy to t1.micros on AWS:</p>
43- <pre><code>juju bootstrap --constraints "cpu-power=0 cpu-power=0 mem=512M"</code></pre>
44+ <pre class="prettyprint">juju bootstrap --constraints "cpu-power=0 cpu-power=0 mem=512M"</pre>
45
46 <p>Launch all future &quot;mysql&quot; machines with at least 8GiB of RAM and 4 ECU:</p>
47- <pre><code>juju set-constraints --service mysql mem=8G cpu-cores=4</code></pre>
48+ <pre class="prettyprint">juju set-constraints --service mysql mem=8G cpu-cores=4</pre>
49
50 <p>Output current environment constraints:</p>
51- <pre><code>juju get-constraints</code></pre>
52+ <pre class="prettyprint">juju get-constraints</pre>
53
54 <p>Output constraints for machine 3, service &quot;mysql&quot;, and service unit &quot;wordpress/7&quot;:</p>
55- <pre><code>juju get-constraints 3 mysql wordpress/7</code></pre>
56-
57+ <pre class="prettyprint">juju get-constraints 3 mysql wordpress/7</pre>
58+ </section>
59+ <section id="provider-constraints">
60 <h1>Provider Constraints</h1>
61-
62- <p>See a <a href="reference-constraints.html">complete listing of constraints</a> for details on what each constraint means. Two of the most commonly used are:</p>
63-
64+ <p>See a <a href="reference-constraints.html">complete listing of constraints</a> for details on what each constraint means. Two of the most commonly used are:</p>
65 <ul>
66- <li><span class="pre">cpu-cores</span>: The minimum processing power of the machine, roughly indicated by how many cores are available.</li>
67- <li><span class="pre">mem</span>: The minimum memory for the machine, defaulting to 512MB.</li>
68-
69- <p class="note"><strong> Note: </strong> The <span class="pre">instance-type</span> constraint is not currently supported by juju-core, but support will be added soon. Some of the following examples make use of this setting merely to illustrate a point. </p>
70-
71-
72+ <li><code>cpu-cores</code>: The minimum processing power of the machine, roughly indicated by how many cores are available.</li>
73+ <li><code>mem</code>: The minimum memory for the machine, defaulting to 512MB.</li>
74+ </ul>
75+ <p class="note"><strong> Note: </strong> The <code>instance-type</code> constraint is not currently supported by juju-core, but support will be added soon. Some of the following examples make use of this setting merely to illustrate a point. </p>
76+ </section>
77+ <section id="examples-constraints">
78 <h1>Working with constraints</h1>
79 <p>Here are some examples of working with constraints.</p>
80 <p>When bootstrapping an environment, you can set the constraints directly:</p>
81- <pre><code>juju bootstrap --constraints arch=i386</code></pre>
82+ <pre class="prettyprint">juju bootstrap --constraints arch=i386</pre>
83
84 <p>The above command did two things:</p>
85
86 <ul>
87 <li><p class="first">Set the environment constraints to require machines with an i386 architecture, leaving the other defaults untouched; this is precisely equivalent to:</p>
88-
89- <pre><code>juju bootstrap --constraints "arch=i386 cpu-cores= mem= "</code></pre>
90-
91+ <pre class="prettyprint">juju bootstrap --constraints "arch=i386 cpu-cores= mem= "</pre>
92 <p>...but rather more convenient to type.</p>
93 </li>
94 <li><p class="first">Started the bootstrap/master machine with the above constraints.</p>
95 </li>
96 </ul>
97-
98 <p>Because the environment constraints were set, subsequent deployments will use the same values:</p>
99- <pre><code>juju deploy mysql</code></pre>
100+ <pre class="prettyprint">juju deploy mysql</pre>
101
102 <p>...but other services can be started with their own constraints:</p>
103- <pre><code>juju deploy wordpress --constraints mem=1024</code></pre>
104+ <pre class="prettyprint">juju deploy wordpress --constraints mem=1024</pre>
105
106- <p>Note that the <span class="pre">arch=i386</span> constraint is still inherited from the environment, and that this presents a potential problem:</p>
107- <pre><code>juju deploy minecraft --constraints instance-type=cc2.8xlarge</code></pre>
108+ <p>Note that the <code>arch=i386</code> constraint is still inherited from the environment, and that this presents a potential problem:</p>
109+ <pre class="prettyprint lang-yaml">juju deploy minecraft --constraints instance-type=cc2.8xlarge</pre>
110
111 <p>The above command will still inherit the environment constraints, and will lead to an undeployable service (because cc2.8xlarge cannot run on i386). Running juju debug-log will expose the problem; you can fix it as follows:</p>
112
113- <pre><code>
114- juju remove-unit minecraft/0
115- juju terminate-machine 1
116- juju set-constraints --service minecraft arch=amd64 instance-type=cc2.8xlarge
117- juju add-unit minecraft
118- </code></pre>
119+<pre class="prettyprint lang-yaml">
120+juju remove-unit minecraft/0
121+juju terminate-machine 1
122+juju set-constraints --service minecraft arch=amd64 instance-type=cc2.8xlarge
123+juju add-unit minecraft
124+</pre>
125
126 <p>(You need to remove machine 1's assigned unit before you can terminate it; you need to explicitly terminate the machine to stop the provisioning agent from continuing to attempt to launch it; and you need to set the new service constraints before adding a new unit that will use those constraints.)</p>
127
128- <p>Work on the constraints feature is ongoing, and it will shortly become impossible to specify knowably inconsistent constraints; but it is in general impossible to detect undeployable constraints with absolute certainty (for example, you could deploy with <span class="pre">ec2-zone=a</span> and be running perfectly happily, but see us-east-1a suddenly go down just as you add a unit).</p>
129+ <p>Work on the constraints feature is ongoing, and it will shortly become impossible to specify knowably inconsistent constraints; but it is in general impossible to detect undeployable constraints with absolute certainty (for example, you could deploy with <code>ec2-zone=a</code> and be running perfectly happily, but see us-east-1a suddenly go down just as you add a unit).</p>
130
131 <h1>Distinctions Between Entities</h1>
132- <p>As noted, it is impossible to directly set constraints on machines or service units; however, it is still possible to call <span class="pre">juju get-constraints</span> on those entities. In either case, the constraints are a snapshot of the applicable constraints at entity creation time; so the unit constraints are the combined environment/service constraints from the time at which the unit was created, and the machine constraints are a copy of the unit constraints at that same point in time.</p>
133+ <p>As noted, it is impossible to directly set constraints on machines or service units; however, it is still possible to call <code>juju get-constraints</code> on those entities. In either case, the constraints are a snapshot of the applicable constraints at entity creation time; so the unit constraints are the combined environment/service constraints from the time at which the unit was created, and the machine constraints are a copy of the unit constraints at that same point in time.</p>
134
135 <p>Storing this data allows us to automatically reprovision unexpectedly dead machines (for example, if you terminate machine 7 via the AWS management console, the provisioning agent will spin up a new instance with the same constraints and redeploy the assigned units); and making the data available via the CLI gives you visibility into the state of your deployment, and allows you to answer questions like &quot;why is this unit running on that machine?&quot;.</p>
136
137 <h1>Legacy Deployments</h1>
138 <p>Attempting to use constraints against a deployment that predates their inclusion in juju will not work, because the running legacy code (specifically, the provisioning agent) will not be able to interpret them. Therefore, attempts to specify constraints against legacy deployments will generate errors to inform users of their invalidity; at the agent level they are simply ignored.</p>
139- <p>All commands valid before the client upgrade should continue to work as before, as will the EC2 <span class="pre">default-image-id</span> and <span class="pre">default-instance-type</span> environment settings.</p>
140+ <p>All commands valid before the client upgrade should continue to work as before, as will the EC2 <code>default-image-id</code> and <code>default-instance-type</code> environment settings.</p>
141 </article>
142 </div>
143 </div>
144@@ -205,6 +199,7 @@
145 <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p>
146 </div>
147 </div>
148+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
149 </footer>
150
151 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
152
153=== modified file 'htmldocs/charms-deploying.html'
154--- htmldocs/charms-deploying.html 2013-08-30 19:00:47 +0000
155+++ htmldocs/charms-deploying.html 2013-08-31 16:07:11 +0000
156@@ -262,7 +262,7 @@
157 rabbitmq-server service:</p>
158 <pre class="prettyprint">juju status</pre>
159 <p>Which results in the following</p>
160- <pre class="prettyprint">
161+ <pre class="prettyprint lang-yaml">
162 machines:
163 "0":
164 agent-state: started
165
166=== modified file 'htmldocs/charms-destroy.html'
167--- htmldocs/charms-destroy.html 2013-08-22 13:55:23 +0000
168+++ htmldocs/charms-destroy.html 2013-08-31 16:07:11 +0000
169@@ -56,47 +56,45 @@
170 <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
171 <div class="grid-9 doc-content">
172 <article>
173- <section id ="charms-destroy">
174-
175+ <section id ="destroy-services">
176 <h1>Destroy Stuff</h1>
177- <p>Juju isn't just about magically spinning up services as and when you need them, it is also about quickly, sanely and efficiently destroying everything when you no longer need it. This section deals with the sort of things you can ruthlessly destroy, and how to go about it.</p>
178-
179+ <p>Juju isn't just about magically spinning up services as and when you need them, it is also about quickly, sanely and efficiently destroying everything when you no longer need it. This section deals with the sort of things you can ruthlessly destroy, and how to go about it.</p>
180 <h1>Destroying/Removing Services</h1>
181 <p>Once a service is no longer required it can be removed with a simple command.</p>
182- <pre><code>juju destroy-service &LT;service-name&GT;</code></pre>
183- <p>Before you take this step though, it is important to remove any relationships so that it can be removed cleanly, otherwise an error state may exist elsewhere.</p>
184+ <pre class="prettyprint">juju destroy-service &LT;service-name&GT;</pre>
185+ <p class="warning"><strong>Warning!:</strong> Destroying a service which has active relations with another running service will break that relation. This can cause errors in both services, as such review and potentially destroy any relationships first if.</p>
186 <p>A service can take a while to "die", but if running a juju status reveals that the service is listed as dying, but also reports an error state, then the zombied service will still be hanging around. See <a href="troubleshooting.html#die">"Why won't it just die?" in the troubleshooting section.</a>
187-
188- <p class="warning"><strong>Warning!:</strong>Destroying a service which has active relations with another running service can cause errors in both services. You should destroy any relationships first if possible. </p>
189-
190- <p class="note"><strong>Note:</strong> Destroying a service removes that service, but not any nodes which may have been created for it to run on.</p>
191-
192- <h1>Destroying/Removing Units</h1>
193+ <p class="note"><strong>Note:</strong> Destroying a service removes that service, but not any nodes which may have been created for it to run on. This is juju's way of preserving data to the best it's ability. See <a href="#destroy-machines">Destroying Machines</a> for additional details.</p>
194+ </section>
195+ <section id="destroy-units">
196+ <h1>Destroying Units</h1>
197 <p>It is also possible to spin down individual units, or a sequence of units running a service:</p>
198- <pre><code>juju remove-unit mediawiki/1</code></pre>
199- <p>The 'remove-unit' command is an alias for 'destroy-unit', and can be used interchangeably, so the above is identical to:</p>
200- <pre><code>juju destroy-unit mediawiki/1</code></pre>
201+ <pre class="prettyprint lang-yaml">juju remove-unit mediawiki/1</pre>
202+ <p>The <code>remove-unit</code> command is an alias for <code>destroy-unit</code>, and can be used interchangeably, so the above is identical to:</p>
203+ <pre class="prettyprint lang-yaml">juju destroy-unit mediawiki/1</pre>
204 <p>If you wish to remove more than one unit, you may list them all following the command:</p>
205- <pre><code>juju remove-unit mediawiki/1 mediawiki/2 mediawiki/3 mysql/2 ...</code></pre>
206- <p class="note"><strong>Note:</strong> As with destroying a service, removing units will NOT actually remove any instances which were created, it only removes the service unitsm.</p>
207-
208- <h1>Destroying/Removing machines</h1>
209+ <pre class="prettyprint lang-yaml">juju remove-unit mediawiki/1 mediawiki/2 mediawiki/3 mysql/2 ...</pre>
210+ <p class="note"><strong>Note:</strong> As with destroying a service, removing units will NOT actually remove any instances which were created, it only removes the service units. More details can be found in the <a href="charms-scaling.html">Scaling Services</a> section.</p>
211+ </section>
212+ <section id="destroy-machines">
213+ <h1>Destroying machines</h1>
214 <p>Instances or machines which have no currently assigned workload can be removed from your cloud using the following command:
215- <pre><code>juju destory-machine &LT;number&GT;</code></pre>
216+ <pre class="prettyprint">juju destory-machine &LT;number&GT;</pre>
217 <p>A machine which currently idle will be removed almost instantaneously from the cloud, along with anything else which may have been on the instance which juju was not aware of. To prevent accidents and awkward moments with running services, it is not possible to remove an instance which is currently allocated to a service. If you try to do so, you will get a polite error message in the form:</p>
218- <pre><code>error: no machines were destroyed: machine 3 has unit "mysql/0" assigned</code></pre>
219-
220+ <pre class="prettyprint lang-yaml">error: no machines were destroyed: machine 3 has unit "mysql/0" assigned</pre>
221+ </section>
222+ <section id="destroy-enviornments">
223 <h1>Destroying Environments</h1>
224 <p>To completely remove and terminate all running services, the instances they were running on and the bootstrap node itself, simply run the command:</p>
225- <pre><code>juju destroy-environment </code></pre>
226- <p> This will completely remove all instances running under the current environment profile. You can of course specify a different environment profile using the -e switch:</p>
227- <pre><code>juju destroy-environment -e mycloud </code></pre>
228+ <pre class="prettyprint">juju destroy-environment</pre>
229+ <p> This will completely remove all instances running under the current environment profile. You can of course specify a different environment profile using the <code>-e</code> switch, or any one of <a href="config-environments.html">these other</a> methods:</p>
230+ <pre class="prettyprint">juju destroy-environment -e mycloud</pre>
231 <p>You should be pretty sure that this is what you want to do, as there is no undo command! Everything in the selected environment will be removed.</p>
232-
233- <h1>Destroying Relations</h1>
234- <p>To remove relations between deployed services, you should see <a href="charms-relations.html#removing"> the docs section on charm relationships</a></p>.
235- </section>
236-
237+ </section>
238+ <section id="destroy-relations">
239+ <h1>Removing Relations</h1>
240+ <p>To remove relations between deployed services, you should see <a href="charms-relations.html#removing"> the docs section on charm relationships</a>.</p>
241+ </section>
242 </article>
243 </div>
244 </div>
245@@ -154,6 +152,7 @@
246 <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p>
247 </div>
248 </div>
249+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
250 </footer>
251
252 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
253
254=== modified file 'htmldocs/charms-exposing.html'
255--- htmldocs/charms-exposing.html 2013-08-22 13:55:23 +0000
256+++ htmldocs/charms-exposing.html 2013-08-31 16:07:11 +0000
257@@ -53,41 +53,51 @@
258
259 <section id="content" class="container-12">
260 <div class="grid-12 doc-container">
261- <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
262+ <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
263 <div class="grid-9 doc-content">
264 <article>
265 <section id ="exposing">
266 <h1>Exposing Services</h1>
267- <p>By design, Juju operates a very secure environment for deploying your services. Even if you have deployed services, they won't be publically available unless you explicitly make them so. To allow public access to services, the appropriate changes must be made to the cloud provider firewall settings. As the procedure or doing this varies depending on the provider, Juju helpfully abtracts this into a single command, <span class="pre">juju expose &LT;servicename&GT;</p>
268+ <p>By design, Juju operates a very secure environment for deploying your services. Even if you have deployed services, they won't be publically available unless you explicitly make them so. To allow public access to services, the appropriate changes must be made to the cloud provider firewall settings. As the procedure or doing this varies depending on the provider, Juju helpfully abtracts this into a single command, <code>juju expose &LT;servicename&GT;</code></p>
269 <p>For example, you may have deployed a WordPress service using the relevant charm. Once deployed, the service still cannot be accessed by the public, so you would run:<p>
270- <pre><code>juju expose wordpress</code></pre>
271+ <pre class="prettyprint">juju expose wordpress</pre>
272 <p>Juju will then take the steps necessary to adjust firewall rules and any other settings to expose the service via it's given address. This process may take anything from a few moments to several minutes. You can check on the current status of your services by running:</p>
273- <pre><code>juju status</code></pre>
274+ <pre class="prettyprint">juju status</pre>
275 <p>This will return a status report like this:</p>
276- <pre><code>...
277- &nbsp;services:
278- &nbsp;&nbsp;wordpress:
279- &nbsp;&nbsp;&nbsp;&nbsp;exposed: true
280- &nbsp;&nbsp;&nbsp;&nbsp;charm: local:precise/wordpress-42
281- &nbsp;&nbsp;&nbsp;&nbsp;relations: {db: mysql}
282- &nbsp;&nbsp;units:
283- &nbsp;&nbsp;&nbsp;&nbsp;wordpress/0:
284- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;machine: 2
285- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;open-ports: [80/tcp]
286- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;relations:
287- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;db: {state: up}
288- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;state: started
289- ...
290- </code></pre>
291- <p>As you can see here, the <strong>exposed:</strong> status is listed as true, and the service is running and available to users.</p>
292+<pre class="prettyprint lang-yaml">
293+machines:
294+ "0":
295+ agent-state: started
296+ agent-version: 1.12.0
297+ dns-name: 15.185.88.51
298+ instance-id: "1736045"
299+ series: precise
300+ "1":
301+ agent-state: started
302+ agent-version: 1.12.0
303+ dns-name: 15.185.89.204
304+ instance-id: "1736065"
305+ series: precise
306+services:
307+ wordpress:
308+ charm: cs:precise/wordpress-42
309+ exposed: true
310+ units:
311+ wordpress/0:
312+ agent-state: started
313+ agent-version: 1.12.0
314+ machine: "1"
315+ open-ports:
316+ - 80/tcp
317+ public-address: 15.185.89.236</pre>
318+ <p>As you can see here, the <code>exposed:</code> status is listed as true, and the service is running and available to users.</p>
319 <p class="note"><strong>Note:</strong> Exposing the service does not change any DNS or other settings which may be neccessary to get your service running as you expect.</p>
320+ </section>
321+ <section id="unexposing">
322 <h1>Unexposing a service</h1>
323- <p>To return the firewall settings and make a service non-public again, you simly need to run the <span class="pre">juju unexpose</span> command. For example:</p>
324- <pre><code>juju unexpose wordpress</code></pre>
325-
326-
327-
328- </section>
329+ <p>To return the firewall settings and make a service non-public again, you simly need to run the <code>unexpose</code> command. For example:</p>
330+ <pre class="prettyprint">juju unexpose wordpress</pre>
331+ </section>
332 </article>
333 </div>
334 </div>
335@@ -145,6 +155,7 @@
336 <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p>
337 </div>
338 </div>
339+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
340 </footer>
341
342 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
343
344=== modified file 'htmldocs/charms-relations.html'
345--- htmldocs/charms-relations.html 2013-08-22 13:55:23 +0000
346+++ htmldocs/charms-relations.html 2013-08-31 16:07:11 +0000
347@@ -53,82 +53,77 @@
348
349 <section id="content" class="container-12">
350 <div class="grid-12 doc-container">
351- <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
352+ <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
353 <div class="grid-9 doc-content">
354 <article>
355- <section id ="charms-relations">
356+ <section id ="managing-relations">
357 <h1>Managing Relationships</h1>
358 <p>Few services you might want to run can do so completely independently - most of them rely on some other software components to be present and running too (e.g. a database). There would be little point in Juju making it supremely easy to deploy services if it didn't also make it easy to connect them up to services they need to get running! The Juju magic in this case involves the <strong>hooks</strong> built in to each charm which allow them to communicate. Unless you are writing charms, there is no need to go into detail on hooks, but these are the parts that make creating relationships between services so easy.</p>
359- <p>The charm for WordPress, for example, knows that it requires a database. It therefore has some code to deal with creating that connection and configuring the WordPress instance appropriately when it is told which database to connect to. Similarly, the MySQL charm knows that it is a database, and has code to create different types of database depending on what is required. The act of joining these services together causes this code to run, the WordPress charm saying what tables, users and data it requires, and the MySQL charm fulfilling that and acknowledging the task. As you will see though, adding a relationship is much easier than even this brief explanation.</p>
360- <h1>Creating Relations</h1>
361+ <p>The charm for WordPress, for example, knows that it requires a database. It therefore has some code to deal with creating that connection and configuring the WordPress instance appropriately when it is told which database to connect to. Similarly, the MySQL charm knows that it is a database, and has code to create different types of database depending on what is required. The act of joining these services together causes this code to run, the WordPress charm saying what tables, users and data it requires, and the MySQL charm fulfilling that and acknowledging the task. As you will see though, adding a relationship is much easier than even this brief explanation.</p>
362+ <h2 id="creating-relations">Creating Relations</h1>
363 <p>Creating relationships is usually very straightforward. Simply deploy the two services:</p>
364- <pre><code>juju deploy wordpress
365- juju deploy mysql
366- </code></pre>
367- <p>Then you create the relationship by specifying these two services with the <strong>add-relation</strong> command:</p>
368- <code><pre>juju add-relation mysql wordpress</code></pre>
369+<pre class="prettyprint">juju deploy wordpress
370+juju deploy mysql</pre>
371+ <p>Then you create the relationship by specifying these two services with the <code>add-relation</code> command:</p>
372+ <pre class="prettyprint">juju add-relation mysql wordpress</pre>
373 <p>These services will then communicate and establish an appropriate connection, in this case WordPress using the available MySQL service for its database requirement, and MySQL generating and providing the necessary tables required for WordPress.</p>
374 <p>In some cases, there may be ambiguity about how the services should connect. For example, in the case of specifying a database for the Mediawiki charm.</p>
375- <pre><code>juju add-relation mediawiki mysql -e hpc
376- error: ambiguous relation: "mediawiki mysql" could refer to "mediawiki:db mysql:db"; "mediawiki:slave mysql:db"
377- </code></pre>
378+<pre class="prettyprint">juju add-relation mediawiki mysql
379+error: ambiguous relation: "mediawiki mysql" could refer to "mediawiki:db mysql:db"; "mediawiki:slave mysql:db"</pre>
380 <p> the soloution in these cases is to specify the nature of the relation using the hook identifier. In this case, we want MySQL to provide the backend database for mediawiki, so this is what we need to enter:</p>
381- <pre><code>juju add-relation mediawiki:db mysql</code></pre>
382- <p>we can check the output from 'juju status' to make sure the correct relationship has been established:</p>
383- <pre><code>juju status -e hpc
384+ <pre class="prettyprint">juju add-relation mediawiki:db mysql</pre>
385+ <p>we can check the output from <code>juju status</code> to make sure the correct relationship has been established:</p>
386+ <pre class="prettyprint lang-yaml">
387 machines:
388-&nbsp;&nbsp;"0":
389-&nbsp;&nbsp;&nbsp;&nbsp;agent-state: started
390-&nbsp;&nbsp;&nbsp;&nbsp;agent-version: 1.10.0
391-&nbsp;&nbsp;&nbsp;&nbsp;dns-name: 15.185.88.51
392-&nbsp;&nbsp;&nbsp;&nbsp;instance-id: "1736045"
393-&nbsp;&nbsp;&nbsp;&nbsp;series: precise
394-&nbsp;&nbsp;"1":
395-&nbsp;&nbsp;&nbsp;&nbsp;agent-state: started
396-&nbsp;&nbsp;&nbsp;&nbsp;agent-version: 1.10.0
397-&nbsp;&nbsp;&nbsp;&nbsp;dns-name: 15.185.89.204
398-&nbsp;&nbsp;&nbsp;&nbsp;instance-id: "1736065"
399-&nbsp;&nbsp;&nbsp;&nbsp;series: precise
400-&nbsp;&nbsp;"3":
401-&nbsp;&nbsp;&nbsp;&nbsp;agent-state: started
402-&nbsp;&nbsp;&nbsp;&nbsp;agent-version: 1.10.0
403-&nbsp;&nbsp;&nbsp;&nbsp;dns-name: 15.185.89.236
404-&nbsp;&nbsp;&nbsp;&nbsp;instance-id: "1736119"
405-&nbsp;&nbsp;&nbsp;&nbsp;series: precise
406+ "0":
407+ agent-state: started
408+ agent-version: 1.10.0
409+ dns-name: 15.185.88.51
410+ instance-id: "1736045"
411+ series: precise
412+ "1":
413+ agent-state: started
414+ agent-version: 1.10.0
415+ dns-name: 15.185.89.204
416+ instance-id: "1736065"
417+ series: precise
418+ "3":
419+ agent-state: started
420+ agent-version: 1.10.0
421+ dns-name: 15.185.89.236
422+ instance-id: "1736119"
423+ series: precise
424 services:
425-&nbsp;&nbsp;mediawiki:
426-&nbsp;&nbsp;&nbsp;&nbsp;charm: cs:precise/mediawiki-8
427-&nbsp;&nbsp;&nbsp;&nbsp;exposed: false
428-&nbsp;&nbsp;&nbsp;&nbsp;relations:
429-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;db:
430-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- mysql
431-&nbsp;&nbsp;&nbsp;&nbsp;units:
432-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mediawiki/0:
433-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agent-state: pending
434-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agent-version: 1.10.0
435-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;machine: "3"
436-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public-address: 15.185.89.236
437-&nbsp;&nbsp;mysql:
438-&nbsp;&nbsp;&nbsp;&nbsp;charm: cs:precise/mysql-24
439-&nbsp;&nbsp;&nbsp;&nbsp;exposed: false
440-&nbsp;&nbsp;&nbsp;&nbsp;relations:
441-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cluster:
442-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- mysql
443-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;db:
444-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- mediawiki
445-&nbsp;&nbsp;&nbsp;&nbsp;units:
446-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mysql/0:
447-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agent-state: started
448-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agent-version: 1.10.0
449-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;machine: "1"
450-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public-address: 15.185.89.204
451-</code></pre>
452-<h1>Removing Relations</h1>
453-<p>There are times when a relationship just isn't working and it is time to move on. Fortunately, it is a simple single-line command to break off these relationships:</p>
454-<pre><code>juju destroy-relation mediawiki mysql</code></pre>
455-
456-
457-
458+ mediawiki:
459+ charm: cs:precise/mediawiki-8
460+ exposed: false
461+ relations:
462+ db:
463+ - mysql
464+ units:
465+ mediawiki/0:
466+ agent-state: pending
467+ agent-version: 1.10.0
468+ machine: "3"
469+ public-address: 15.185.89.236
470+ mysql:
471+ charm: cs:precise/mysql-24
472+ exposed: false
473+ relations:
474+ cluster:
475+ - mysql
476+ db:
477+ - mediawiki
478+ units:
479+ mysql/0:
480+ agent-state: started
481+ agent-version: 1.10.0
482+ machine: "1"
483+ public-address: 15.185.89.204
484+</pre>
485+ <h2 id="removing-relations">Removing Relations</h1>
486+ <p>There are times when a relationship just isn't working and it is time to move on. Fortunately, it is a simple single-line command to break off these relationships:</p>
487+ <pre class="prettyprint">juju destroy-relation mediawiki mysql</pre>
488 </section>
489 </article>
490 </div>
491@@ -187,6 +182,7 @@
492 <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p>
493 </div>
494 </div>
495+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
496 </footer>
497
498 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
499
500=== modified file 'htmldocs/charms-scaling.html'
501--- htmldocs/charms-scaling.html 2013-08-30 22:37:17 +0000
502+++ htmldocs/charms-scaling.html 2013-08-31 16:07:11 +0000
503@@ -86,33 +86,35 @@
504 <p>or you can use <code>--num-unit</code> which has the same result, but is more readable:</p>
505 <pre class="prettyprint">juju add-unit --num-unit 100 mysql</pre>
506 <p>If you would like to add a unit to a specific machine just append the <code>--to</code> <machine> option.</p>
507-<pre class="prettyprint">#add unit to machine 23
508+
509+<pre class="prettyprint"># add unit to machine 23
510 juju add-unit mysql --to 23
511
512-#add unit to lxc container 3 on host machine 24
513+# add unit to lxc container 3 on host machine 24
514 juju add-unit mysql --to 24/lxc/3
515
516-#add unit to a new lxc container on host machine 25
517+# add unit to a new lxc container on host machine 25
518 juju add-unit mysql --to lxc:25</pre>
519+
520 <p>The <code>add-unit</code> command deploys a machine matching the constraints of the initially deployed service. For example, if mysql was deployed with the defaults (i.e. no <code>--constraints</code> option) you would have mysql on an instance that matches the closest to 1Gig of memory and 1CPU. If you would like to add a unit with more resources to the mysql service you will first need to issue a <code>add-machine</code> with the desired constraint followed by a <code>add-unit</code>. For example, the following command adds a 16Gig unit to the mysql service (note in this example <code>juju status</code> returns machine 3 for the <code>add-machine</code> command):</p>
521 <pre class="prettyprint">juju add-machine --constraints="mem=16G"
522 juju add-unit mysql --to 3
523 </pre>
524
525 <p class="note"><strong>Note:</strong> Keep in mind you can always use the <code>-e</code> or <code>--environment</code> options to specify which environment/cloud you would like the command ran against. In the following example the <code>-e hpcloud</code> adds 100 units to the mysql service in HP's cloud:</p>
526-<pre class="prettyprint">juju add-unit -n 100 mysql -e hpcloud</pre>
527+ <pre class="prettyprint">juju add-unit -n 100 mysql -e hpcloud</pre>
528 <p><a href="charms-deploying.html#deploying-to-machines">More on deploying to specific machines.</a></p>
529 <h1>Scaling Back</h1>
530 <p>Sometimes you also want to scale back some of your services, and this too is easy with Juju.</p>
531 <p>The general usage to scale down a service is with the <code>remove-unit</code> command:</p>
532-<pre class="prettyprint">juju remove-unit [options] &ltunit&gt [...]</pre>
533+ <pre class="prettyprint">juju remove-unit [options] &ltunit&gt [...]</pre>
534 <p>For example, the following scales down the mediawiki service by one unit:</p>
535-<pre class="prettyprint">juju remove-unit mediawiki/1</pre>
536- <p>If you have scaled-up the mediawiki service by more than one unit you can remove multiple units in the same command as long as you know the unit name (ie &lt;service&gt;/#).</p>
537-<pre class="prettyprint">juju remove-unit mediawiki/1 mediawiki/2 mediawiki/3 mediawiki/4 mediawiki/5</pre>
538+ <pre class="prettyprint lang-yaml">juju remove-unit mediawiki/1</pre>
539+ <p>If you have scaled-up the mediawiki service by more than one unit you can remove multiple units in the same command as long as you know the unit name (ie <code>&lt;service&gt;/#</code>).</p>
540+ <pre class="prettyprint lang-yaml">juju remove-unit mediawiki/1 mediawiki/2 mediawiki/3 mediawiki/4 mediawiki/5</pre>
541 <p>The <code>remove-unit</code> command can be run to remove running units safely. The running services should automatically adjust to the change.</p>
542- <p class="note"><strong>Note:</strong> After removing a service the machine will still be running. In order to completely remove the machine that once housed the service you need to issue a <code>destroy-machine</code>. For example, to remove machine 1 that the unit mediawiki/1 was housed on use the command:
543-<pre class="prettyprint">juju destroy-machine 1</pre>
544+ <p class="note"><strong>Note:</strong> After removing a service the machine will still be running. In order to completely remove the machine that once housed the service you need to issue a <code>destroy-machine</code>. For example, to remove machine 1 that the unit <code>mediawiki/1</code> was housed on use the command:
545+ <pre class="prettyprint lang-yaml">juju destroy-machine 1</pre>
546 <p>For more information on removing services, please see the section on <a href="charms-destroy.html">destroying services</a>.</p>
547 </section>
548
549
550=== modified file 'htmldocs/charms-service-groups.html'
551--- htmldocs/charms-service-groups.html 2013-08-31 13:10:24 +0000
552+++ htmldocs/charms-service-groups.html 2013-08-31 16:07:11 +0000
553@@ -53,44 +53,36 @@
554
555 <section id="content" class="container-12">
556 <div class="grid-12 doc-container">
557- <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
558+ <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
559 <div class="grid-9 doc-content">
560 <article>
561-
562-
563-<!--Actual docs start here-->
564-
565+ <!--Actual docs start here-->
566 <section id="service-groups">
567 <h1>Groups of Services</h1>
568 <p></p>
569-
570 <p>
571 Juju deploys units of a service from a charm.
572 The simplest way to do this is
573 </p>
574-
575-<pre class="prettyprint">
576-juju deploy mysql
577-</pre>
578+
579+ <pre class="prettyprint">juju deploy mysql</pre>
580
581 <p>
582 which will take the latest version of the mysql charm straight from the store and create a single service unit.
583 </p>
584
585 <p>
586- By default, juju creates a unit of a service named after the charm; "mysql" in the above example.
587+ By default, juju creates a unit of a service named after the charm; <code>mysql</code> in the above example.
588 </p>
589
590 <p>
591 You can specify the name for the service when deploying
592 </p>
593
594-<pre class="prettyprint">
595-juju deploy mysql wikidb
596-</pre>
597+ <pre class="prettyprint">juju deploy mysql wikidb</pre>
598
599 <p>
600- which will create a unit of the "wikidb" service. It creates the unit exactly as before, except instead of 'mysql', the service is called'wikidb'.
601+ which will create a unit of the <code>wikidb</code> service. It creates the unit exactly as before, except instead of <code>mysql</code>, the service is called <code>wikidb</code>.
602 </p>
603
604 <p>
605@@ -152,9 +144,7 @@
606 where the different services are related to each other
607 </p>
608
609-<pre class="prettyprint">
610-juju add-relation masterdb:master slavedb:slave
611-</pre>
612+ <pre class="prettyprint">juju add-relation masterdb:master slavedb:slave</pre>
613
614 <p>
615 and to other services via
616@@ -182,28 +172,17 @@
617 juju add-relation hadoop-master:namenode hadoop-slave-B:datanode
618 ...
619 </pre>
620-
621 <p>
622 These service groups can be managed independently by Juju for upgrades and configuration
623 </p>
624-
625-<pre class="prettyprint">
626-juju set hadoop-slave-B some_param=new_value
627-</pre>
628-
629+ <pre class="prettyprint">juju set hadoop-slave-B some_param=new_value</pre>
630 <p>
631 This technique can potentially be a way for Juju to manage rolling upgrades for a service.
632 Of course, this depends heavily on the services in question and how well they support
633 version management, schema changes, etc.
634 </p>
635-
636-
637 </section>
638-
639- <!--Actual docs end here-->
640-
641-
642-
643+ <!--Actual docs end here-->
644 </article>
645 </div>
646 </div>
647@@ -261,7 +240,7 @@
648 <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p>
649 </div>
650 </div>
651- <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
652+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
653 </footer>
654
655 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
656
657=== modified file 'htmldocs/charms-upgrading.html'
658--- htmldocs/charms-upgrading.html 2013-08-22 13:55:23 +0000
659+++ htmldocs/charms-upgrading.html 2013-08-31 16:07:11 +0000
660@@ -53,14 +53,20 @@
661
662 <section id="content" class="container-12">
663 <div class="grid-12 doc-container">
664- <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
665+ <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
666 <div class="grid-9 doc-content">
667 <article>
668 <section id ="upgrading">
669- <h1>Upgrades</h1>
670- <h1>Charm upgrades</h1>
671- <h1>Service upgrades</h1>
672- <h1>Juju</h1>
673+ <h1>Upgrades</h1>
674+ </section>
675+ <section id="charm-upgrades">
676+ <h1>Charm upgrades</h1>
677+ </section>
678+ <section id="service-upgrades">
679+ <h1>Service upgrades</h1>
680+ </section>
681+ <section id="juju-upgrades">
682+ <h1>Juju</h1>
683 </section>
684 </article>
685 </div>
686@@ -119,6 +125,7 @@
687 <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p>
688 </div>
689 </div>
690+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
691 </footer>
692
693 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
694
695=== modified file 'htmldocs/charms.html'
696--- htmldocs/charms.html 2013-08-30 14:04:27 +0000
697+++ htmldocs/charms.html 2013-08-31 16:07:11 +0000
698@@ -53,7 +53,7 @@
699
700 <section id="content" class="container-12">
701 <div class="grid-12 doc-container">
702- <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
703+ <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
704 <div class="grid-9 doc-content">
705 <article>
706 <section id="charms">
707@@ -62,25 +62,18 @@
708 <iframe class="youtube-player" type="text/html" width="400" height="300" src="//www.youtube.com/embed/0AT6qKyam9I" frameborder="0">
709 </iframe>
710 </aside>
711-
712 <p>The magic behind Juju is a collection of software components called charms. These are the encapsulated knowledge of how to properly deploy and configure the services you will want to deploy on your cloud. The charms available online in the <a href="">Charm Store</a> represent the distilled DevOps knowledge of experts, and they are freely available for you to use (or you can write your own).</p>
713 <p>Charms make it quick and easy to reliably and repeatedly deploy services in your cloud. If you haven't already tried the <a href=""> Juju walkthrough,</a> you should give it a go and see how ridiculously easy it is to deploy services in minutes. </p>
714 <p>In many cases, you will simply deploy, configure and expose services in your cloud. The following sections explore in more detail the everyday Juju and Charm operations you are likely to perform </p>
715 <ul>
716-
717 <li><a href="charms-deploying.html">Deploying services</a></li>
718-
719-
720 <li><a href="charms-config.html">Configuring Services</a></li>
721 <li><a href="charms-relations.html">Managing Relationships</a></li>
722 <li><a href="charms-constraints.html">Using Constraints</a></li>
723 <li><a href="charms-scaling.html">Scaling</a></li>
724 <li><a href="charms-exposing.html">Exposing services</a></li>
725-
726 </ul>
727 </section>
728-
729-
730 </article>
731 </div>
732 </div>
733
734=== modified file 'htmldocs/commands.html'
735--- htmldocs/commands.html 2013-08-22 13:55:23 +0000
736+++ htmldocs/commands.html 2013-08-31 16:07:11 +0000
737@@ -53,50 +53,51 @@
738
739 <section id="content" class="container-12">
740 <div class="grid-12 doc-container">
741- <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
742+ <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
743 <div class="grid-9 doc-content">
744 <article>
745- <section id ="charms-destroy">
746+ <section id ="commands">
747 <h1>Juju Command reference</h1>
748- <p>You can get a list of the currently used commands by entering <span class="pre">juju help commands</span> from the commandline. The currently understood commands are listed here, with some examples.</p>
749- <ul>
750- <li><strong>add-relation</strong> add a relation between two services</li>
751- <li><strong>add-unit</strong> add a service unit</li>
752- <li><strong>bootstrap</strong> start up an environment from scratch</li>
753- <li><strong>debug-log</strong> display the consolidated log file</li>
754- <li><strong>deploy</strong> deploy a new service</li>
755- <li><strong>destroy-environment</strong> terminate all machines and other associated resources for an environment</li>
756- <li><strong>destroy-machine</strong> destroy machines</li>
757- <li><strong>destroy-relation</strong> destroy a relation between two services</li>
758- <li><strong>destroy-service</strong> destroy a service</li>
759- <li><strong>destroy-unit</strong> destroy service units</li>
760- <li><strong>expose</strong> expose a service</li>
761- <li><strong>generate-config</strong> alias for init</li>
762- <li><strong>get</strong> get service config options</li>
763- <li><strong>get-constraints</strong> view constraints</li>
764- <li><strong>get-env</strong> alias for get-environment</li>
765- <li><strong>get-environment</strong> view environment values</li>
766- <li><strong>help</strong> show help on a command or other topic</li>
767- <li><strong>init</strong> generate boilerplate configuration for juju environments</li>
768- <li><strong>publish</strong> publish charm to the store</li>
769- <li><strong>remove-relation</strong> alias for destroy-relation</li>
770- <li><strong>remove-unit</strong> alias for destroy-unit</li>
771- <li><strong>resolved</strong> marks unit errors resolved</li>
772- <li><strong>scp</strong> launch a scp command to copy files to/from remote machine(s)</li>
773- <li><strong>set</strong> set service config options</li>
774- <li><strong>set-constraints</strong> replace constraints</li>
775- <li><strong>set-env</strong> alias for set-environment</li>
776- <li><strong>set-environment</strong> replace environment values</li>
777- <li><strong>ssh</strong> launch an ssh shell on a given unit or machine</li>
778- <li><strong>stat</strong> alias for status</li>
779- <li><strong>status</strong> output status information about an environment</li>
780- <li><strong>sync-tools</strong> copy tools from the official bucket into a local environment</li>
781- <li><strong>terminate-machine</strong> alias for destroy-machine</li>
782- <li><strong>unexpose</strong> unexpose a service</li>
783- <li><strong>upgrade-charm</strong> upgrade a service's charm</li>
784- <li><strong>upgrade-juju</strong> upgrade the tools in a juju environment</li>
785- <li><strong>version</strong> print the current version</li>
786- </ul>
787+ <p>You can get a list of the currently used commands by entering <code>juju help commands</code> from the commandline. The currently understood commands are listed here, with some examples.</p>
788+ <ul>
789+ <li><strong>add-relation</strong> add a relation between two services</li>
790+ <li><strong>add-unit</strong> add a service unit</li>
791+ <li><strong>bootstrap</strong> start up an environment from scratch</li>
792+ <li><strong>debug-log</strong> display the consolidated log file</li>
793+ <li><strong>deploy</strong> deploy a new service</li>
794+ <li><strong>destroy-environment</strong> terminate all machines and other associated resources for an environment</li>
795+ <li><strong>destroy-machine</strong> destroy machines</li>
796+ <li><strong>destroy-relation</strong> destroy a relation between two services</li>
797+ <li><strong>destroy-service</strong> destroy a service</li>
798+ <li><strong>destroy-unit</strong> destroy service units</li>
799+ <li><strong>expose</strong> expose a service</li>
800+ <li><strong>generate-config</strong> alias for init</li>
801+ <li><strong>get</strong> get service config options</li>
802+ <li><strong>get-constraints</strong> view constraints</li>
803+ <li><strong>get-env</strong> alias for get-environment</li>
804+ <li><strong>get-environment</strong> view environment values</li>
805+ <li><strong>help</strong> show help on a command or other topic</li>
806+ <li><strong>init</strong> generate boilerplate configuration for juju environments</li>
807+ <li><strong>publish</strong> publish charm to the store</li>
808+ <li><strong>remove-relation</strong> alias for destroy-relation</li>
809+ <li><strong>remove-unit</strong> alias for destroy-unit</li>
810+ <li><strong>resolved</strong> marks unit errors resolved</li>
811+ <li><strong>scp</strong> launch a scp command to copy files to/from remote machine(s)</li>
812+ <li><strong>set</strong> set service config options</li>
813+ <li><strong>set-constraints</strong> replace constraints</li>
814+ <li><strong>set-env</strong> alias for set-environment</li>
815+ <li><strong>set-environment</strong> replace environment values</li>
816+ <li><strong>ssh</strong> launch an ssh shell on a given unit or machine</li>
817+ <li><strong>stat</strong> alias for status</li>
818+ <li><strong>status</strong> output status information about an environment</li>
819+ <li><strong>sync-tools</strong> copy tools from the official bucket into a local environment</li>
820+ <li><strong>terminate-machine</strong> alias for destroy-machine</li>
821+ <li><strong>unexpose</strong> unexpose a service</li>
822+ <li><strong>upgrade-charm</strong> upgrade a service's charm</li>
823+ <li><strong>upgrade-juju</strong> upgrade the tools in a juju environment</li>
824+ <li><strong>version</strong> print the current version</li>
825+ </ul>
826+ </section>
827 </article>
828 </div>
829 </div>
830@@ -154,6 +155,7 @@
831 <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p>
832 </div>
833 </div>
834+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
835 </footer>
836
837 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
838
839=== modified file 'htmldocs/config-hpcloud.html'
840--- htmldocs/config-hpcloud.html 2013-08-23 14:55:02 +0000
841+++ htmldocs/config-hpcloud.html 2013-08-31 16:07:11 +0000
842@@ -50,56 +50,50 @@
843 </div>
844 </div>
845 </header>
846-
847 <section id="content" class="container-12">
848 <div class="grid-12 doc-container">
849- <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
850+ <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
851 <div class="grid-9 doc-content">
852 <article>
853 <section id="config_hpcloud">
854 <h1>Configuring for HPCloud</h1>
855- <p>You should start by generating a generic configuration file for Juju, using the command:
856- <pre><code>juju generate-config -w</code></pre>
857- <p>This will generate a file, <strong>environments.yaml</strong>, which will live in your <strong>~/.juju/</strong> directory (and will create the directory if it doesn't already exist).
858+ <p>You should start by generating a generic configuration file for Juju, using the command:</pre>
859+ <pre class="prettyprint">juju init</pre>
860+ <p>This will generate a file, <code>environments.yaml</code>, which will live in your <code>~/.juju/</code> directory (and will create the directory if it doesn't already exist).</p>
861 <p>The essential configuration sections for HPCloud look like this:</p>
862- <pre><code>
863- &nbsp;&nbsp;hpcloud:
864- &nbsp;&nbsp;&nbsp;&nbsp;type: openstack
865- &nbsp;&nbsp;&nbsp;&nbsp;admin-secret: 6638bebf0c54de791007e0247d4dae98
866- &nbsp;&nbsp;&nbsp;&nbsp;control-bucket: juju-bc66a4a4adbee50b2cea6570436528e5
867- &nbsp;&nbsp;&nbsp;&nbsp;tenant-name: <strong class="code">"juju-project1"</strong>
868- &nbsp;&nbsp;&nbsp;&nbsp;auth-url: <strong class="code">https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0</strong>
869- &nbsp;&nbsp;&nbsp;&nbsp;default-image-id: <strong class="code">"81078"</strong>
870- &nbsp;&nbsp;&nbsp;&nbsp;default-instance-type: "standard.xsmall"
871- &nbsp;&nbsp;&nbsp;&nbsp;auth-mode: userpass
872- &nbsp;&nbsp;&nbsp;&nbsp;username: <strong class="code">"xxxyour-hpcloud-usernamexxx"</strong>
873- &nbsp;&nbsp;&nbsp;&nbsp;password: <strong class="code">"xxxpasswordxxx"</strong>
874- &nbsp;&nbsp;&nbsp;&nbsp;region: <strong class="code">az-1.region-a.geo-1</strong>
875- &nbsp;&nbsp;&nbsp;&nbsp;public-bucket-url: <strong class="code">https://region-a.geo-1.objects.hpcloudsvc.com/v1/60502529753910</strong>
876- </code></pre>
877+ <pre class="prettyprint lang-yaml">
878+ hpcloud:
879+ type: openstack
880+ use-floating-ip: false
881+ admin-secret: 139e8bee94d15bff96d91ab9c27e5efc
882+ # Globally unique swift bucket name
883+ control-bucket: juju-9b53d6f5f45968d7c392a221f85fc8ae
884+ auth-url: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0
885+ public-bucket-url: https://region-a.geo-1.objects.hpcloudsvc.com/v1/60502529753910
886+ auth-mode: userpass
887+ username: [your username]
888+ password: [password]
889+ tenant-name: [HP Cloud Project Name]
890+ region: [az-1.region-a.geo-1, az-2.region-a.geo-1, or az-3.region-a.geo-1]</pre>
891 <p>The items highlighted are values you will need to enter, and are explained below. You will find most of the relevant information on the <a href="https://account.hpcloud.com/account/api_keys"> HP Cloud API Keys page</a></p>
892 <ul>
893- <li><strong>tenant-name:</strong> For HPCloud, this is listed as the project name on the<a href="https://account.hpcloud.com/projects"> "Manage Projects" page</a>.</li>
894+ <li>
895+ <code>tenant-name:</code> For HPCloud, this is listed as the project name on the<a href="https://account.hpcloud.com/projects"> "Manage Projects" page</a>.
896+ <img src="media/getting_started-hpc-tenant.png" alt="image showing project name">
897+ </li>
898 </ul>
899- <img src="./media/getting_started-hpc-tenant.png" alt="image showing project name">
900+ <hr>
901 <p>You will find the following information on the <a href="https://account.hpcloud.com/account/api_keys"> HP Cloud API Keys page for your account.</a></p>
902 <ul>
903- <li><strong>auth-url:</strong>This is the keystone url for authentication. It is given (on a region by region basis) under the heading "Service Endpoints - identity"
904+ <li>
905+ <code>auth-url:</code>This is the keystone url for authentication. It is given (on a region by region basis) under the heading "Service Endpoints - identity"
906+ <img src="media/getting_started-hpc-config1.png" alt="image showing service endpoints">
907 </li>
908- </ul>
909- <img src="./media/getting_started-hpc-config1.png" alt="image showing service endpoints">
910- <ul>
911- <li><strong>region:</strong> This is the longer format region name, given under the headings for Block Storage and Compute sections.</li>
912- </ul>
913- <img src="./media/getting_started-hpc-region.png" alt="image showing project name">
914- <ul>
915- <li><strong>default-image-id:</strong> This is the number assigned to the images available to the HP Cloud. Currently, these may vary from region to region. The best way to ensure that you have the correct image id is to go to the <a href="https://console.hpcloud.com/compute/az-1_region-a_geo-1/servers"> HP Cloud Console &GT; Servers </a> page and Click on the link to "Create a new server from an image". This will display a list of available images. In the "partner provided images" section you should find a relevant version of Ubuntu. The number in brackets after the image description is the id number you require. </li>
916- </ul>
917- <img src="./media/getting_started-hpc-image.png" alt="determining the image id number">
918- <ul>
919- <li><strong>username:</strong> Enter your HP Cloud login username. </li>
920- <li><strong>password:</strong> Enter your HP Cloud login password. </li>
921- <li><strong>public-bucket-url:</strong> Currently up to date tools are provided to HP Cloud by a public bucket. You should enter the url "https://region-a.geo-1.objects.hpcloudsvc.com/v1/60502529753910" here. </li>
922+ <li><code>region:</code> This is the longer format region name, given under the headings for Block Storage and Compute sections.<img src="media/getting_started-hpc-region.png" alt="image showing project name"></li>
923+ <li><code>username:</code> Enter your HP Cloud login username. </li>
924+ <li><code>password:</code> Enter your HP Cloud login password. </li>
925+ <li><code>public-bucket-url:</code> Currently up to date tools are provided to HP Cloud by a public bucket. If you're using your own imagemetadata you'd change this URL to the bucket you've created.</li>
926+ </ul>
927 </section>
928 </article>
929 </div>
930@@ -158,6 +152,7 @@
931 <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p>
932 </div>
933 </div>
934+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
935 </footer>
936
937 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
938
939=== modified file 'htmldocs/config-maas.html'
940--- htmldocs/config-maas.html 2013-08-22 13:55:23 +0000
941+++ htmldocs/config-maas.html 2013-08-31 16:07:11 +0000
942@@ -53,12 +53,16 @@
943
944 <section id="content" class="container-12">
945 <div class="grid-12 doc-container">
946- <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
947+ <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
948 <div class="grid-9 doc-content">
949 <article>
950 <section id="config_maas">
951 <h1>Configuring for MAAS</h1>
952 <p>Metal As A Service is software which allows you to deal with physical hardware just as easily as virtual nodes. For more information about MAAS, see <a href="http://maas.ubuntu.com"> maas.ubuntu.com </a> </p>
953+ <p>You should start by generating a generic configuration file for Juju, using the command:</p>
954+ <pre class="prettyprint">juju init</pre>
955+ <p>This will generate a file, <code>environments.yaml</code>, which will live in your <code>~/.juju/</code> directory (and will create the directory if it doesn't already exist).</p>
956+
957 <h1> Get your API key</h1>
958 <p>You'll need an API key from MAAS so that the Juju client can access it. Each user account in MAAS can have as many API keys as desired. One hard and fast rule is that you'll need to use a different API key for each Juju environment you set up within a single MAAS cluster.</p>
959 <p>To get the API key:</p>
960@@ -70,18 +74,17 @@
961 </ol>
962
963 <h1> Edit or create the configuration</h1>
964- <p>Create or modify <strong>~/.juju/environments.yaml</strong> with the following content:
965-
966- <pre><code>
967- &nbsp;&nbsp;maas:
968- &nbsp;&nbsp;&nbsp;&nbsp;type: maas
969- &nbsp;&nbsp;&nbsp;&nbsp;maas-server: 'http://xxyourMAASServernamexx:80/MAAS'
970- &nbsp;&nbsp;&nbsp;&nbsp;maas-oauth: '$MAAS_API_KEY'
971- &nbsp;&nbsp;&nbsp;&nbsp;admin-secret: 'nothing'
972- &nbsp;&nbsp;&nbsp;&nbsp;default-series: 'precise'
973- </code></pre>
974-
975- <p>Substitute the API key from earlier into the <span class="pre">$MAAS_API_KEY</span> slot. You may need to modify the maas-server setting too; if you're running from the maas package it should be something like "http://hostname.xxxx.yyy/MAAS".</p>
976+ <p>Create or modify <code>~/.juju/environments.yaml</code> with the following content:
977+
978+ <pre class="prettyprint lang-yaml">
979+ maas:
980+ type: maas
981+ maas-server: 'http://xxyourMAASServernamexx:80/MAAS'
982+ maas-oauth: '$MAAS_API_KEY'
983+ admin-secret: 'nothing'
984+ default-series: 'precise'</pre>
985+
986+ <p>Substitute the API key from earlier into the <code>$MAAS_API_KEY</code> slot. You may need to modify the <code>maas-server</code> setting too; if you're running from the maas package it should be something like "http://hostname.xxxx.yyy/MAAS".</p>
987 </section>
988 </article>
989 </div>
990@@ -140,6 +143,7 @@
991 <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p>
992 </div>
993 </div>
994+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
995 </footer>
996
997 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
998
999=== modified file 'htmldocs/config-openstack.html'
1000--- htmldocs/config-openstack.html 2013-08-22 13:55:23 +0000
1001+++ htmldocs/config-openstack.html 2013-08-31 16:07:11 +0000
1002@@ -58,36 +58,36 @@
1003 <article>
1004 <section id="config_hpcloud">
1005 <h1>Configuring for OpenStack</h1>
1006- <p>You should start by generating a generic configuration file for Juju, using the command:
1007- <pre><code>juju generate-config -w</code></pre>
1008- <p>This will generate a file, <strong>environments.yaml</strong>, which will live in your <strong>~/.juju/</strong> directory (and will create the directory if it doesn't already exist).
1009+ <p>You should start by generating a generic configuration file for Juju, using the command:</p>
1010+ <pre class="prettyprint">juju init</pre>
1011+ <p>This will generate a file, <code>environments.yaml</code>, which will live in your <code>~/.juju/</code> directory (and will create the directory if it doesn't already exist).</p>
1012 <p>The essential configuration sections for OpenStack look like this:</p>
1013- <pre><code>
1014- openstack:
1015- type: openstack
1016- # Specifies whether the use of a floating IP address is required to give the nodes
1017- # a public IP address. Some installations assign public IP addresses by default without
1018- # requiring a floating IP address.
1019- # use-floating-ip: false
1020- admin-secret: 13850d1b9786065cadd0f477e8c97cd3
1021- # Globally unique swift bucket name
1022- control-bucket: juju-fd6ab8d02393af742bfbe8b9629707ee
1023- # Usually set via the env variable OS_AUTH_URL, but can be specified here
1024- # auth-url: https://yourkeystoneurl:443/v2.0/
1025- # override if your workstation is running a different series to which you are deploying
1026- # default-series: precise
1027- # The following are used for userpass authentication (the default)
1028- auth-mode: userpass
1029- # Usually set via the env variable OS_USERNAME, but can be specified here
1030- # username: <your username>
1031- # Usually set via the env variable OS_PASSWORD, but can be specified here
1032- # password: <secret>
1033- # Usually set via the env variable OS_TENANT_NAME, but can be specified here
1034- # tenant-name: <your tenant name>
1035- # Usually set via the env variable OS_REGION_NAME, but can be specified here
1036- # region: <your region>
1037- </code></pre>
1038+ <pre class="prettyprint lang-yaml">
1039+openstack:
1040+ type: openstack
1041+ # Specifies whether the use of a floating IP address is required to give the nodes
1042+ # a public IP address. Some installations assign public IP addresses by default without
1043+ # requiring a floating IP address.
1044+ # use-floating-ip: false
1045+ admin-secret: 13850d1b9786065cadd0f477e8c97cd3
1046+ # Globally unique swift bucket name
1047+ control-bucket: juju-fd6ab8d02393af742bfbe8b9629707ee
1048+ # Usually set via the env variable OS_AUTH_URL, but can be specified here
1049+ # auth-url: https://yourkeystoneurl:443/v2.0/
1050+ # override if your workstation is running a different series to which you are deploying
1051+ # default-series: precise
1052+ # The following are used for userpass authentication (the default)
1053+ auth-mode: userpass
1054+ # Usually set via the env variable OS_USERNAME, but can be specified here
1055+ # username: <your username>
1056+ # Usually set via the env variable OS_PASSWORD, but can be specified here
1057+ # password: <secret>
1058+ # Usually set via the env variable OS_TENANT_NAME, but can be specified here
1059+ # tenant-name: <your tenant name>
1060+ # Usually set via the env variable OS_REGION_NAME, but can be specified here
1061+ # region: <your region></pre>
1062
1063+ <p class="note"><strong>Note:</strong> At any time you can run <code>juju init --show</code> to display the most revent version of the environments.yaml template file, instead of having it write to file.</p>
1064 <p>Remember to substitute in the parts of the snippet that are important to you. If you are deploying on OpenStack the following documentation might also be useful:</p>
1065
1066 <p><a href="https://help.ubuntu.com/community/UbuntuCloudInfrastructure">Ubuntu Cloud Infrastructure</a></p>
1067@@ -151,6 +151,7 @@
1068 <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p>
1069 </div>
1070 </div>
1071+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
1072 </footer>
1073
1074 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
1075
1076=== modified file 'htmldocs/css/main.css'
1077--- htmldocs/css/main.css 2013-08-30 21:48:11 +0000
1078+++ htmldocs/css/main.css 2013-08-31 16:07:11 +0000
1079@@ -437,14 +437,19 @@
1080 background: url("https://juju.ubuntu.com/wp-content/themes/juju-website/img/background-header-home.png") 0 0 repeat #fff;
1081 }
1082
1083-pre.lang-yaml .typ, pre.lang-yaml .kwd {
1084+pre.lang-yaml .typ, pre.lang-yaml .kwd, pre.lang-yaml .lit {
1085 color: #fff;
1086 }
1087
1088 pre.prettyprint, code.prettyprint {
1089 background-color: #222 !important;
1090+ color: #fff;
1091 }
1092
1093+pre.prettyprint.prettyprinted {
1094+ white-space: pre;
1095+ overflow-x: auto;
1096+}
1097
1098 hr {
1099 background: #fff;
1100@@ -484,3 +489,8 @@
1101 dd {
1102 padding-left: 10px;
1103 }
1104+
1105+li img {
1106+ margin-top: 10px;
1107+ display:block;
1108+}
1109
1110=== modified file 'htmldocs/getting-started.html'
1111--- htmldocs/getting-started.html 2013-08-22 13:55:23 +0000
1112+++ htmldocs/getting-started.html 2013-08-31 16:07:11 +0000
1113@@ -53,7 +53,7 @@
1114
1115 <section id="content" class="container-12">
1116 <div class="grid-12 doc-container">
1117- <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
1118+ <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
1119 <div class="grid-9 doc-content">
1120 <article>
1121 <section id="intro">
1122@@ -61,10 +61,9 @@
1123 <p>This tutorial will show you how to get started with Juju, including installing, configuring and bootstrapping a new Juju environment.
1124 Before you start you will need:</p>
1125 <ul>
1126- <li> An Ubuntu or OSX machine to install the client on.</li>
1127- <li> An environment which can provide a new server with an Ubuntu cloud operating system image on-demand. This includes services such as Amazon EC2, HP Cloud, an OpenStack installation, or your local machine</li>
1128- <li> An SSH key-pair. If you have not already set one up, you can generate an appropriate keypair with:</li>
1129- <pre>ssh-keygen -t rsa -b 2048</pre>
1130+ <li>An Ubuntu or OSX machine to install the client on.</li>
1131+ <li>An environment which can provide a new server with an Ubuntu cloud operating system image on-demand. This includes services such as Amazon EC2, HP Cloud, an OpenStack installation, or your local machine</li>
1132+ <li>An SSH key-pair. If you have not already set one up, you can generate an appropriate keypair with: <code>ssh-keygen -t rsa -b 2048</code></li>
1133 </ul>
1134 </section>
1135 <section id="install">
1136@@ -77,12 +76,12 @@
1137 <div class="terminal-wrap">
1138 <div data-section="ubuntu">
1139 <p>To install Juju, you simply need to grab the latest juju-core package from the PPA:</p>
1140- <pre>sudo add-apt-repository ppa:juju/stable
1141- sudo apt-get update && sudo apt-get install juju-core</pre>
1142+ <pre class="prettyprint lang-bash">sudo add-apt-repository ppa:juju/stable
1143+sudo apt-get update && sudo apt-get install juju-core</pre>
1144 </div>
1145 <div data-section="macosx">
1146 <p>Juju is in <a href="http://brew.sh/">Homebrew</a>, to install do:</p>
1147- <pre>brew install juju</pre>
1148+ <pre class="prettyprint lang-bash">brew install juju</pre>
1149
1150 <p>You can grab the latest pre-relase OSX client from our <a href="https://github.com/juju/juju-core/releases">Github Page</a>. Uncompress the tarball, then you can run the <code>juju</code> command from the terminal. We're in the process of testing these builds to be production ready, so if you have a problem please <a href="https://bugs.launchpad.net/juju-core/+filebug">file a bug</a>.</p>
1151
1152@@ -106,9 +105,9 @@
1153
1154 <p>Now the Juju software is installed, it needs to be configured to use your particular cloud provider. This is done by generating and editing a file, "environments.yaml", which will live in your ~/.juju/ directory. You can generate the environments file manually, but Juju also includes a boilerplate configuration option that will flesh out most of the file for you and minimise the amount of work (and potential errors).</p>
1155 <p>To generate an initial config file, you simply need to run:</p>
1156- <pre><code>juju generate-config -w</code></pre>
1157+ <pre class="prettyprint lang-bash">juju init</pre>
1158
1159- <p>The -w switch causes the file to be written to your ~/.juju directory if an environments.yaml file does not already exist. It will also create the ~./juju directory if that does not exist.</p>
1160+ <p>This command will cause a file to be written to your ~/.juju directory if an environments.yaml file does not already exist. It will also create the ~./juju directory if that does not exist.</p>
1161 <p>This file will contain sample profiles for different types of cloud services, but you will need to edit the files to provide specific information for your cloud provider. Sections are created for Amazon (AWS) services, HPCloud and a generic OpenStack instance. For more specifics on what needs to be changed, see the relevant sections below.</p>
1162 <ul>
1163 <li><a href="config-aws.html">Configuring for Amazon AWS</a></li>
1164@@ -123,84 +122,81 @@
1165 <p>Once you have installed and configured Juju, it is probably a good idea to take it for a bit of a test drive and check that everything is working as expected. Because Juju makes it really easy to deploy services, this is actually quick and straightforward.</p>
1166
1167 <aside>
1168- <iframe class="youtube-player" type="text/html" width="400" height="300" src="//www.youtube.com/embed/0AT6qKyam9I" frameborder="0">
1169- </iframe>
1170+ <iframe class="youtube-player" type="text/html" width="400" height="300" src="//www.youtube.com/embed/0AT6qKyam9I" frameborder="0"></iframe>
1171 </aside>
1172
1173 <p> The first thing to do is set up a bootstrap environment. This is an instance in the cloud that Juju will use to deploy and control other services with. It will be created according to the configuration you have provided, and your SSH key will automatically be uploaded so that Juju can communicate securely with the bootstrap instance. </p>
1174
1175- <pre>juju bootstrap </pre>
1176+ <pre class="prettyprint">juju bootstrap</pre>
1177
1178- <p class="note"><strong>Note:</strong> If you have multiple environments configured, you can choose which one to address with a particular command by adding the -e switch followed by the environment name, E.g. "-e hpcloud".</p>
1179+ <p class="note"><strong>Note:</strong> If you have multiple environments configured, you can choose which one to address with a particular command by adding the <code>-e</code> switch followed by the environment name, E.g. <code>-e hpcloud</code>. Read more about <a href="config-environments.html">environment switching</a></p>
1180
1181 <p>You may have to wait a few moments for this command to return, as it needs to perform various tasks and contact your cloud provider. </p>
1182 <p>Assuming it returns successfully (otherwise see <a href="#errors">common error messages and what to do about them</a>), we can now deploy some services and explore the basic operations of Juju.</p>
1183 <p>To start with, we will deploy Wordpress, by running this command:</p>
1184- <pre>juju deploy wordpress</pre>
1185+ <pre class="prettyprint lang-bash">juju deploy wordpress</pre>
1186 <p>Now juju will fetch the Wordpress charm and use it, through the bootstrap instance to request and deploy whatever resources it needs to set up this service.</p>
1187 <p>Wordpress needs a database though, so we will also deploy one of those:</p>
1188- <pre>juju deploy mysql</pre>
1189+ <pre class="prettyprint">juju deploy mysql</pre>
1190 <p>Once again, juju will do whatever is necessary to deploy this service for you, and it may take some time for the command to return.</p>
1191 <p class="note"><strong>Note:</strong> If you want to get more information on what is actually happening, or to help resolve problems, you can add the -v switch to the juju command to get verbose output.</p>
1192 <p>Although we have deployed Wordpress and a MySQL database, they are not linked together in any way yet. To do this we should run:</p>
1193
1194- <pre>juju add-relation wordpress mysql</pre>
1195+ <pre class="prettyprint">juju add-relation wordpress mysql</pre>
1196
1197 <p>This command uses information provided by the relevant charms to associate these services with each other in whatever way makes sense. There is much more to be said about linking services together which <a href="#add-relation">is covered in the juju command documentation</a>, but for the moment, we just need to know that it will link these services together.</p>
1198 <p>In order to make our Wordpress public, we now need to expose this service:<p>
1199- <pre>juju expose wordpress</pre>
1200+ <pre class="prettyprint">juju expose wordpress</pre>
1201 <p>This service will now be configured to respond to web requests, so visitors can see it. But where exactly is it? If we run the juju status command, we will be able to see what services are running, and where they are located.<p>
1202- <pre>juju status</pre>
1203+ <pre class="prettyprint">juju status</pre>
1204 <p>The output from this command should look something like this:</p>
1205- <pre><code>
1206- $juju status
1207- machines:
1208- &nbsp;&nbsp;"0":
1209- &nbsp;&nbsp;&nbsp;&nbsp;agent-state: started
1210- &nbsp;&nbsp;&nbsp;&nbsp;agent-version: 1.10.0
1211- &nbsp;&nbsp;&nbsp;&nbsp;dns-name: ec2-50-16-167-135.compute-1.amazonaws.com
1212- &nbsp;&nbsp;&nbsp;&nbsp;instance-id: i-781bf614
1213- &nbsp;&nbsp;&nbsp;&nbsp;series: precise
1214- &nbsp;&nbsp;"1":
1215- &nbsp;&nbsp;&nbsp;&nbsp;agent-state: started
1216- &nbsp;&nbsp;&nbsp;&nbsp;agent-version: 1.10.0
1217- &nbsp;&nbsp;&nbsp;&nbsp;dns-name: ec2-23-22-225-54.compute-1.amazonaws.com
1218- &nbsp;&nbsp;&nbsp;&nbsp;instance-id: i-9e8927f6
1219- &nbsp;&nbsp;&nbsp;&nbsp;series: precise
1220- &nbsp;&nbsp;"2":
1221- &nbsp;&nbsp;&nbsp;&nbsp;agent-state: started
1222- &nbsp;&nbsp;&nbsp;&nbsp;agent-version: 1.10.0
1223- &nbsp;&nbsp;&nbsp;&nbsp;dns-name: ec2-54-224-220-210.compute-1.amazonaws.com
1224- &nbsp;&nbsp;&nbsp;&nbsp;instance-id: i-5c440436
1225- &nbsp;&nbsp;&nbsp;&nbsp;series: precise
1226- services:
1227- &nbsp;&nbsp;mysql:
1228- &nbsp;&nbsp;&nbsp;&nbsp;charm: cs:precise/mysql-18
1229- &nbsp;&nbsp;&nbsp;&nbsp;exposed: false
1230- &nbsp;&nbsp;&nbsp;&nbsp;relations:
1231- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;db:
1232- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- wordpress
1233- &nbsp;&nbsp;&nbsp;&nbsp;units:
1234- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mysql/0:
1235- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agent-state: started
1236- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agent-version: 1.10.0
1237- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;machine: "1"
1238- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public-address: ec2-23-22-225-54.compute-1.amazonaws.com
1239- &nbsp;&nbsp;wordpress:
1240- &nbsp;&nbsp;&nbsp;&nbsp;charm: cs:precise/wordpress-12
1241- &nbsp;&nbsp;&nbsp;&nbsp;exposed: true
1242- &nbsp;&nbsp;&nbsp;&nbsp;relations:
1243- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;db:
1244- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- mysql
1245- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loadbalancer:
1246- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- wordpress
1247- &nbsp;&nbsp;&nbsp;&nbsp;units:
1248- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wordpress/0:
1249- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agent-state: started
1250- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agent-version: 1.10.0
1251- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;machine: "2"
1252- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public-address: ec2-54-224-220-210.compute-1.amazonaws.com
1253- </code></pre>
1254+ <pre class="prettyprint lang-yaml">
1255+machines:
1256+ "0":
1257+ agent-state: started
1258+ agent-version: 1.10.0
1259+ dns-name: ec2-50-16-167-135.compute-1.amazonaws.com
1260+ instance-id: i-781bf614
1261+ series: precise
1262+ "1":
1263+ agent-state: started
1264+ agent-version: 1.10.0
1265+ dns-name: ec2-23-22-225-54.compute-1.amazonaws.com
1266+ instance-id: i-9e8927f6
1267+ series: precise
1268+ "2":
1269+ agent-state: started
1270+ agent-version: 1.10.0
1271+ dns-name: ec2-54-224-220-210.compute-1.amazonaws.com
1272+ instance-id: i-5c440436
1273+ series: precise
1274+services:
1275+ mysql:
1276+ charm: cs:precise/mysql-18
1277+ exposed: false
1278+ relations:
1279+ db:
1280+ - wordpress
1281+ units:
1282+ mysql/0:
1283+ agent-state: started
1284+ agent-version: 1.10.0
1285+ machine: "1"
1286+ public-address: ec2-23-22-225-54.compute-1.amazonaws.com
1287+ wordpress:
1288+ charm: cs:precise/wordpress-12
1289+ exposed: true
1290+ relations:
1291+ db:
1292+ - mysql
1293+ loadbalancer:
1294+ - wordpress
1295+ units:
1296+ wordpress/0:
1297+ agent-state: started
1298+ agent-version: 1.10.0
1299+ machine: "2"
1300+ public-address: ec2-54-224-220-210.compute-1.amazonaws.com</pre>
1301 <p>There is quite a lot of information here. the first section, titled <strong>machines:</strong>, details all the instances which are currently running. For each you will see the version of Juju they are running, their hostname, instance id and the series or version of Ubuntu they are running.</p>
1302 <p>After that, the sections list the services which are currently deployed. The information here differs slightly according to the service and how it is configured. It will however, always list the charm that was used to deploy the service, whether it is exposed or not, its address and whatever relationships exist.</p>
1303 <p>From this status readout, we can see that wordpress is exposed and ready. If we simply copy the address into a web browser, we should be able to see it running</p>
1304@@ -208,7 +204,7 @@
1305 <p>Congratulations, you have just deployed a service with Juju!</p>
1306 <p>Now you are ready to deploy whatever service you really want from the 100s available at the <a href="http://jujucharms.com">Juju Charm Store.</a></p>
1307 <p>To remove all current deployments and clear up everything in your cloud, you can run the command:</p>
1308- <pre><code>juju destroy-environment </code></pre>
1309+ <pre class="prettyprint">juju destroy-environment</pre>
1310 <p>This will remove everything, including the bootstrap node.</p>
1311 <p>To learn more about charms, including configuring options and managing running systems, you should continue to <a href="./charms.html">read the charm documentation.</a></p>
1312 </section>
1313@@ -269,6 +265,7 @@
1314 <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p>
1315 </div>
1316 </div>
1317+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
1318 </footer>
1319
1320 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
1321
1322=== modified file 'htmldocs/glossary.html'
1323--- htmldocs/glossary.html 2013-08-22 13:55:23 +0000
1324+++ htmldocs/glossary.html 2013-08-31 16:07:11 +0000
1325@@ -68,19 +68,17 @@
1326
1327 <p><strong>Charm URL</strong> - A Charm URL is a resource locator for a charm, with the following format and restrictions:</p>
1328
1329- <pre><code>
1330- &LT;schema&GT;:[~&LT;user&GT;/]&LT;collection&GT;/&LT;name&GT;[-&LT;revision&GT;]
1331- </code></pre>
1332-
1333- <p><span class="pre">schema</span> must be either "cs", for a charm from the Juju charm store, or "local", for a charm from a local repository.</p>
1334-
1335- <p><span class="pre">user</span> is only valid in charm store URLs, and allows you to source charms from individual users (rather than from the main charm store); it must be a valid Launchpad user name.</p>
1336-
1337- <p><span class="pre">collection</span> denotes a charm's purpose and status, and is derived from the Ubuntu series targeted by its contained charms: examples include "precise", "quantal", "oneiric-universe".</p>
1338-
1339- <p><span class="pre">name</span> is just the name of the charm; it must start and end with lowercase (ascii) letters, and can otherwise contain any combination of lowercase letters, digits, and "-"s.</p>
1340-
1341- <p><span class="pre">revision</span>, if specified, points to a specific revision of the charm pointed to by the rest of the URL. It must be a non-negative integer.</p>
1342+ <pre class="prettyprint">&LT;schema&GT;:[~&LT;user&GT;/]&LT;collection&GT;/&LT;name&GT;[-&LT;revision&GT;]</pre>
1343+
1344+ <p><code>schema</code> must be either "cs", for a charm from the Juju charm store, or "local", for a charm from a local repository.</p>
1345+
1346+ <p><code>user</code> is only valid in charm store URLs, and allows you to source charms from individual users (rather than from the main charm store); it must be a valid Launchpad user name.</p>
1347+
1348+ <p><code>collection</code> denotes a charm's purpose and status, and is derived from the Ubuntu series targeted by its contained charms: examples include "precise", "quantal", "oneiric-universe".</p>
1349+
1350+ <p><code>name</code> is just the name of the charm; it must start and end with lowercase (ascii) letters, and can otherwise contain any combination of lowercase letters, digits, and "-"s.</p>
1351+
1352+ <p><code>revision</code>, if specified, points to a specific revision of the charm pointed to by the rest of the URL. It must be a non-negative integer.</p>
1353
1354 <p><strong>Repository </strong> - A location where multiple charms are stored. Repositories may be as simple as a directory structure on a local disk, or as complex as a rich smart server supporting remote searching and so on. </p>
1355
1356@@ -165,6 +163,7 @@
1357 <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p>
1358 </div>
1359 </div>
1360+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
1361 </footer>
1362
1363 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
1364
1365=== modified file 'htmldocs/howto-node.html'
1366--- htmldocs/howto-node.html 2013-08-30 21:17:34 +0000
1367+++ htmldocs/howto-node.html 2013-08-31 16:07:11 +0000
1368@@ -84,58 +84,43 @@
1369 <p>
1370 First, create a <code>config.yaml</code> to add info about your app pointing to your github repo:
1371 </p>
1372- <pre>
1373-<code>sample-node:
1374- repo: https://github.com/yourapplication</code>
1375-</pre>
1376+ <pre class="prettyprint lang-yaml">
1377+sample-node:
1378+ repo: https://github.com/yourapplication</pre>
1379 <p>
1380 If you have not already bootstrapped an environment, do so:
1381 </p>
1382- <pre>
1383-<code>juju bootstrap</code>
1384-</pre>
1385+ <pre class="prettyprint">juju bootstrap</pre>
1386 <p>
1387 Then wait a few minutes while your cloud spins up. Then deploy some basic services:
1388 </p>
1389- <pre>
1390-<code>juju deploy node-app myapp
1391+ <pre class="prettyprint">juju deploy node-app myapp
1392 juju deploy mongodb
1393-juju deploy haproxy</code>
1394-</pre>
1395+juju deploy haproxy</pre>
1396 <p>
1397 relate them
1398 </p>
1399- <pre>
1400-<code>juju add-relation mongodb myapp
1401-juju add-relation myapp haproxy</code>
1402-</pre>
1403+ <pre class="prettyprint">juju add-relation mongodb myapp
1404+juju add-relation myapp haproxy</pre>
1405 <p>
1406 open it up to the outside world
1407 </p>
1408- <pre>
1409-<code>juju expose haproxy</code>
1410-</pre>
1411+ <pre class="prettyprint">juju expose haproxy</pre>
1412 <p>
1413 Find the haproxy instance's public URL from
1414 </p>
1415- <pre>
1416-<code>juju status</code>
1417-</pre>
1418+ <pre class="prettyprint">juju status</pre>
1419 <p>
1420 (or attach it to an elastic IP via the AWS console) and open it up in a browser.
1421 </p>
1422 <p>
1423 scale up your app (to 10 nodes for example)
1424 </p>
1425- <pre>
1426-<code>juju add-unit -n 10 myapp</code>
1427-</pre>
1428+ <pre class="prettyprint">juju add-unit -n 10 myapp</pre>
1429 <p>
1430 and scale it back down
1431 </p>
1432- <pre>
1433-<code>juju remove-unit -n9 myapp</code>
1434-</pre>
1435+ <pre class="prettyprint">juju remove-unit myapp/9 myapp/8 myapp/7 myapp/6 myapp/5 myapp/4 myapp/3 myapp/2 myapp/1</pre>
1436 <h2 id="local-to-cloud-workflow">
1437 Local to Cloud Workflow
1438 </h2>
1439@@ -165,30 +150,24 @@
1440 <p>
1441 In this example the local environment is named <code>local</code> and we'll deploy to an AWS environment called <code>amazon</code>. First let's <code>switch</code> to the local environment and bootstrap.
1442 </p>
1443- <pre>
1444-<code>juju switch local
1445-juju bootstrap</code>
1446-</pre>
1447+ <pre class="prettyprint">juju switch local
1448+juju bootstrap</pre>
1449 <p>
1450 Create a <code>config.yaml</code> to add info about your app pointing to your github repo:
1451 </p>
1452- <pre>
1453-<code>sample-node:
1454- app_url: https://github.com/yourapplication</code>
1455-</pre>
1456+ <pre class="prettyprint lang-yaml">
1457+sample-node:
1458+ app_url: https://github.com/yourapplication</pre>
1459 <p>
1460 Then deploy some basic services:
1461 </p>
1462- <pre>
1463-<code>juju deploy --config ~/myapp.yaml node-app myapp
1464-juju deploy mongodb</code>
1465-</pre>
1466+ <pre class="prettyprint">
1467+juju deploy --config ~/myapp.yaml node-app myapp
1468+juju deploy mongodb</pre>
1469 <p>
1470 relate them
1471 </p>
1472- <pre>
1473-<code>juju add-relation mongodb myapp</code>
1474-</pre>
1475+ <pre class="prettyprint">juju add-relation mongodb myapp</pre>
1476 <p>
1477 Now open up your browser and go to <code>http://localhost</code> to get your application loaded in your browser.
1478 </p>
1479@@ -198,9 +177,7 @@
1480 <p>
1481 Continue to write your code, push to git as you land features and fixes. When you're ready to test it you can tell Juju to check the git repository again:
1482 </p>
1483- <pre>
1484-<code>juju set myapp app_branch=https://github.com/yourapplication</code>
1485-</pre>
1486+ <pre class="prettyprint">juju set myapp app_branch=https://github.com/yourapplication</pre>
1487 <p>
1488 The charm will then fetch the latest code and you can refresh your browser at <code>http://localhost</code>.
1489 </p>
1490@@ -213,35 +190,29 @@
1491 <p>
1492 After you've repeatedly upgraded your application locally it's time to push it out to a place where your coworkers can see your app in all it's glory, let's push this to AWS. Same exact commands as before, just to a different environment:
1493 </p>
1494- <pre>
1495-<code>juju switch amazon
1496+ <pre class="prettyprint">
1497+juju switch amazon
1498 juju bootstrap
1499 juju deploy --config ~/myapp.yaml node-app myapp
1500 juju deploy mongodb
1501-juju add-relation mongodb myapp</code>
1502-</pre>
1503+juju add-relation mongodb myapp</pre>
1504 <p>
1505 Since we're on a public cloud and not on a local provider we need to explicitly expose the service and get its public IP:
1506 </p>
1507- <pre>
1508-<code>juju expose myapp
1509-juju status myapp</code>
1510-</pre>
1511+ <pre class="prettyprint">juju expose myapp
1512+juju status myapp</pre>
1513 <p>
1514 And put the ec2 URL in your browser. If you want to enable some horizontal scalability to your application you can do so, even after you've deployed!
1515 </p>
1516- <pre>
1517-<code>juju deploy haproxy
1518+ <pre class="prettyprint">
1519+juju deploy haproxy
1520 juju add-relation haproxy myapp
1521 juju expose haproxy
1522-juju unexpose myapp</code>
1523-</pre>
1524+juju unexpose myapp</pre>
1525 <p>
1526 And then get the public IP from the haproxy instead (notice how we've unexposed your application so that only haproxy is serving the public internet):
1527 </p>
1528- <pre>
1529-<code>juju status haproxy</code>
1530-</pre>
1531+ <pre class="prettyprint">juju status haproxy</pre>
1532 <p>
1533 Now you can <code>juju add-unit myapp</code> and <code>juju remove-unit myapp</code> based on load.
1534 </p>
1535@@ -251,10 +222,9 @@
1536 <p>
1537 The local containers survive reboots and do not go away until you explicitly tear the environment down. Now that your coworkers have seen your great application let's also stop spending money:
1538 </p>
1539- <pre>
1540-<code>juju destroy-environment -eamazon
1541-juju destroy-environment -local</code>
1542-</pre>
1543+ <pre class="prettyprint">
1544+juju destroy-environment -e amazon
1545+juju destroy-environment -e local</pre>
1546 <h2 id="charm-details">
1547 Charm Details
1548 </h2>
1549@@ -294,9 +264,7 @@
1550 <p>
1551 Configurable aspects of the charm are listed in <code>config.yaml</code> and can be set by either editing the default values directly in the yaml file or passing a <code>myapp.yaml</code> configuration file during deployment
1552 </p>
1553- <pre>
1554-<code>juju deploy --config ~/myapp.yaml node-app myapp</code>
1555-</pre>
1556+ <pre class="prettyprint">juju deploy --config ~/myapp.yaml node-app myapp</pre>
1557 <p>
1558 Some of these parameters are used directly by the charm, and some are passed through to the node app using <code>config/config.js</code>.
1559 </p>
1560@@ -306,52 +274,45 @@
1561 <p>
1562 The formula looks for <code>config/config.js</code> in your app which starts off looking something like this
1563 </p>
1564- <pre>
1565-<code>module.exports = config = {
1566+ <pre class="prettyprint">
1567+module.exports = config = {
1568 "name" : "mynodeapp"
1569 ,"listen_port" : 8000
1570 ,"mongo_host" : "localhost"
1571 ,"mongo_port" : 27017
1572-}</code>
1573-</pre>
1574+}</pre>
1575 <p>
1576 and gets modified with contextually correct configuration information during either deployment (via the <code>install</code> hook) or relation to another service (<code>relation-changed</code> hook).
1577 </p>
1578 <p>
1579 This config can be used from within your application using snippets like
1580 </p>
1581- <pre>
1582-<code>...
1583+ <pre class="prettyprint lang-js">
1584+...
1585 var config = require('./config/config')
1586 ...
1587 new mongo.Server(config.mongo_host, config.mongo_port, {}),
1588 ...
1589 server.listen(config.listen_port);
1590-...</code>
1591-</pre>
1592+...</pre>
1593 <p>
1594 Alternatively you could use a &acirc;&euro;&oelig;Procfile&acirc;&euro; in root directory like this:
1595 </p>
1596- <pre>
1597-<code>web: node app.js</code>
1598-</pre>
1599+ <pre class="prettyprint lang-js">web: node app.js</pre>
1600 <p>
1601 and then get the environment variables from the running environment like this:
1602 </p>
1603- <pre>
1604-<code>app.set('port', process.env.PORT);</code>
1605-</pre>
1606+ <pre class="prettyprint lang-js">app.set('port', process.env.PORT);</pre>
1607 <p>
1608 The defined environment variables are:
1609 </p>
1610- <pre>
1611-<code>NAME
1612+ <pre class="prettyprint">
1613+NAME
1614 PORT
1615 NODE_ENV
1616 MONGO_HOST
1617 MONGO_PORT
1618-MONGO_REPLSET</code>
1619-</pre>
1620+MONGO_REPLSET</pre>
1621 <h3 id="network-access">
1622 Network access
1623 </h3>
1624@@ -361,15 +322,11 @@
1625 <p>
1626 If your node app is itself a proxy and you want it directly exposed, this can easily be done by adding
1627 </p>
1628- <pre>
1629-<code>open-port $app_port</code>
1630-</pre>
1631+ <pre class="prettyprint">open-port $app_port</pre>
1632 <p>
1633 to the bottom of the <code>install</code> hook, and then once your stack is started, you expose
1634 </p>
1635- <pre>
1636-<code>juju expose myapp</code>
1637-</pre>
1638+ <pre class="prettyprint">juju expose myapp</pre>
1639 <p>
1640 it to the outside world.
1641 </p>
1642@@ -442,6 +399,7 @@
1643 <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p>
1644 </div>
1645 </div>
1646+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
1647 </footer>
1648
1649 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
1650
1651=== modified file 'htmldocs/reference-constraints.html'
1652--- htmldocs/reference-constraints.html 2013-08-30 17:35:59 +0000
1653+++ htmldocs/reference-constraints.html 2013-08-31 16:07:11 +0000
1654@@ -53,10 +53,9 @@
1655
1656 <section id="content" class="container-12">
1657 <div class="grid-12 doc-container">
1658- <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
1659+ <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
1660 <div class="grid-9 doc-content">
1661 <article>
1662-
1663 <section id="constraints">
1664 <h1>Constraints</h1>
1665

Subscribers

People subscribed via source and target branches