forked from cloudfoundry-attic/lattice-release
/
compile
executable file
·145 lines (110 loc) · 4 KB
/
compile
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/bash
set -e
compile_garden_linux() {
mkdir -p $OUTPUT_DIR/lattice-cell/garden
rm -rf $GOPATH/pkg/*
rm -rf $GOPATH/src/github.com/cloudfoundry-incubator/garden-linux/Godeps/_workspace/pkg/*
GOPATH=$GOPATH/src/github.com/cloudfoundry-incubator/garden-linux/Godeps/_workspace:$GOPATH
echo "GOPATH=$GOPATH"
go install -v -tags daemon github.com/cloudfoundry-incubator/garden-linux
GOPATH=$DIEGO_RELEASE_PATH
pushd $DIEGO_RELEASE_PATH/src/github.com/cloudfoundry-incubator/garden-linux/old
make
cp -a linux_backend/bin $OUTPUT_DIR/lattice-cell/garden/garden-bin
cp -a linux_backend/skeleton $OUTPUT_DIR/lattice-cell/garden/skeleton
popd
rm -rf $GOPATH/pkg/*
}
compile_gorouter() {
pushd $CF_RELEASE_PATH/src
GOPATH=/tmp/go
mkdir -p $GOPATH/src/github.com/cloudfoundry
REPO_NAME=github.com/cloudfoundry/gorouter
cp -fr gorouter $GOPATH/src/$REPO_NAME
rm -rf $GOPATH/src/${REPO_NAME}/Godeps/_workspace/pkg
GOPATH=$GOPATH/src/${REPO_NAME}/Godeps/_workspace:$GOPATH
go install github.com/cloudfoundry/gorouter
rm -rf $GOPATH
GOPATH=$DIEGO_RELEASE_PATH
popd
}
compile_coordinator_loggregator() {
pushd $CF_RELEASE_PATH/src/loggregator
GOPATH=`pwd`
go install trafficcontroller
go install doppler
go install metron
GOPATH=$DIEGO_RELEASE_PATH
popd
}
compile_lattice_cell_loggregator() {
pushd $CF_RELEASE_PATH/src/loggregator
GOPATH=`pwd`
go install metron
GOPATH=$DIEGO_RELEASE_PATH
popd
}
compile_lattice-cell() {
export GOBIN=$OUTPUT_DIR/lattice-cell/bin
compile_garden_linux
pushd $GOPATH
go install github.com/cloudfoundry-incubator/rep/cmd/rep
go install github.com/cloudfoundry-incubator/executor/cmd/executor
go install github.com/cloudfoundry-incubator/auctioneer/cmd/auctioneer
go install github.com/cloudfoundry-incubator/converger/cmd/converger
go install github.com/cloudfoundry-incubator/lattice/tee2metron
popd
rm -rf $GOPATH/pkg/*
compile_lattice_cell_loggregator
CONSUL_OBJECT_ID="bb8108ec-b026-4ce4-8216-0fabfeaac904"
wget "http://go-diego-go.s3.amazonaws.com/${CONSUL_OBJECT_ID}" -O $GOBIN/consul
chmod +x $GOBIN/consul
cp -av $LATTICE_PATH/lattice-cell/ $OUTPUT_DIR/
}
compile_coordinator() {
export GOBIN=$OUTPUT_DIR/coordinator/bin
pushd $GOPATH
go install github.com/cloudfoundry-incubator/route-emitter/cmd/route-emitter
go install github.com/apcera/gnatsd
go install github.com/cloudfoundry-incubator/receptor/cmd/receptor
go install github.com/cloudfoundry-incubator/file-server/cmd/file-server
go install github.com/cloudfoundry-incubator/buildpack_app_lifecycle/healthcheck
pushd src/github.com/coreos/etcd
./build
cp bin/etcd $GOBIN
popd
popd
rm -rf $GOPATH/pkg
compile_gorouter
compile_coordinator_loggregator
CONSUL_OBJECT_ID="bb8108ec-b026-4ce4-8216-0fabfeaac904"
wget "http://go-diego-go.s3.amazonaws.com/${CONSUL_OBJECT_ID}" -O $GOBIN/consul
chmod +x $GOBIN/consul
cp -av $LATTICE_PATH/coordinator/ $OUTPUT_DIR/
}
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] || [ -z "$4" ]; then
echo "Incorrect Usage. Usage: $0 output-dir diego-release-path cf-release-path lattice-path"
exit 1
fi
export OUTPUT_DIR=$1
export DIEGO_RELEASE_PATH=$2
export CF_RELEASE_PATH=$3
export LATTICE_PATH=$4
export GOOS=linux
export GOARCH=amd64
export GOPATH=$DIEGO_RELEASE_PATH
echo "DIEGO_RELEASE_PATH=$DIEGO_RELEASE_PATH"
echo "CF_RELEASE_PATH=$CF_RELEASE_PATH"
echo "LATTICE_PATH=$LATTICE_PATH"
echo "GOOS=$GOOS"
echo "GOARCH=$GOARCH"
echo "GOPATH=$GOPATH"
rm -rf $OUTPUT_DIR/*
rm -rf $GOPATH/pkg/*
mkdir -pv $OUTPUT_DIR/common/
cp -av $LATTICE_PATH/common/* $OUTPUT_DIR/common/
cp -v $LATTICE_PATH/Version $OUTPUT_DIR/common/LATTICE_VERSION
compile_lattice-cell
compile_coordinator
rm -rf $GOPATH/pkg/*
rm -rf $GOPATH/bin/*