oliverdavies.uk/run

46 lines
785 B
Bash
Executable file

#!/bin/bash
set -e
. .env
TTY=""
if [[ ! -t 1 ]]; then
TTY="-T"
fi
function cmd {
# Run any command in the app container.
_dc app "${@}"
}
function deploy {
cd tools/deployment && ansible-playbook deploy.yml
}
function docker:build-images {
docker-compose build --file docker-compose-production.yaml
}
function docker:push-images {
docker-compose push --file docker-compose-production.yaml
}
function help {
printf "%s <task> [args]\n\nTasks:\n" "${0}"
compgen -A function | grep -v "^_" | cat -n
printf "\nExtended help:\n Each task has comments for general usage\n"
}
function run-production {
docker-compose --file docker-compose-production.yaml up --detach --remove-orphans
}
function _dc {
docker-compose exec ${TTY} "${@}"
}
eval "${@:-help}"