mirror of
https://github.com/danderson/netboot.git
synced 2025-08-14 18:47:18 +02:00
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.
29 lines
747 B
Bash
Executable File
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/*
|