Updated CONTRIBUTING.md to have up-to-date information about building with Go
This commit is contained in:
parent
c10e0eb398
commit
ad5416e2e3
|
@ -53,35 +53,35 @@ it raises the chances we can quickly merge or address your contributions.
|
|||
If you have never worked with Go before, you will have to complete the
|
||||
following steps in order to be able to compile and test Packer.
|
||||
|
||||
1. Install Go. Make sure the Go version is at least Go 1.4. Packer will not work with anything less than
|
||||
Go 1.4. On a Mac, you can `brew install go` to install Go 1.4.
|
||||
1. [Download](https://golang.org/dl) and install Go. Make sure your Go version
|
||||
is at least Go 1.5. Packer _may_ work with older versions of Go but these
|
||||
are not supported.
|
||||
|
||||
2. Set and export the `GOPATH` environment variable and update your `PATH`.
|
||||
For example, you can add to your `.bash_profile`.
|
||||
2. Set and export the `GOPATH` environment variable and update your `PATH`. For
|
||||
example, you can add to your `.bash_profile`. If you're using Go 1.5 also
|
||||
set `GO15VENDOREXPERIMENT`. This is not necessary for Go 1.6 and up.
|
||||
|
||||
```
|
||||
export GOPATH=$HOME/Documents/golang
|
||||
export GO15VENDOREXPERIMENT=1
|
||||
export PATH=$PATH:$GOPATH/bin
|
||||
```
|
||||
|
||||
3. Install and build `gox` with
|
||||
3. Download the Packer source (and its dependencies) by running `go get
|
||||
github.com/mitchellh/packer`. This will download the Packer source to
|
||||
`$GOPATH/src/github.com/mitchellh/packer`.
|
||||
|
||||
```
|
||||
go get github.com/mitchellh/gox
|
||||
cd $GOPATH/src/github.com/mitchellh/gox
|
||||
go build
|
||||
```
|
||||
4. When working on packer `cd $GOPATH/src/github.com/mitchellh/packer` so you
|
||||
can run make and easily access other files.
|
||||
|
||||
4. Download the Packer source (and its dependencies) by running
|
||||
`go get github.com/mitchellh/packer`. This will download the Packer
|
||||
source to `$GOPATH/src/github.com/mitchellh/packer`.
|
||||
5. Make your changes to the Packer source. You can run `make` in
|
||||
`$GOPATH/src/github.com/mitchellh/packer` to run tests and build the packer
|
||||
binary. Any compilation errors will be shown when the binaries are
|
||||
rebuilding.
|
||||
|
||||
5. Make your changes to the Packer source. You can run `make` from the main
|
||||
source directory to recompile all the binaries. Any compilation errors
|
||||
will be shown when the binaries are rebuilding.
|
||||
|
||||
6. Test your changes by running `make test` and then running
|
||||
`$GOPATH/src/github.com/mitchellh/packer/bin/packer` to build a machine.
|
||||
6. After running `make` successfully, use
|
||||
`$GOPATH/src/github.com/mitchellh/packer/bin/packer` to build a machine and
|
||||
verify your changes work.
|
||||
|
||||
7. If everything works well and the tests pass, run `go fmt` on your code
|
||||
before submitting a pull request.
|
||||
before submitting a pull-request.
|
||||
|
|
Loading…
Reference in New Issue