From ef6dac4f4755da1bdc3d38a4861752d622a4c89d Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Tue, 3 Mar 2026 10:06:36 -0800 Subject: [PATCH] repo: gitea: workflows: dfi: add tests for custom compose merge file --- .gitea/workflows/dfi.bash | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/dfi.bash b/.gitea/workflows/dfi.bash index e73b40c..940de22 100755 --- a/.gitea/workflows/dfi.bash +++ b/.gitea/workflows/dfi.bash @@ -85,7 +85,7 @@ function client::install() function client::finance::gen() { local -r _tags=("micro" "tiny" "slim" "default") - local -r _types=("env" "build" "superscript" "env,build,superscript") + local -r _types=("env" "build" "compose" "superscript" "env,build,compose,superscript") for _tag in "${_tags[@]}"; do for _type in "${_types[@]}"; do @@ -112,10 +112,16 @@ function client::finance::edit() types+=("env") types+=("shell" "superscript") types+=("build" "dockerfile") + types+=("compose") types+=("env,shell,build") - types+=("env,superscript,dockerfile") + types+=("env,superscript,dockerfile,compose") declare -r types + # The expected default path for default finance image + local _path + _path="${HOME:?}/docker-finance/conf.d/client/$(uname -s)-$(uname -m)/archlinux/default" + declare -r _path + for _tag in "${tags[@]}"; do for _type in "${types[@]}"; do local _edit="dfi archlinux/${USER}:${_tag} edit" @@ -127,12 +133,25 @@ function client::finance::edit() # Valid "${ci_shell[@]}" "$_edit type=${_type} & wait ; kill -9 %1" done - # Build: uncomment all optional packages and plugin dependencies + if [[ "$_tag" == "default" ]]; then local _file - _file="${HOME:?}/docker-finance/conf.d/client/$(uname -s)-$(uname -m)/archlinux/default/Dockerfiles/${USER:?}@$(uname -n)" + + # Build: uncomment all optional packages and plugin dependencies from custom build file + _file="${_path}/Dockerfiles/${USER:?}@$(uname -n)" [ ! -f "$_file" ] && exit 1 sed -i '18,56s/#//' "$_file" + + # Build: uncomment custom compose merge file + _file+=".yml" + [ ! -f "$_file" ] && exit 1 + sed -i '8,13s/#//' "$_file" + + # env: add variables used in custom compose merge file + _file="${_path}/env/${USER:?}@$(uname -n)" + [ ! -f "$_file" ] && exit 1 + echo "DOCKER_FINANCE_CLIENT_TESTING=/tmp/testing" >>$_file + echo "DOCKER_FINANCE_CONTAINER_TESTING=/tmp/testing" >>$_file fi done } @@ -722,7 +741,7 @@ function container::finance::root() function client::dev-tools::gen() { local -r _tags=("micro" "tiny" "slim" "default") - local -r _types=("env" "build" "superscript" "env,build,superscript") + local -r _types=("env" "build" "compose" "superscript" "env,build,compose,superscript") # TODO: 'default' should only be supported for _tag in "${_tags[@]}"; do @@ -747,7 +766,8 @@ function client::dev-tools::edit() _types+=("env") _types+=("shell" "superscript") _types+=("build" "dockerfile") - _types+=("env,shell,build") + _types+=("compose") + _types+=("env,shell,build,compose") _types+=("env,superscript,dockerfile") declare -r _types