-
Notifications
You must be signed in to change notification settings - Fork 1
/
build
executable file
·49 lines (37 loc) · 1.28 KB
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash -e
ORG_PATH="github.com/coreos"
REPO_PATH="${ORG_PATH}/rocket"
if [ ! -h gopath/src/${REPO_PATH} ]; then
mkdir -p gopath/src/${ORG_PATH}
ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255
fi
export GOBIN=${PWD}/bin
export GOPATH=${GOPATH}:${PWD}/gopath
eval $(go env)
echo "Building actool..."
go build -o $GOBIN/actool ${REPO_PATH}/app-container/actool
echo "Building ACE validator..."
GOOS=linux CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o $GOBIN/ace-validator ${REPO_PATH}/app-container/ace
echo "Building init (stage1)..."
go build -o $GOBIN/init ${REPO_PATH}/stage1
S1BINS=${PWD}/stage0
S1INIT=${S1BINS}/stage1_init
if [ $GOBIN/init -nt $S1INIT/bin.go ]; then
echo "Packaging init (stage1)..."
TMP=$(mktemp -d)
[ -d $S1INIT ] || mkdir -p $S1INIT
cp $GOBIN/init $TMP/s1init
go-bindata -o $S1INIT/bin.go -pkg="stage1_init" -prefix=$TMP $TMP
fi
S1ROOTFS=${S1BINS}/stage1_rootfs
if [ stage1/mkrootfs.sh -nt $S1ROOTFS/bin.go ]; then
echo "Generating and packaging rootfs (stage1)..."
[ -d "${S1ROOTFS}" ] || mkdir -p "${S1ROOTFS}"
pushd stage1
OUTPUT=$S1ROOTFS/bin.go ./mkrootfs.sh
popd
fi
echo "Building rkt (stage0)..."
go build -o $GOBIN/rkt ${REPO_PATH}/rkt
echo "Building metadatasvc..."
go build -o $GOBIN/metadatasvc ${REPO_PATH}/metadatasvc