Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b362f2e37f | ||
|
8eb3d1eef1 | ||
|
2b91706d86 |
@@ -208,8 +208,22 @@ remove_additionals() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
ENV_FILES=$(cat $SERVICE_DIR/service-$NAME.json | jq -r '[.containers[] | select(has("ENV_FILES")) | .ENV_FILES[]] | unique[]')
|
||||||
|
for ENV_FILE in $(echo $ENV_FILES); do
|
||||||
|
if [ -f "$ENV_FILE" ]; then
|
||||||
|
rm -rf $ENV_FILE
|
||||||
|
debug "deleted enviroment file: $ENV_FILE"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
VOLUMES=$(cat $SERVICE_DIR/service-$NAME.json | jq -r '[.containers[] | select(has("VOLUMES")) | .VOLUMES[] | select(.SHARED != "true") | .SOURCE] | unique[]' | grep -vE 'USER|SYSTEM')
|
VOLUMES=$(cat $SERVICE_DIR/service-$NAME.json | jq -r '[.containers[] | select(has("VOLUMES")) | .VOLUMES[] | select(.SHARED != "true") | .SOURCE] | unique[]' | grep -vE 'USER|SYSTEM')
|
||||||
for VOLUME in $(echo $VOLUMES); do
|
|
||||||
|
# stop service
|
||||||
|
# force - remove stopped container, docker rm
|
||||||
|
debug "$service_exec service-$NAME.json stop force dns-remove"
|
||||||
|
$service_exec service-$NAME.json stop force dns-remove
|
||||||
|
|
||||||
|
for VOLUME in $(echo $VOLUMES | grep -vE 'USER|SYSTEM|SHARED'); do
|
||||||
if [ "$(echo $VOLUME | cut -d '/' -f1)" ]; then
|
if [ "$(echo $VOLUME | cut -d '/' -f1)" ]; then
|
||||||
docker volume rm $VOLUME
|
docker volume rm $VOLUME
|
||||||
debug "deleted volume: $VOLUME"
|
debug "deleted volume: $VOLUME"
|
||||||
@@ -217,11 +231,6 @@ remove_additionals() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# stop service
|
|
||||||
# force - remove stopped container, docker rm
|
|
||||||
debug "$service_exec service-$NAME.json stop force dns-remove"
|
|
||||||
$service_exec service-$NAME.json stop force dns-remove
|
|
||||||
|
|
||||||
# remove service files
|
# remove service files
|
||||||
rm $SERVICE_DIR/*"-"$NAME.json # service, domain, etc.
|
rm $SERVICE_DIR/*"-"$NAME.json # service, domain, etc.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user