mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 08:00:43 +00:00
Add prettier-plugin-sh (#762)
## Description: Add prettier-plugin-sh to format shell files. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors --------- Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
This commit is contained in:
@@ -4,15 +4,14 @@
|
||||
|
||||
# Load environment variables if .env exists
|
||||
if [ -f /home/openfront/.env ]; then
|
||||
echo "Loading environment variables from .env file..."
|
||||
export $(grep -v '^#' /home/openfront/.env | xargs)
|
||||
echo "Loading environment variables from .env file..."
|
||||
export $(grep -v '^#' /home/openfront/.env | xargs)
|
||||
fi
|
||||
|
||||
echo "======================================================"
|
||||
echo "🔄 UPDATING SERVER: ${HOST} ENVIRONMENT"
|
||||
echo "======================================================"
|
||||
|
||||
|
||||
# Container and image configuration
|
||||
CONTAINER_NAME="openfront-${ENV}-${SUBDOMAIN}"
|
||||
|
||||
@@ -23,45 +22,45 @@ echo "Checking for existing container..."
|
||||
# Check for running container
|
||||
RUNNING_CONTAINER=$(docker ps | grep ${CONTAINER_NAME} | awk '{print $1}')
|
||||
if [ -n "$RUNNING_CONTAINER" ]; then
|
||||
echo "Stopping running container $RUNNING_CONTAINER..."
|
||||
docker stop $RUNNING_CONTAINER
|
||||
echo "Waiting for container to fully stop and release resources..."
|
||||
sleep 5 # Add a 5-second delay
|
||||
docker rm $RUNNING_CONTAINER
|
||||
echo "Container $RUNNING_CONTAINER stopped and removed."
|
||||
echo "Stopping running container $RUNNING_CONTAINER..."
|
||||
docker stop $RUNNING_CONTAINER
|
||||
echo "Waiting for container to fully stop and release resources..."
|
||||
sleep 5 # Add a 5-second delay
|
||||
docker rm $RUNNING_CONTAINER
|
||||
echo "Container $RUNNING_CONTAINER stopped and removed."
|
||||
fi
|
||||
|
||||
# Also check for stopped containers with the same name
|
||||
STOPPED_CONTAINER=$(docker ps -a | grep ${CONTAINER_NAME} | awk '{print $1}')
|
||||
if [ -n "$STOPPED_CONTAINER" ]; then
|
||||
echo "Removing stopped container $STOPPED_CONTAINER..."
|
||||
docker rm $STOPPED_CONTAINER
|
||||
echo "Container $STOPPED_CONTAINER removed."
|
||||
echo "Removing stopped container $STOPPED_CONTAINER..."
|
||||
docker rm $STOPPED_CONTAINER
|
||||
echo "Container $STOPPED_CONTAINER removed."
|
||||
fi
|
||||
|
||||
echo "Starting new container for ${HOST} environment..."
|
||||
docker run -d \
|
||||
--restart=always \
|
||||
--env-file /home/openfront/.env \
|
||||
--name ${CONTAINER_NAME} \
|
||||
$DOCKER_IMAGE
|
||||
--restart=always \
|
||||
--env-file /home/openfront/.env \
|
||||
--name ${CONTAINER_NAME} \
|
||||
$DOCKER_IMAGE
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Update complete! New ${CONTAINER_NAME} container is running."
|
||||
|
||||
# Final cleanup after successful deployment
|
||||
echo "Performing final cleanup of unused Docker resources..."
|
||||
echo "Removing unused images (not referenced)..."
|
||||
docker image prune -a -f
|
||||
docker container prune -f
|
||||
echo "Cleanup complete."
|
||||
echo "Update complete! New ${CONTAINER_NAME} container is running."
|
||||
|
||||
# Final cleanup after successful deployment
|
||||
echo "Performing final cleanup of unused Docker resources..."
|
||||
echo "Removing unused images (not referenced)..."
|
||||
docker image prune -a -f
|
||||
docker container prune -f
|
||||
echo "Cleanup complete."
|
||||
else
|
||||
echo "Failed to start container"
|
||||
exit 1
|
||||
echo "Failed to start container"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "======================================================"
|
||||
echo "✅ SERVER UPDATE COMPLETED SUCCESSFULLY"
|
||||
echo "Container name: ${CONTAINER_NAME}"
|
||||
echo "Image: ${FULL_IMAGE_NAME}"
|
||||
echo "======================================================"
|
||||
echo "======================================================"
|
||||
|
||||
Reference in New Issue
Block a user