/
iezhelev
/
cppsh_micro
Обзор
Документация
Войти
/
iezhelev
/
cppsh_micro
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
redeploy_serv.sh
25 строк
868 B
iezhelev
redeploy scripts
25 мар 2025, 11:11
25 мар 2025, 11:11
08cbb53
Код
Авторство
О чём код?
#!/bin/bash # Check if the service name parameter is provided if [ -z "$1" ]; then echo "Error: Please provide the service name as a parameter." exit 1 fi # Set the service name from the first parameter SERVICE_NAME="$1" # Step 1: Stop and remove existing containers for the specified service echo "Stopping and removing existing containers for service: $SERVICE_NAME..." docker-compose down "$SERVICE_NAME" # Step 2: Build the Docker images for the specified service echo "Building Docker images for service: $SERVICE_NAME..." docker-compose build "$SERVICE_NAME" # Step 3: Start the containers in detached mode for the specified service echo "Starting containers in detached mode for service: $SERVICE_NAME..." docker-compose up -d "$SERVICE_NAME" echo "Automation complete for service: $SERVICE_NAME!" read -p "Press any key to continue..." -n1 -s echo