-
Notifications
You must be signed in to change notification settings - Fork 1
/
xmlworkflow-run-prod.sh
41 lines (35 loc) · 1.32 KB
/
xmlworkflow-run-prod.sh
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
39
40
41
#!/bin/bash
# Set default value
containername=${1:-"xmlworkflow:latest"}
mode=${2:-"production"}
# Function to display help message
display_help() {
echo "Usage: xmlworkflow-run-prod <container-name> <mode>"
echo "If no parameter is provided, the default container name is 'xmlworkflow:latest'."
echo "Parameter mode can be one of 'production' (default value), 'devtheme' or 'dev'. This parameter determines which folders will be bind mounted. (feature under development)"
}
# Check if help option is provided
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
display_help
return 0
fi
mkdir -p work/metadata
mkdir -p store
mkdir -p theme
if command -v podman &> /dev/null
then
podman run -it --name $1 -d \
-v ./work:/root/xmlworkflow/work \
-v ./store:/root/xmlworkflow/store \
{containername}
# binding for full dev mode needs to bind all folders individually (otherwise lib folder will not be available):
# podman run -it --name xmlworkflow -d -v .:/root/xmlworkflow xmlworkflow:latest
elif command -v docker &> /dev/null
then
docker run -it --name $1 -d \
-v ./work:/root/xmlworkflow/work \
-v ./store:/root/xmlworkflow/store \
{containername}
else
echo "Neither Podman nor Docker is installed. Please install one of them to run the container."
fi