From 1578f9612d740ea96e3b27be6ba423a9b452ba1f Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 23 Mar 2013 00:48:20 -0700 Subject: [PATCH] Instructions for working on Packer --- Makefile | 5 +++++ README.md | 10 ++++++++++ setup.sh | 11 +++++++++++ 3 files changed, 26 insertions(+) create mode 100644 Makefile create mode 100755 setup.sh diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..4eccad75a --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +all: + @mkdir -p bin/ + go build -o bin/packer packer/bin-packer + +.PHONY: all diff --git a/README.md b/README.md index 9446c08ea..849d13507 100644 --- a/README.md +++ b/README.md @@ -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 +``` diff --git a/setup.sh b/setup.sh new file mode 100755 index 000000000..ce3941ec6 --- /dev/null +++ b/setup.sh @@ -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}"