This commit is contained in:
pluja 2024-03-04 21:19:02 +01:00
parent dfe2fcbdc8
commit f371e4b4af

View File

@ -5,10 +5,9 @@ dev +command:
deploy build="":
git pull
# Set variable for build option
{{ set build_option = if build != "" { "--build" } else { "" } }}
docker compose up {{ build_option }} --pull=always -d
# Set variable for restart command
{{ set restart_cmd = if build == "" { "docker compose restart website" } else { "" } }}
{{ restart_cmd }}
# Use shell scripting for conditional logic
BUILD_OPTION="{{ if build != "" { "--build" } else { "" } }}"
docker compose up $BUILD_OPTION --pull=always -d
# Use shell scripting for conditional logic
if [ -z "{{ build }}" ]; then docker compose restart website; fi
docker system prune -f