netboot/dockerfiles/pixiecore/build.sh
David Anderson d759d198a9 Refactor the dockerfile for Pixiecore.
The way docker hub and quay.io work, you can't easily pass a custom
context to a Dockerfile. So, effectively, if you want multiple dockerfiles
per repository, you need to re-check out the whole repository by hand,
without help from the environment.

This sucks a little bit because it doesn't guarantee that the build happens
at the trigger revision ID, but for my purposes of "just have a recent build up",
it's sufficient.
2016-08-24 00:09:09 -07:00

29 lines
747 B
Bash
Executable File

#!/bin/sh
set -x
set -e
mkdir -p /tmp/go/src/go.universe.tf
if [ -d /tmp/stuff/.git ]; then
echo "Building from local dev copy"
mkdir -p /tmp/go/src/go.universe.tf
cp -R /tmp/stuff /tmp/go/src/go.universe.tf/netboot
else
echo "Building from git checkout"
fi
export GOPATH=/tmp/go
echo "http://dl-4.alpinelinux.org/alpine/edge/community" >>/etc/apk/repositories
apk -U add ca-certificates git go gcc musl-dev
apk upgrade
go get -v github.com/Masterminds/glide
go get -v -d go.universe.tf/netboot/cmd/pixiecore
cd /tmp/go/src/go.universe.tf/netboot
/tmp/go/bin/glide install
cd cmd/pixiecore
go build .
cp ./pixiecore /pixiecore
cd /
apk del git go gcc musl-dev
rm -rf /tmp/go /tmp/stuff /root/.glide /usr/lib/go /var/cache/apk/*