
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 48s
15 lines
481 B
Bash
Executable File
15 lines
481 B
Bash
Executable File
#!/bin/bash
|
|
source "${AGENT_PATH}/common.sh"
|
|
_check_required_env_vars "CONTAINER_NAME"
|
|
|
|
# Check if the image exists
|
|
if docker images --format "{{.Repository}}:{{.Tag}}" | grep -q "^${CONTAINER_NAME}_image:latest$"; then
|
|
# Check if any containers are currently running with this image
|
|
if docker ps --filter "ancestor=${CONTAINER_NAME}_image:latest" --format "{{.ID}}" | grep -q .; then
|
|
echo "Running"
|
|
else
|
|
echo "Stopped"
|
|
fi
|
|
else
|
|
echo "Unknown"
|
|
fi |