Merge lp:~evilnick/juju-core/docs-environments into lp:juju-core/docs

Proposed by Nick Veitch
Status: Merged
Approved by: Nick Veitch
Approved revision: no longer in the source branch.
Merged at revision: 143
Proposed branch: lp:~evilnick/juju-core/docs-environments
Merge into: lp:juju-core/docs
Diff against target: 269 lines (+230/-2)
4 files modified
htmldocs/authors-charm-config.html (+1/-1)
htmldocs/charms-environments.html (+226/-0)
htmldocs/navigation.html (+1/-0)
htmldocs/navigation.json (+2/-1)
To merge this branch: bzr merge lp:~evilnick/juju-core/docs-environments
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+190429@code.launchpad.net

Commit message

added page on managing environments

Description of the change

Add section on managing environments

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
=== modified file 'htmldocs/authors-charm-config.html'
--- htmldocs/authors-charm-config.html 2013-10-10 01:00:24 +0000
+++ htmldocs/authors-charm-config.html 2013-10-10 17:08:29 +0000
@@ -155,7 +155,7 @@
155</section>155</section>
156156
157 </article>157 </article>
158</article>158
159<!--Postamble-->159<!--Postamble-->
160 </div>160 </div>
161 </div>161 </div>
162162
=== added file 'htmldocs/charms-environments.html'
--- htmldocs/charms-environments.html 1970-01-01 00:00:00 +0000
+++ htmldocs/charms-environments.html 2013-10-10 17:08:29 +0000
@@ -0,0 +1,226 @@
1<!DOCTYPE html>
2<html>
3<!--Head-->
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>Juju Documentation</title>
7 <script src="/wp-content/themes/ubuntu/library/js/all-yui.js"></script>
8 <link href="https://fonts.googleapis.com/css?family=Ubuntu:400,300,300italic,400italic,700,700italic|Ubuntu+Mono" rel="stylesheet" type="text/css">
9 <link rel="stylesheet" type="text/css" media="screen" href="https://juju.ubuntu.com/wp-content/themes/juju-website/css/reset.css">
10 <link rel="shortcut icon" href="//assets.ubuntu.com/sites/ubuntu/latest/u/img/favicon.ico" />
11 <link rel="stylesheet" type="text/css" media="screen" href="//assets.ubuntu.com/sites/guidelines/css/latest/ubuntu-styles.css" />
12 <link rel="stylesheet" type="text/css" media="screen" href="//assets.ubuntu.com/sites/ubuntu/latest/u/css/global.css" />
13 <link rel="stylesheet" type="text/css" media="screen" href="https://juju.ubuntu.com/wp-content/themes/juju-website/css/960.css">
14 <link rel="stylesheet" type="text/css" media="screen" href="https://juju.ubuntu.com/wp-content/themes/juju-website/css/home-new.css">
15 <link rel="stylesheet" id="stacktack-css" href="https://juju.ubuntu.com/wp-content/plugins/stacktack/css/stacktack.min.css?ver=3.4.2" type="text/css" media="all">
16 <link href="./css/main.css" rel="stylesheet" type="text/css">
17
18 <!--[if lt IE 9]>
19 <script type="text/javascript" src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
20 <![endif]-->
21 </head>
22<!--End-Head-->
23
24
25
26 <body class="resources">
27<!--Header-->
28
29 <header class="banner global" role="banner">
30 <nav role="navigation" class="nav-primary nav-right">
31 <div class="logo">
32 <a class="logo-ubuntu" href="https://juju.ubuntu.com/">
33 <img width="118" height="27" src="//assets.ubuntu.com/sites/ubuntu/latest/u/img/logo.png" alt="Juju logo" />
34 <span>Juju</span>
35 </a>
36 </div>
37 <ul>
38 <li class="accessibility-aid"><a accesskey="s" href="#main-content">Jump to content</a></li>
39 <li class="page_item page-item-8"><a href="https://juju.ubuntu.com/charms/">Charms</a></li>
40 <li class="page_item page-item-10"><a href="https://juju.ubuntu.com/features/">Features</a></li>
41 <li class="page_item page-item-12"><a href="https://juju.ubuntu.com/deployment/">Deploy</a></li>
42 <li class="page_item page-item-14"><a href="https://juju.ubuntu.com/resources/">Resources</a></li>
43 <li class="page_item page-item-16"><a href="https://juju.ubuntu.com/community/">Community</a></li>
44 <li class="page_item page-item-18"><a href="https://juju.ubuntu.com/download/">Install Juju</a></li>
45 </ul>
46 <div id="box-search">
47 <form class="search-form" method="get" id="searchform" action="https://juju.ubuntu.com/">
48 <label class="off-left" for="s">Search:</label>
49 <input class="form-text" type="text" value="" name="s" id="s" />
50 <button class="off-left form-submit" type="submit" id="searchsubmit">Search</button>
51 </form>
52 </div>
53 </nav>
54 </header>
55<!--End-Header-->
56<!--Preamble-->
57<div class="wrapper">
58 <div id="main-content" class="inner-wrapper" role="main">
59 <div class="row no-border">
60 <div class="header-navigation-secondary"></div>
61 <h2 class="pagetitle">Juju documentation</h2>
62 </div>
63 <section id="content" class="container-12">
64 <div class="grid-12 doc-container">
65 <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
66 <div class="grid-9 doc-content">
67<!--End-Preamble-->
68<article>
69 <section id='environments'>
70 <h1>Managing environments</h1>
71 <p>Juju can be used to manage multiple clouds on different environments. The environments themselves need only be defined in the <code>environments.yaml</code> file as more fully described in the configuration section of the documentation. It is entirely possible to have multiple environments with the same cloud provider (providing they are of course separate environments on the cloud too) or across all the different types of supported cloud providers.</p>
72
73 <h2 id="environment-identifying">Identifying the current environment</h2>
74 <p>The order of precedence for determining the environment a command will be executed on is:</p>
75 <ol>
76 <li> The environment specified by the use of the <code>-e</code> switch.</li>
77 <li> The environment set by the <code>JUJU_ENV</code> environment variable.</li>
78 <li> The environment last specified with the <code>switch</code> command. </li>
79 <li> The environment specified as the default in <code>environments.yaml</code>.</li>
80 </ol>
81<p>Currently it is possible to determine which environment a command will act on by checking the <code>JUJU_ENV</code> variable, and if that is empty, the contents of the file <code>~/.juju/current-environment</code>:</p>
82<pre class="prettyprint lang-bash">
83echo $JUJU_ENV
84
85cat ~/.juju/current-environment
86</pre>
87
88
89 <h2 id="environment-e">Specifying an environment</h2>
90 <p> You can use the <code>-e</code> switch with a Juju command, followed by a valid environment label, to specify that the command should be run against that environment. Using the <code>-e</code> switch takes precedence over any other setting.<p>
91 <p> For example:</p>
92<pre class="prettyprint lang-bash">
93juju bootstrap # bootstraps the default environment
94juju switch amazon # switches the environment to the cloud defined by 'amazon'
95juju deploy mysql -e mycloud # deploys mysql charm on the cloud defined by 'mycloud'
96</pre>
97
98
99 <h2 id="environment-switch">Switching environments</h2>
100 <p> When managing several cloud environments, it can be bothersome to issue a long list of commands and remember to prepend the <code>-e</code> switch to each one. For this reason, you can switch the current environment using the <code>switch</code> command:</p>
101
102<pre class="prettyprint lang-bash">
103juju switch hpcloud
104juju bootstrap
105</pre>
106 <p>... will bootstrap the environment defined by the 'hpcloud' label</p>
107 <p>This command will return with an error message if <code>JUJU_ENV</code>is set (as this takes precedence)</p>
108<p class="note"><strong>Note: </strong>The environment selected with <code>switch</code> is persistent. Even if you log out, switch your computer off, travel into space or sail around the world, when you start using Juju again, it will still point at the last environment you specified with <code>switch</code>.</p>
109
110
111
112 <h2 id="environment-default">Default environment</h2>
113 <p>The default environment is the environment which will be used if you have not issued a <a href="#environment-switch"><code>switch</code> command</a> and do not specify an environment to use with the <code>-e</code> switch or alter the <code>JUJU_ENV</code> environment variable. The default environment is specified at the top of the <code>environments.yaml</code> file, before the environment specifications themselves, like this:</p>
114<pre class="prettyprint lang-yaml">
115...
116default: amazon
117
118environments:
119 ## https://juju.ubuntu.com/docs/config-openstack.html
120 openstack:
121...
122</pre>
123
124
125 <h2 id="environment-update">Updating environments</h2>
126 <p>Juju will attempt to maintain a high degree of legacy compatibility for the environments.yaml definitions, so you should be able to update to stable versions of the software without worring about reconfiguring your environments each time. However, new releases do sometimes add support for new cloud providers, add additional settings or change to adapt to configuration changes for the providers themselves. In these cases it can be useful to generate a new boilerplate <code>environmants.yaml</code> so you can easily manually edit your own configurations or cut and paste new environments into your existing configuration.<p>
127 <p>To generate a new boilerplate <code>environments.yaml</code> file direct to the console you can use:</p>
128<pre class="prettyprint lang-bash">
129juju generate-config --show
130</pre>
131 <p> Or:</p>
132<pre class="prettyprint lang-bash">
133juju init --show
134</pre>
135<p>as the <code>init</code>command is an alias for <code>generate-config</code>.</p>
136</section>
137</article>
138<!--Postamble-->
139 </div>
140 </div>
141 </section>
142 </div>
143</div>
144<!--End-Postamble-->
145<!--Footer-->
146 <footer class="global clearfix" role="contentinfo">
147 <nav role="navigation">
148 <div class="footer-a">
149 <div class="clearfix">
150 <ul>
151 <li>
152 <h2><a href="/">Juju</a></h2>
153 <ul>
154 <li><a href="/charms">Charms</a></li>
155 <li><a href="/features">Features</a></li>
156 <li><a href="/deployment">Deployment</a></li>
157 </ul>
158 </li>
159 <li>
160 <h2><a href="/resources">Resources</a></h2>
161 <ul>
162 <li><a href="/resources/juju-overview/">Overview</a></li>
163 <li><a href="/docs/">Documentation</a></li>
164 <li><a href="/resources/the-juju-gui/">The Juju web UI</a></li>
165 <li><a href="/docs/authors-charm-store.html">The charm store</a></li>
166 <li><a href="/docs/getting-started.html#test">Tutorial</a></li>
167 <li><a href="/resources/videos/">Videos</a></li>
168 <li><a href="/resources/easy-tasks-for-new-developers/">Easy tasks for new developers</a></li>
169 </ul>
170 </li>
171 <li>
172 <h2><a href="/community">Community</a></h2>
173 <ul>
174 <li><a href="/community/blog/">Juju Blog</a></li>
175 <li><a href="/events/">Events</a></li>
176 <li><a href="/community/weekly-charm-meeting/">Weekly charm meeting</a></li>
177 <li><a href="/community/charmers/">Charmers</a></li>
178 <li><a href="/docs/authors-charm-writing.html">Write a charm</a></li>
179 <li><a href="/docs/contributing.html">Help with documentation</a></li>
180 <li><a href="https://bugs.launchpad.net/juju-website/+filebug">File a bug</a></li> <li><a href="/labs/">Juju Labs</a></li>
181 </ul>
182 </li>
183 <li>
184 <h2><a href="https://jujucharms.com/sidebar/">Try Juju</a></h2>
185 <ul>
186 <li><a href="https://jujucharms.com/">Charm store</a></li>
187 <li><a href="/download/">Download Juju</a></li>
188 </ul>
189 </li>
190 </ul>
191 </div>
192 </div>
193 </nav>
194 <div class="legal clearfix">
195 <p>&copy; 2013 Canonical Ltd. Ubuntu and Canonical are registered trademarks of <a href="http://canonical.com">Canonical Ltd</a>.</p>
196 </div>
197 </footer>
198
199<!--End-Footer-->
200<!--Scripts-->
201 <script src="//google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
202 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
203 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js"></script>
204 <script src="//d38yea5fb4e2oh.cloudfront.net/jquery.stacktack.min.js"></script>
205 <script type="text/javascript" src="//code.jquery.com/jquery-1.9.1.js"></script>
206 <script type="text/javascript" src="./js/main.js"></script>
207 <script type="text/javascript" src="./js/jquery.details.js"></script>
208 <script src="//assets.ubuntu.com/sites/ubuntu/latest/u/js/core.js"></script>
209 <script src="//assets.ubuntu.com/sites/ubuntu/latest/u/js/global.js"></script>
210 <!-- google analytics -->
211 <script>
212 var _gaq = _gaq || [];
213 _gaq.push(['_setAccount', 'UA-1018242-41']);
214 _gaq.push(['_trackPageview']);
215
216 (function() {
217 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
218 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
219 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
220 })();
221 </script>
222<!--End-Scripts-->
223
224
225
226</body></html>
0227
=== modified file 'htmldocs/navigation.html'
--- htmldocs/navigation.html 2013-10-09 20:04:32 +0000
+++ htmldocs/navigation.html 2013-10-10 17:08:29 +0000
@@ -17,6 +17,7 @@
17 <li class=" sub"><a href="charms-scaling.html">Scaling Services</a></li>17 <li class=" sub"><a href="charms-scaling.html">Scaling Services</a></li>
18 <li class=" sub"><a href="charms-service-groups.html">Groups of Services</a></li>18 <li class=" sub"><a href="charms-service-groups.html">Groups of Services</a></li>
19 <li class=" sub"><a href="charms-destroy.html">Destroying Services</a></li>19 <li class=" sub"><a href="charms-destroy.html">Destroying Services</a></li>
20 <li class=" sub"><a href="charms-environments.html">Managing environments</a></li>
20 <li class=""><a href="howto.html">How to...</a></li>21 <li class=""><a href="howto.html">How to...</a></li>
21 <li class=" sub"><a href="howto-node.html">Deploy a Node.js app</a></li>22 <li class=" sub"><a href="howto-node.html">Deploy a Node.js app</a></li>
22 <li class=" sub"><a href="howto-rails.html">Test and deploy on Rails</a></li>23 <li class=" sub"><a href="howto-rails.html">Test and deploy on Rails</a></li>
2324
=== modified file 'htmldocs/navigation.json'
--- htmldocs/navigation.json 2013-10-09 20:04:32 +0000
+++ htmldocs/navigation.json 2013-10-10 17:08:29 +0000
@@ -22,7 +22,8 @@
22 "Exposing Services": "charms-exposing.html",22 "Exposing Services": "charms-exposing.html",
23 "Scaling Services": "charms-scaling.html", 23 "Scaling Services": "charms-scaling.html",
24 "Groups of Services": "charms-service-groups.html",24 "Groups of Services": "charms-service-groups.html",
25 "Destroying Services": "charms-destroy.html"25 "Destroying Services": "charms-destroy.html",
26 "Managing environments": "charms-environments.html"
26 }27 }
27 },28 },
28 "How to...": {29 "How to...": {

Subscribers

People subscribed via source and target branches