-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a build process for Dockramp binaries
Docker-DCO-1.1-Signed-off-by: Josh Hawn <[email protected]> (github: jlhawn)
- Loading branch information
Josh Hawn
committed
Jul 27, 2015
1 parent
7749a98
commit d78a759
Showing
6 changed files
with
60 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
# Folders | ||
_obj | ||
_test | ||
bundles | ||
|
||
# Architecture specific extensions/prefixes | ||
*.[568vq] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
FROM golang:1.4.2 | ||
FROM golang:1.4.2-cross | ||
|
||
MAINTAINER 'Josh Hawn <[email protected]> (github:jlhawn)' | ||
|
||
ENV PROJ_DIR /go/src/github.com/jlhawn/dockramp | ||
|
||
ENV PLATFORMS ' | ||
darwin/386 darwin/amd64 | ||
freebsd/386 freebsd/amd64 freebsd/arm | ||
linux/386 linux/amd64 linux/arm | ||
windows/386 windows/amd64 | ||
' | ||
|
||
RUN sh -c 'mkdir -p $PROJ_DIR' | ||
|
||
COPY . $PROJ_DIR | ||
|
||
RUN sh << EOF | ||
export GOPATH="$PROJ_DIR/Godeps/_workspace:$GOPATH" | ||
go build -o /usr/local/bin/dockramp github.com/jlhawn/dockramp/cmd/dockramp | ||
EOF | ||
RUN sh -c 'cp "$PROJ_DIR/make_binaries.sh" /usr/local/bin/make_binaries.sh' | ||
|
||
ENTRYPOINT /usr/local/bin/make_binaries.sh | ||
CMD /bundles |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
Godeps/_workspace/src/github.com/jlhawn/tarsum/sha256/sha256block.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Set an output prefix, which is the local directory if not specified | ||
GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD) | ||
|
||
.PHONY: all clean image binaries | ||
|
||
all: clean binaries | ||
|
||
clean: | ||
@echo "+ $@" | ||
@rm -rf bundles | ||
|
||
image: | ||
@echo "+ $@" | ||
@dockramp -t dockramp:${GIT_BRANCH} | ||
|
||
binaries: image | ||
@echo "+ $@" | ||
$(eval C_ID := $(shell docker create dockramp:${GIT_BRANCH})) | ||
@docker start -a ${C_ID} | ||
@docker cp ${C_ID}:/bundles . | ||
@docker rm ${C_ID} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
|
||
FAILURES="" | ||
TARGET="github.com/jlhawn/dockramp/cmd/dockramp" | ||
|
||
mkdir "$1" | ||
|
||
for PLATFORM in $PLATFORMS; do | ||
OUTPUTDIR="$1/$PLATFORM" | ||
mkdir -p "$OUTPUTDIR" | ||
|
||
export GOPATH="$PROJ_DIR/Godeps/_workspace:$GOPATH" | ||
export GOOS="${PLATFORM%/*}" | ||
export GOARCH="${PLATFORM#*/}" | ||
|
||
CMD="go build -o $OUTPUTDIR/dockramp $TARGET" | ||
|
||
echo "$CMD" && $CMD || FAILURES="$FAILURES $PLATFORM" | ||
done | ||
|
||
if [ -n "$FAILURES" ]; then | ||
echo "*** build FAILED on $FAILURES ***" | ||
exit 1 | ||
fi |