-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgofetch
More file actions
executable file
·38 lines (30 loc) · 1.11 KB
/
Copy pathgofetch
File metadata and controls
executable file
·38 lines (30 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Check if a parameter is passed
if [ -z "$1" ]; then
echo "Error: No service name provided. Please provide 'rover', 'dcare' or sftp."
exit 1
fi
# Use the parameter to determine which service to run
SERVICE=$1
# Validate the service name
if [ "$SERVICE" != "rover" ] && [ "$SERVICE" != "dcare" ] && [ "$SERVICE" != "sftp" ]; then
echo "Error: Invalid service name. Please provide either 'rover', 'dcare' or sftp."
exit 1
fi
# If the service is 'sftp', check for the second parameter and compare it
if [ "$SERVICE" == "sftp" ]; then
if [ -z "$2" ]; then
echo "Error: SFTP name is required when using the 'sftp' service."
exit 1
fi
SFTP_NAME=$2
# Validate the service name
if [ "$SFTP_NAME" != "medhealth" ] && [ "$SFTP_NAME" != "alphalab" ]; then
echo "Error: Invalid service name. Please provide either 'medhealth' or 'alphalab'."
exit 1
fi
SERVICE=$SFTP_NAME
fi
# Run the docker-compose up command for the selected service
# docker-compose up -d --build $SERVICE # Deprecated usage
docker compose up -d --build --force-recreate $SERVICE