ci: start replacing run with just
This commit is contained in:
parent
6d551e354d
commit
7baf281e8a
3 changed files with 49 additions and 40 deletions
34
website/run
34
website/run
|
@ -9,16 +9,6 @@ fi
|
|||
|
||||
DC="${DC:-exec}"
|
||||
|
||||
function ci:build-images {
|
||||
docker build --target production -t ghcr.io/opdavies/oliverdavies.uk-build:latest .
|
||||
docker build --target production -t ghcr.io/opdavies/oliverdavies.uk-build:$(git rev-parse HEAD) .
|
||||
}
|
||||
|
||||
function ci:push-images {
|
||||
docker push ghcr.io/opdavies/oliverdavies.uk-build:latest
|
||||
docker push ghcr.io/opdavies/oliverdavies.uk-build:$(git rev-parse HEAD)
|
||||
}
|
||||
|
||||
function cmd {
|
||||
# Run any command in the app container.
|
||||
_dc app "${@}"
|
||||
|
@ -29,11 +19,6 @@ function composer {
|
|||
_dc --entrypoint composer app "${@}"
|
||||
}
|
||||
|
||||
function deploy {
|
||||
cd tools/deployment
|
||||
ansible-playbook deploy.yml "${@}"
|
||||
}
|
||||
|
||||
function help {
|
||||
printf "%s <task> [args]\n\nTasks:\n" "${0}"
|
||||
|
||||
|
@ -42,25 +27,6 @@ function help {
|
|||
printf "\nExtended help:\n Each task has comments for general usage\n"
|
||||
}
|
||||
|
||||
function run-production {
|
||||
DESTINATION_PATH="${2:-/var/www/oliverdavies.uk}"
|
||||
GIT_COMMIT_HASH="${1:-latest}"
|
||||
|
||||
# Clean up any old containers or files within the artifact directory.
|
||||
rm -fr ${DESTINATION_PATH}/* || true
|
||||
|
||||
docker image pull ghcr.io/opdavies/oliverdavies-uk-web:${GIT_COMMIT_HASH}
|
||||
|
||||
docker container run \
|
||||
--entrypoint sh \
|
||||
--name oliverdavies-uk-web \
|
||||
ghcr.io/opdavies/oliverdavies-uk-web:${GIT_COMMIT_HASH}
|
||||
|
||||
docker container cp oliverdavies-uk-web:/code/. ${DESTINATION_PATH}
|
||||
|
||||
docker container rm oliverdavies-uk-web
|
||||
}
|
||||
|
||||
function sh {
|
||||
DC=run
|
||||
_dc --entrypoint sh app
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue