4
juju is devops distilled.
6
Juju enables you to use [Charms](http://juju.ubuntu.com/charms) to deploy your application architectures to EC2, OpenStack,
7
Azure, HP your data center and even your own Ubuntu based laptop.
8
Moving between models is simple giving you the flexibility to switch hosts
9
whenever you want — for free.
11
For more information, see the [docs](https://jujucharms.com/docs/stable/getting-started).
16
`juju` is written in Go (http://golang.org), a modern, compiled, statically typed,
17
concurrent language. This document describes how to build `juju` from source.
19
If you are looking for binary releases of `juju`, they are available from the Juju
20
stable PPA, `https://launchpad.net/~juju/+archive/stable`, and can be installed with:
22
sudo apt-add-repository ppa:juju/stable
24
sudo apt-get install juju
29
When working with the source of Go programs, you should define a path within
30
your home directory (or other workspace) which will be your `GOPATH`. `GOPATH`
31
is similar to Java's `CLASSPATH` or Python's `~/.local`. `GOPATH` is documented
32
online at `http://golang.org/pkg/go/build/` and inside the `go` tool itself
36
Various conventions exist for naming the location of your `GOPATH`, but it should
37
exist, and be writable by you. For example
39
export GOPATH=${HOME}/work
42
will define and create `$HOME/work` as your local `GOPATH`. The `go` tool itself
43
will create three subdirectories inside your `GOPATH` when required; `src`, `pkg`
44
and `bin`, which hold the source of Go programs, compiled packages and compiled
45
binaries, respectively.
47
Setting `GOPATH` correctly is critical when developing Go programs. Set and
48
export it as part of your login script.
50
Add `$GOPATH/bin` to your `PATH`, so you can run the go programs you install:
52
PATH="$GOPATH/bin:$PATH"
58
The easiest way to get the source for `juju` is to use the `go get` command.
60
go get -d -v github.com/juju/juju/...
62
This command will checkout the source of `juju` and inspect it for any unmet
63
Go package dependencies, downloading those as well. `go get` will also build and
64
install `juju` and its dependencies. To checkout without installing, use the
65
`-d` flag. More details on the `go get` flags are available using
69
At this point you will have the git local repository of the `juju` source at
70
`$GOPATH/github.com/juju/juju`. The source for any dependent packages will
71
also be available inside `$GOPATH`. You can use `git pull --rebase`, or the
72
less convenient `go get -u github.com/juju/juju/...` to update the source
74
If you want to know more about contributing to `juju`, please read the
75
[CONTRIBUTING](CONTRIBUTING.md) companion to this file.
77
Installing prerequisites
78
------------------------
80
You can use `make install-dependencies` or, if you prefer to install
81
them manually, check the Makefile target.
83
This will add some PPAs to ensure that you can install the required
84
golang and mongodb-server versions for precise onwards, in addition to the
91
go install -v github.com/juju/juju/...
93
Will build juju and install the binary commands into `$GOPATH/bin`. It is likely
94
if you have just completed the previous step to get the `juju` source, the
95
install process will produce no output, as the final executables are up-to-date.
97
If you do see any errors, there is a good chance they are due to changes in
98
juju's dependencies. See the
99
[Dependency management](CONTRIBUTING.md#dependency-management) section of
100
`CONTRIBUTING` for more information on getting the dependencies right.
106
After following the steps above you will have the `juju` client installed in
107
`GOPATH/bin/juju`. You should ensure that this version of `juju` appears earlier
108
in your path than any packaged versions of `juju`, or older Python juju
109
commands. You can verify this using
113
You should be able to bootstrap a local model now with the following
114
(Note: the use of sudo for bootstrap here is only required for the local
115
provider because it uses LXC, which requires root privileges)
124
The `juju` client program, and the juju 'tools' are deployed in lockstep. When a
125
release of `juju` is made, the compiled tools matching that version of juju
126
are extracted and uploaded to a known location. This consumes a release version
127
number, and implies that no tools are available for the next, development, version
128
of juju. Therefore, when using the development version of juju you will need to
129
pass an additional flag, `--upload-tools` to instruct the `juju` client to build
130
a set of tools from source and upload them to the model as part of the
133
juju bootstrap -m your-model --upload-tools {--debug}
136
Installing bash completion for juju
137
===================================
141
Will install Bash completion for `juju` cli to `/etc/bash_completion.d/juju`. It does
142
dynamic completion for commands requiring service, unit or machine names (like e.g.
143
juju status <service>, juju ssh <instance>, juju terminate-machine <machine#>, etc),
144
by parsing cached `juju status` output for speedup. It also does command flags
145
completion by parsing `juju help ...` output.