Instructions for working on Packer

This commit is contained in:
Mitchell Hashimoto 2013-03-23 00:48:20 -07:00
parent 1748ca31f6
commit 1578f9612d
3 changed files with 26 additions and 0 deletions

5
Makefile Normal file
View File

@ -0,0 +1,5 @@
all:
@mkdir -p bin/
go build -o bin/packer packer/bin-packer
.PHONY: all

View File

@ -7,4 +7,14 @@ machine images to launch into any environment, such as VirtualBox, VMware,
Amazon EC2, etc. Because this build process is automated, you can develop in
VirtualBox, then deploy to EC2 with an identical image.
## Developing Packer
If you wish to work on Packer itself, you'll first need [Go](http://golang.org)
installed. Next, clone this repository and source "setup.sh" in your shell. This
will set up the environmental variables properly to work on Packer. After
that, just run `make`. Commands:
```
$ source setup.sh
$ make
```

11
setup.sh Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Get the full path to the directory where this script is, because
# GOPATH prefers full paths.
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# Setup our GOPATH
echo "Setting GOPATH to: ${DIR}"
export GOPATH="${DIR}"