From 51b9065497b53b583d0951e894016c5c1300b3c2 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 13 Aug 2018 12:40:42 +0200 Subject: [PATCH 1/4] split go and packer dev setups --- .github/CONTRIBUTING.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e0c51bc78..b68e3dfbd 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -67,26 +67,28 @@ export GOPATH=$HOME/go export PATH=$PATH:$GOPATH/bin ``` -3. Download the Packer source (and its dependencies) by running +## Setting up Packer for dev + +1. Download the Packer source (and its dependencies) by running `go get github.com/hashicorp/packer`. This will download the Packer source to `$GOPATH/src/github.com/hashicorp/packer`. -4. When working on Packer, first `cd $GOPATH/src/github.com/hashicorp/packer` +2. When working on Packer, first `cd $GOPATH/src/github.com/hashicorp/packer` so you can run `make` and easily access other files. Run `make help` to get information about make targets. -5. Make your changes to the Packer source. You can run `make` in +3. Make your changes to the Packer source. You can run `make` in `$GOPATH/src/github.com/hashicorp/packer` to run tests and build the Packer binary. Any compilation errors will be shown when the binaries are rebuilding. If you don't have `make` you can simply run `go build -o bin/packer .` from the project root. -6. After running building Packer successfully, use +4. After running building Packer successfully, use `$GOPATH/src/github.com/hashicorp/packer/bin/packer` to build a machine and verify your changes work. For instance: `$GOPATH/src/github.com/hashicorp/packer/bin/packer build template.json`. -7. If everything works well and the tests pass, run `go fmt` on your code before +5. If everything works well and the tests pass, run `go fmt` on your code before submitting a pull-request. ### Opening an Pull Request From 1d025c005f4e6cca5e29a8379397044c4996b8b4 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 13 Aug 2018 12:50:55 +0200 Subject: [PATCH 2/4] Link to godocs install steps --- .github/CONTRIBUTING.md | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b68e3dfbd..94a61e690 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -48,26 +48,20 @@ can quickly merge or address your contributions. 5. The issue is closed. -## Setting up Go to work on Packer +## Setting up Go -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. These instructions target +If you have never worked with Go before, you will have to install it's +runtime in order to build packer. + +1. [Install go](https://golang.org/doc/install#install) + +## Setting up Packer for dev + +If/when you have go installed you can already `go get` packer and `make` in +order to compile and test Packer. These instructions target POSIX-like environments (Mac OS X, Linux, Cygwin, etc.) so you may need to adjust them for Windows or other shells. -1. [Download](https://golang.org/dl) and install Go. The instructions below are - for go 1.7. Earlier versions of Go are no longer supported. - -2. Set and export the `GOPATH` environment variable and update your `PATH`. For - example, you can add the following to your `.bash_profile` (or comparable - shell startup scripts): - -``` -export GOPATH=$HOME/go -export PATH=$PATH:$GOPATH/bin -``` - -## Setting up Packer for dev 1. Download the Packer source (and its dependencies) by running `go get github.com/hashicorp/packer`. This will download the Packer source to From bef5c842af1eb31be7fccc5fb5101b4a9cc337c3 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 13 Aug 2018 12:53:41 +0200 Subject: [PATCH 3/4] re add the go 1.7 min version warning --- .github/CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 94a61e690..0f72a816c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -61,6 +61,7 @@ If/when you have go installed you can already `go get` packer and `make` in order to compile and test Packer. These instructions target POSIX-like environments (Mac OS X, Linux, Cygwin, etc.) so you may need to adjust them for Windows or other shells. +The instructions below are for go 1.7. Earlier versions of Go are no longer supported. 1. Download the Packer source (and its dependencies) by running From 2e151f3cd0cf29c4ade884a30acbea7d6c94b8df Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 14 Aug 2018 09:49:24 +0200 Subject: [PATCH 4/4] Spelling & checks --- .github/CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 0f72a816c..b3ec404e2 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -50,7 +50,7 @@ can quickly merge or address your contributions. ## Setting up Go -If you have never worked with Go before, you will have to install it's +If you have never worked with Go before, you will have to install its runtime in order to build packer. 1. [Install go](https://golang.org/doc/install#install) @@ -61,7 +61,7 @@ If/when you have go installed you can already `go get` packer and `make` in order to compile and test Packer. These instructions target POSIX-like environments (Mac OS X, Linux, Cygwin, etc.) so you may need to adjust them for Windows or other shells. -The instructions below are for go 1.7. Earlier versions of Go are no longer supported. +The instructions below are for go 1.7. or later. 1. Download the Packer source (and its dependencies) by running