-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.sh
executable file
·95 lines (81 loc) · 2 KB
/
build.sh
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
#!/bin/sh
self_path=$(cd "$(dirname $0)";pwd)
self_parent=$(dirname $self_path)
# prepare
export GOPATH=$(pwd|awk -F '/src/' '{ print $1 }')
rm -f $self_parent/ingress-nginx
ln -s $self_path $self_parent/ingress-nginx
export DOCKER_CLI_EXPERIMENTAL=enabled
# build prepare
function build_prepare()
{
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
ip link add name docker0 type bridge && sudo ip addr add dev docker0 192.168.5.1/24
yum install -y https://cbs.centos.org/kojifiles/packages/container-selinux/2.84/2.el7/noarch/container-selinux-2.84-2.el7.noarch.rpm
yum install docker-ce-19.03.8-3.el7
systemctl enable docker.service && sudo systemctl start docker
}
# build tengine images
function build_tengine_images()
{
cd images/tengine/
make container || exit 1
echo build tengine base images success
cd ../../
}
# build e2e tengine images
function build_e2e_images()
{
cd images/e2e-tengine/
make || exit 1
echo build e2e for tengine base images success
cd ../../
}
# build ingress controller images
function build_ingress_images()
{
make build container || exit 1
echo build tengine ingress controller success
}
function push_ingress_image()
{
docker push reg.docker.alibaba-inc.com/ingress-tengine/tengine-ingress-controller-amd64:0.0.1
}
function push_tengine_image()
{
docker push reg.docker.alibaba-inc.com/ingress-tengine/tengine-amd64:0.0.1
}
function build_ingress()
{
DIND_TASKS=1 make build || exit 1
echo build ingress success
}
#main
case $1 in
tengine )
build_tengine_images
exit
;;
ingress )
build_ingress_images
exit
;;
prepare )
build_prepare
;;
e2e )
build_e2e_images
;;
push )
push_tengine_image
push_ingress_image
;;
build )
build_ingress
;;
* )
build_prepare
build_tengine_images
build_ingress_images
;;
esac