Merge pull request #147 into master
bfdc245client: src: lib_gen: filter custom Dockerfile's .in files (Aaron Fiore)a1cea1fclient: docker-finance.d: Dockerfiles: add docker-finance version tag (Aaron Fiore)4a836a7client: src: lib_gen: filter container config .in files (Aaron Fiore)f18bd9aclient: docker-finance.d: fetch: re-add docker-finance version tag (Aaron Fiore)ae2c08dclient: src: lib_docker: filter docker related .in files (Aaron Fiore)
This commit was merged in pull request #147.
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# docker-finance @DOCKER_FINANCE_VERSION@
|
||||
|
||||
#
|
||||
# Custom (optional) Dockerfile
|
||||
#
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# docker-finance @DOCKER_FINANCE_VERSION@
|
||||
|
||||
#
|
||||
# Custom (optional) Dockerfile
|
||||
#
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# docker-finance @DOCKER_FINANCE_VERSION@
|
||||
|
||||
#
|
||||
# Custom (optional) Dockerfile
|
||||
#
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# docker-finance @DOCKER_FINANCE_VERSION@
|
||||
|
||||
#
|
||||
# Configuration for `fetch` command
|
||||
#
|
||||
|
||||
@@ -74,6 +74,7 @@ function lib_docker::__docker()
|
||||
-e "s|@DOCKER_FINANCE_IMAGE@|${global_image}:${global_tag}|g" \
|
||||
-e "s|@DOCKER_FINANCE_CONTAINER@|${global_container}|g" \
|
||||
-e "s|@DOCKER_FINANCE_NETWORK@|${global_network}|g" \
|
||||
-e "/^ *#/d" -e "/^$/d" \
|
||||
"${_path}.${global_platform}.in" >"$_path" || return $?
|
||||
}
|
||||
|
||||
@@ -318,6 +319,9 @@ function lib_docker::__build()
|
||||
echo -e "# WARNING: keep at end of file\nUSER ${DOCKER_FINANCE_USER}\nWORKDIR /home/${DOCKER_FINANCE_USER}\n" \
|
||||
>>"$_final"
|
||||
|
||||
# Remove all comments and empty lines
|
||||
sed -i -e "/^ *#/d" -e "/^$/d" "$_final"
|
||||
|
||||
#
|
||||
# Execute
|
||||
#
|
||||
|
||||
@@ -455,7 +455,6 @@ function lib_gen::__gen_client()
|
||||
local _confirm="${_read:-y}"
|
||||
if [[ "$_confirm" == [yY] || -z "$global_arg_confirm" ]]; then
|
||||
cp -a "$global_custom_dockerfile" "${global_custom_dockerfile}_${global_suffix}" || lib_utils::die_fatal
|
||||
cp -fa "$global_repo_custom_dockerfile" "$global_custom_dockerfile" || lib_utils::die_fatal
|
||||
fi
|
||||
else
|
||||
lib_utils::print_custom " \e[32m│\e[0m\n"
|
||||
@@ -463,10 +462,16 @@ function lib_gen::__gen_client()
|
||||
|
||||
lib_utils::print_debug "$global_repo_custom_dockerfile"
|
||||
lib_utils::print_debug "$global_custom_dockerfile"
|
||||
|
||||
cp -a "$global_repo_custom_dockerfile" "$global_custom_dockerfile"
|
||||
fi
|
||||
|
||||
# Filter to de-clutter output file (license cleanup)
|
||||
local -r _filter="1,17d"
|
||||
|
||||
sed \
|
||||
-e "$_filter" \
|
||||
-e "s:@DOCKER_FINANCE_VERSION@:${global_client_version}:g" \
|
||||
"$global_repo_custom_dockerfile" >"$global_custom_dockerfile" || lib_utils::die_fatal
|
||||
|
||||
lib_utils::print_custom " \e[32m│ └─\e[34m Edit file now? [Y/n] \e[0m"
|
||||
lib_gen::__gen_edit "$global_custom_dockerfile"
|
||||
fi
|
||||
@@ -580,7 +585,11 @@ function lib_gen::__gen_superscript_write()
|
||||
[ -z "$global_superscript" ] && lib_utils::die_fatal
|
||||
lib_utils::print_debug "global_superscript=${global_superscript}"
|
||||
|
||||
# Filter to de-clutter output file (license cleanup)
|
||||
local -r _filter="3,19d"
|
||||
|
||||
sed \
|
||||
-e "$_filter" \
|
||||
-e "s:@DOCKER_FINANCE_VERSION@:${global_client_version}:g" \
|
||||
"${global_repo_conf_dir}/container/shell/superscript.bash.in" >"$global_superscript"
|
||||
}
|
||||
@@ -846,7 +855,11 @@ function lib_gen::__gen_subprofile_flow_subscript_write()
|
||||
[ -z "$global_client_version" ] && lib_utils::die_fatal
|
||||
[ -z "$global_repo_conf_dir" ] && lib_utils::die_fatal
|
||||
|
||||
# Filter to de-clutter output file (license cleanup)
|
||||
local -r _filter="3,19d"
|
||||
|
||||
sed \
|
||||
-e "$_filter" \
|
||||
-e "s:@DOCKER_FINANCE_CONTAINER_CMD@:${DOCKER_FINANCE_CONTAINER_CMD}:g" \
|
||||
-e "s:@DOCKER_FINANCE_CONTAINER_REPO@:${DOCKER_FINANCE_CONTAINER_REPO}:g" \
|
||||
-e "s:@DOCKER_FINANCE_VERSION@:${global_client_version}:g" \
|
||||
@@ -917,7 +930,11 @@ function lib_gen::__gen_subprofile_flow_fetch_write()
|
||||
[ -z "$global_client_version" ] && lib_utils::die_fatal
|
||||
[ -z "$global_repo_conf_dir" ] && lib_utils::die_fatal
|
||||
|
||||
# Filter to de-clutter output file (license cleanup)
|
||||
local -r _filter="1,17d"
|
||||
|
||||
sed \
|
||||
-e "$_filter" \
|
||||
-e "s:@DOCKER_FINANCE_VERSION@:${global_client_version}:g" \
|
||||
-e "s:@DOCKER_FINANCE_PROFILE@:${_profile}:g" \
|
||||
-e "s:@DOCKER_FINANCE_SUBPROFILE@:${_subprofile}:g" \
|
||||
@@ -965,6 +982,7 @@ function lib_gen::__gen_subprofile_flow_meta_write()
|
||||
[ -z "$global_repo_conf_dir" ] && lib_utils::die_fatal
|
||||
|
||||
# Deletes default comments or else ROOT meta sample won't work out-of-the-box
|
||||
# TODO: possible to keep filtered comments using upstream options?
|
||||
sed \
|
||||
-e "/\/\/\\!/d" \
|
||||
-e "s:@DOCKER_FINANCE_VERSION@:${global_client_version}:g" \
|
||||
@@ -1013,7 +1031,11 @@ function lib_gen::__gen_subprofile_flow_hledger_write()
|
||||
[ -z "$global_repo_conf_dir" ] && lib_utils::die_fatal
|
||||
lib_utils::print_debug "global_repo_conf_dir=${global_repo_conf_dir}"
|
||||
|
||||
# Filter to de-clutter output file (license cleanup)
|
||||
local -r _filter="1,17d"
|
||||
|
||||
sed \
|
||||
-e "$_filter" \
|
||||
-e "s:@DOCKER_FINANCE_VERSION@:${global_client_version}:g" \
|
||||
"${global_repo_conf_dir}/container/hledger/hledger.conf.in" >"$_file"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user