github.com/argoproj/argo-cd/v3@v3.2.1/test/container/reaper.sh (about)

     1  #!/bin/sh
     2  
     3  # Simple helper script to kill all running processes in the container that
     4  # belong to the root user.
     5  
     6  # DO NOT RUN OUTSIDE THE DOCKER CONTAINER EXECUTING ARGO CD TESTS.
     7  # YOU HAVE BEEN WARNED.
     8  
     9  cleanup() {
    10  	echo "Killing all processes"
    11  	sudo pkill -u root
    12  }
    13  
    14  echo "Running as $0 ($PWD)"
    15  if test "${PWD}" != "/go/src/github.com/argoproj/argo-cd"; then
    16  	echo "ERROR: We don't seem to be in Docker container. Exit." >&2
    17  	exit 1
    18  fi
    19  trap cleanup 2 15
    20  while :; do
    21  	sleep 1
    22  done