-
Notifications
You must be signed in to change notification settings - Fork 113
69 lines (62 loc) · 2.84 KB
/
destructive.yml
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
name: destruct
on:
schedule:
- cron: '30 2 * * *'
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read-
jobs:
destruct:
name: destruct
if: false
runs-on: ubuntu-latest
env:
VANUS_GATEWAY: 192.168.49.2:30001
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Environmental preparation
run: |
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
minikube start
curl -LO https://dl.k8s.io/release/v1.24.0/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
- name: Deploy Vanus
run: |
export IMAGE_TAG=$(git log -1 --format='%h' | awk '{print $0}')
export VERSION=$(cat ./deploy/all-in-one.yaml| grep -w "image" | awk -F ":" '{print $NF}' | awk 'FNR == 1')
sed -i "s/${VERSION}/${IMAGE_TAG}/g" ./deploy/all-in-one.yaml
eval $(minikube docker-env)
make docker-build
kubectl apply -f ./deploy/all-in-one.yaml
kubectl apply -f ./test/yaml/display.yml
kubectl apply -f ./test/yaml/etcd-srv.yml
make build-cmd
make build-destruct
chmod ug+x ./bin/vsctl
sudo mv ./bin/vsctl /usr/local/bin/vsctl
sleep 60s && for i in $(seq 1 20); do kubectl get pod -n vanus --no-headers | grep -v Run || break;sleep 5s;done
kubectl get pod -n vanus
- name: Pre
run: |
./bin/destruct pre
- name: Destruct
run: |
kubectl delete pod -n vanus vanus-controller-0
sleep 10s && for i in $(seq 1 20); do kubectl get pod -n vanus --no-headers | grep -v Run || break;sleep 5s;done
kubectl delete pod -n vanus vanus-controller-1
sleep 10s && for i in $(seq 1 20); do kubectl get pod -n vanus --no-headers | grep -v Run || break;sleep 5s;done
kubectl delete pod -n vanus vanus-controller-2
sleep 10s && for i in $(seq 1 20); do kubectl get pod -n vanus --no-headers | grep -v Run || break;sleep 5s;done
kubectl delete pod -n vanus vanus-store-0
sleep 10s && for i in $(seq 1 20); do kubectl get pod -n vanus --no-headers | grep -v Run || break;sleep 5s;done
kubectl delete pod -n vanus vanus-store-1
sleep 10s && for i in $(seq 1 20); do kubectl get pod -n vanus --no-headers | grep -v Run || break;sleep 5s;done
kubectl delete pod -n vanus vanus-store-2
sleep 10s && for i in $(seq 1 20); do kubectl get pod -n vanus --no-headers | grep -v Run || break;sleep 5s;done
kubectl get pod -n vanus
- name: Post
run: |
./bin/destruct post