OLD | NEW |
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 Loading... |
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 Loading... |
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. |
OLD | NEW |