github.com/kubevela/workflow@v0.6.0/hack/e2e/end_e2e.sh (about) 1 #!/usr/bin/env bash 2 3 CONTAINER_ID=$(docker exec k3d-k3s-default-server-0 crictl ps | grep vela-workflow | grep --regexp '^.............' -o) 4 DOCKER_DIR=$(docker exec k3d-k3s-default-server-0 crictl inspect --output go-template --template '{{range .info.runtimeSpec.mounts}}{{if (eq .destination "/workspace/data")}}{{.source}}{{end}}{{end}}' "${CONTAINER_ID}") 5 echo "${CONTAINER_ID}" 6 echo "${DOCKER_DIR}" 7 8 docker exec k3d-k3s-default-server-0 crictl exec "${CONTAINER_ID}" kill -2 1 9 10 file=$DOCKER_DIR/e2e-profile.out 11 echo "$file" 12 n=1 13 while [ $n -le 60 ];do 14 if_exist=$(docker exec k3d-k3s-default-server-0 sh -c "test -f $file && echo 'ok'") 15 echo "$if_exist" 16 if [ -n "$if_exist" ];then 17 docker exec k3d-k3s-default-server-0 cat "$file" > /tmp/e2e-profile.out 18 break 19 fi 20 echo file not generated yet 21 n="$(expr $n + 1)" 22 sleep 1 23 done