forked from istio/istio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·54 lines (40 loc) · 988 Bytes
/
init.sh
File metadata and controls
executable file
·54 lines (40 loc) · 988 Bytes
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
#!/bin/bash
WD=$(dirname $0)
WD=$(cd $WD; pwd)
ROOT=$(dirname $WD)
set -o errexit
set -o nounset
set -o pipefail
set -x
# Ensure expected GOPATH setup
if [ $ROOT != "${GOPATH-$HOME/go}/src/istio.io/istio" ]; then
echo "Istio not found in GOPATH/src/istio.io/"
exit 1
fi
function linkpkg() {
root=$1
shift
genfiles=$1
shift
comp=$1
pushd $genfiles
for fl in $(find $comp -type f);do
ln -sf ${genfiles}/$fl ${root}/$(dirname $fl)
done
popd
}
# This step is to fetch resources and create genfiles
bazel build //...
source "${ROOT}/bin/use_bazel_go.sh"
# Clean up vendor dir
rm -rf ${ROOT}/vendor
mkdir -p ${ROOT}/vendor
# Vendorize bazel dependencies
${ROOT}/mixer/bin/bazel_to_go.py ${ROOT}
genfiles=$(bazel info bazel-genfiles)
# Link generated files
linkpkg ${ROOT} ${genfiles} pilot
linkpkg ${ROOT} ${genfiles} broker
linkpkg ${ROOT} ${genfiles} security
# Remove doubly-vendorized k8s dependencies
rm -rf ${ROOT}/vendor/k8s.io/*/vendor