Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(706)

Side by Side Diff: doc/charms-in-action.txt

Issue 50090044: Add the environment name to the hooks context.
Patch Set: Add the environment name to the hooks context. Created 11 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « [revision details] ('k') | state/api/params/internal.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Charms in action 1 Charms in action
2 ================ 2 ================
3 3
4 This document describes the behaviour of the go implementation of the unit 4 This document describes the behaviour of the go implementation of the unit
5 agent, whose behaviour differs in some respects from that of the python 5 agent, whose behaviour differs in some respects from that of the python
6 implementation. This information is largely relevant to charm authors, and 6 implementation. This information is largely relevant to charm authors, and
7 potentially to developers interested in the unit agent. 7 potentially to developers interested in the unit agent.
8 8
9 Hooks 9 Hooks
10 ----- 10 -----
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 Every hook is run in the deployed charm directory, in an environment with the 97 Every hook is run in the deployed charm directory, in an environment with the
98 following characteristics: 98 following characteristics:
99 99
100 * $PATH is prefixed by a directory containing command line tools through 100 * $PATH is prefixed by a directory containing command line tools through
101 which the hooks can interact with juju. 101 which the hooks can interact with juju.
102 * $CHARM_DIR holds the path to the charm directory. 102 * $CHARM_DIR holds the path to the charm directory.
103 * $JUJU_UNIT_NAME holds the name of the local unit. 103 * $JUJU_UNIT_NAME holds the name of the local unit.
104 * $JUJU_CONTEXT_ID and $JUJU_AGENT_SOCKET are set (but should not be messed 104 * $JUJU_CONTEXT_ID and $JUJU_AGENT_SOCKET are set (but should not be messed
105 with: the command line tools won't work without them). 105 with: the command line tools won't work without them).
106 * $JUJU_API_ADDRESSES holds a space separated list of juju API addresses. 106 * $JUJU_API_ADDRESSES holds a space separated list of juju API addresses.
107 * $JUJU_ENV_NAME holds the human friendly name of the current environment.
107 108
108 Hook tools 109 Hook tools
109 ---------- 110 ----------
110 111
111 All hooks can directly use the following tools: 112 All hooks can directly use the following tools:
112 113
113 * juju-log (write arguments direct to juju's log (potentially redundant, hook 114 * juju-log (write arguments direct to juju's log (potentially redundant, hook
114 output is all logged anyway, but --debug may remain useful)) 115 output is all logged anyway, but --debug may remain useful))
115 * unit-get (returns the local unit's private-address or public-address) 116 * unit-get (returns the local unit's private-address or public-address)
116 * open-port (marks the supplied port/protocol as ready to open when the 117 * open-port (marks the supplied port/protocol as ready to open when the
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 Facilities are currently not good. 346 Facilities are currently not good.
346 347
347 * juju ssh 348 * juju ssh
348 * juju debug-hooks [TODO: not implemented] 349 * juju debug-hooks [TODO: not implemented]
349 * juju debug-log [TODO: not implemented] 350 * juju debug-log [TODO: not implemented]
350 351
351 It may be helpful to note that the charm directory is a git repository that 352 It may be helpful to note that the charm directory is a git repository that
352 holds the complete hook-by-hook history of the deployment. This property is 353 holds the complete hook-by-hook history of the deployment. This property is
353 not guaranteed, and charms should not depend upon it, but humans who need to 354 not guaranteed, and charms should not depend upon it, but humans who need to
354 dig around in charm directories should be aware of it. 355 dig around in charm directories should be aware of it.
OLDNEW
« no previous file with comments | « [revision details] ('k') | state/api/params/internal.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b