From 8102d3dfa6914730e4d2aae26cd33c53c276da11 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 9 Sep 2023 11:50:15 -0400 Subject: acid: build: Always specify --project-name The script is refactored to always provide an explicit --project-name option to docker compose. Still taken from the $CYCHE_SERVICES config and only modified if --self is given. This addresses an issue when using a docker-compose.yml from within a subdirectory. If --project-name is omitted, the directory name used by docker is the one containing the YML file, not the working directory (git repository root). When calling `docker compose down` (when given --self), we now omit the --file as it is unnecessary. Signed-off-by: Malfurious --- acid/cyche-build | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/acid/cyche-build b/acid/cyche-build index 310a087..7f63117 100755 --- a/acid/cyche-build +++ b/acid/cyche-build @@ -27,18 +27,18 @@ cd "/services/$1" if [ "$4" == "--self" ]; then prev=$(cat '.git/previous_slug') - [ -n "$prev" ] && prev="--project-name $prev" - - slug=$(echo -n "$1-"; tr -dc a-z .git/previous_hash if [ "$4" == "--self" ]; then - echo "$slug" >.git/previous_slug - docker compose --file "$2" down - docker compose $prev --file "$2" down + echo "$name" >.git/previous_slug + docker compose --project-name "$1" down + docker compose --project-name "$prev" down fi -- cgit v1.2.3