-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build_docker.sh
executable file
·34 lines (28 loc) · 1.12 KB
/
build_docker.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
#pid=$(netstat -nap | grep 8081 | tail -n1 | awk '{printf("%d/n"), $7}' | awk -F/ '{printf("%d\n"), $1}')
echo "[BUILD] build start"
mkdir build 2>/dev/null
echo "[BUILD] building webhook"
rm -rf build/*
go build -o build/webhook cmd/webhook/main.go
mkdir build/config 2>/dev/null
cp -r config/certificate build/config/certificate
cp -r config/config build/config/config
cp -r config/crd build/config/crd
echo "[BUILD] building images"
docker build . -t webhook:latest
docker tag webhook:latest tangjiaming1999/casbin-kubesphere-authz:v1
echo "[BUILD] pushing images"
docker push tangjiaming1999/casbin-kubesphere-authz:v1
# #install all crd
# make install
# #load existing models and policies
# cd deployments
# python3 load_crd.py
# #the webhook deployment uses this account
# kubectl create serviceaccount my-sa # if necessary, namespace should be added
# kubectl apply -f webhook_register_internal_step1.yaml
# kubectl apply -f webhook_register_internal_step2.yaml
# #grant necessary access authority to the webhook
# kubectl create clusterrolebinding my-sa-view \
# --clusterrole=cluster-admin \
# --serviceaccount=default:my-sa