manage, only copy example files and run scripts if a proper docker compose file exists.
This commit is contained in:
+5
-5
@@ -151,13 +151,13 @@ if [[ -n $up || -n $down || -n $build || -n $pull || -n $maintenance ]]; then
|
||||
pwd
|
||||
|
||||
# Ensure env file exists so that all compose variables are populated.
|
||||
if [[ -e ./example.env && ! -e ./.env ]]; then
|
||||
if [[ -e "./example.env" && ! -e "./.env" && -f "docker-compose.yml" ]]; then
|
||||
echo "WARNING: .env file was not found, copying example as placeholder."
|
||||
cp -v example.env .env
|
||||
fi
|
||||
|
||||
# Ensure all configuration files have been created.
|
||||
if [[ -d ./config ]]; then
|
||||
if [[ -d "./config" && -f "docker-compose.yml" ]]; then
|
||||
ls ./config/*.example 2>/dev/null | while read example; do
|
||||
real=${example//.example/}
|
||||
if [[ ! -e $real ]]; then
|
||||
@@ -168,12 +168,12 @@ if [[ -n $up || -n $down || -n $build || -n $pull || -n $maintenance ]]; then
|
||||
fi
|
||||
|
||||
# Run the prep script to create any necessary volumes.
|
||||
if [[ -f prep.sh ]]; then
|
||||
if [[ -f "prep.sh" && -f "docker-compose.yml" ]]; then
|
||||
./prep.sh
|
||||
fi
|
||||
|
||||
# Run any maintenance scripts associate with the container.
|
||||
if [[ "$maintenance" == "Y" ]]; then
|
||||
# Run any maintenance scripts associated with the container.
|
||||
if [[ "$maintenance" == "Y" && -f "docker-compose.yml" ]]; then
|
||||
if [[ -f "maintenance.sh" ]]; then
|
||||
./maintenance.sh
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user