mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-04 10:45:50 +00:00
remove EXIT_IF_CONTAINER_RUNNING
This commit is contained in:
@@ -17,7 +17,6 @@ if [[ "$GITHUB_REPOSITORY" == "" ]]; then
|
||||
BUILD_CORES=8
|
||||
fi
|
||||
|
||||
EXIT_IF_CONTAINER_RUNNING=${EXIT_IF_CONTAINER_RUNNING:-1}
|
||||
# Ensure still works outside of GH Actions by setting these to /dev/null
|
||||
# GA will run this script and then delete it at the end of the job
|
||||
JOB_CLEANUP_SCRIPT=${JOB_CLEANUP_SCRIPT:-/dev/null}
|
||||
@@ -25,19 +24,6 @@ NORMALIZED_WORKFLOW=$(echo "$GITHUB_WORKFLOW" | tr -c 'a-zA-Z0-9' '-')
|
||||
NORMALIZED_REF=$(echo "$GITHUB_REF" | tr -c 'a-zA-Z0-9' '-')
|
||||
CONTAINER_NAME="xahaud_cached_builder_${NORMALIZED_WORKFLOW}-${NORMALIZED_REF}"
|
||||
|
||||
# Check if the container is already running
|
||||
if docker ps --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
|
||||
echo "⚠️ A running container (${CONTAINER_NAME}) was detected."
|
||||
|
||||
if [[ "$EXIT_IF_CONTAINER_RUNNING" -eq 1 ]]; then
|
||||
echo "❌ EXIT_IF_CONTAINER_RUNNING is set. Exiting."
|
||||
exit 1
|
||||
else
|
||||
echo "🛑 Stopping the running container: ${CONTAINER_NAME}"
|
||||
docker stop "${CONTAINER_NAME}"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "-- BUILD CORES: $BUILD_CORES"
|
||||
echo "-- GITHUB_REPOSITORY: $GITHUB_REPOSITORY"
|
||||
echo "-- GITHUB_SHA: $GITHUB_SHA"
|
||||
|
||||
Reference in New Issue
Block a user