Skip to content

destruct

destruct #796

Workflow file for this run

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