Move template to template/ dir, add CI workflow, use pre-built image
This commit is contained in:
23
template/status.sh
Executable file
23
template/status.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME"
|
||||
|
||||
APP_CONTAINER="${CONTAINER_NAME}-app-1"
|
||||
|
||||
if ! docker ps -a --format "{{.Names}}" | grep -q "^${APP_CONTAINER}$"; then
|
||||
echo "Unknown"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
STATE=$(docker inspect -f '{{.State.Status}}' "$APP_CONTAINER" 2>/dev/null)
|
||||
case "$STATE" in
|
||||
running)
|
||||
echo "Running"
|
||||
;;
|
||||
exited|stopped)
|
||||
echo "Stopped"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown"
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user