- Move repo from Rx3/docker_tools to Rx3-Docker/docker_tools,

- docker_service_add:
    - Add *_LOG_* variable generation,
- Add docker_build_push command.
This commit is contained in:
Arnaud G. GIBERT 2024-11-15 19:58:26 +01:00
parent 67101865a7
commit 9462b195c5
4 changed files with 57 additions and 17 deletions

View File

@ -1,8 +1,8 @@
Welcome to Docker Tools! Welcome to Rx3-Docker/Docker Tools!
This is project aims to give some basic tools to be used by others Rx3 docker packaging projects. This project aims to give some basic tools to be used by other Rx3 docker packaging projects.
Features: Features:
- docker_mk_env command to compile env file into .env file, - docker_mk_env command to compile env file into .env file,
@ -16,4 +16,4 @@ Your Docker Tools Team.
-- --
arnaud@rx3.net arnaud@rx3.net
https://git.rx3.org/gitea/rx3/docker_tools https://git.rx3.org/gitea/rx3-docker/docker_tools

View File

@ -1,3 +1,14 @@
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/Docker Tools V 1.2.0 - A. GIBERT - 2024/11/15
------------------------------------------------------------------------------------------------------------------------------------
- Move repo from Rx3/docker_tools to Rx3-Docker/docker_tools,
- docker_service_add:
- Add *_LOG_* variable generation,
- Add docker_build_push command.
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
Docker Tools V 1.1.0 - A. GIBERT - 2024/11/03 Docker Tools V 1.1.0 - A. GIBERT - 2024/11/03
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------

15
sbin/docker_build_push Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
#-------------------------------------------------------------------------------
set -o errexit
APPL_HOME_DIR="$(dirname "$(dirname "$0")")"
#-------------------------------------------------------------------------------
sbin/docker_mk_env
docker compose build
docker compose push

View File

@ -30,21 +30,35 @@ function docker_service_add
varible_prefix="$1" varible_prefix="$1"
shift shift
for var in NAME NAME_FULL URL_PREFIX IMG_NAME VERSION_EXT VERSION_INT PORT_MAIN_EXT PORT_MAIN_INT PORT_ADMIN_EXT PORT_ADMIN_INT USER_NAME GROUP_NAME for var in NAME NAME_FULL URL_PREFIX IMG_NAME APPL_NAME VERSION_EXT VERSION_INT PORT_MAIN_EXT PORT_MAIN_INT PORT_ADMIN_EXT PORT_ADMIN_INT USER_NAME GROUP_NAME
do do
dynvar_export "${varible_prefix}_${var}" "$1" dynvar_export "${varible_prefix}_${var}" "$1"
shift shift
done done
dynvar_export "${varible_prefix}_LOG_INT_INIT_DIR" "/var/log/init"
dynvar_export "${varible_prefix}_LOG_EXT_INIT_DIR" "./var/log/init-\${${varible_prefix}_NAME}"
dynvar_export "${varible_prefix}_LOG_INT_SV_DIR" "/var/log/supervisor"
dynvar_export "${varible_prefix}_LOG_EXT_SV_DIR" "./var/log/supervisor-\${${varible_prefix}_NAME}"
if [[ $( eval echo \${${varible_prefix}_APPL_NAME}) != "-" ]]
then
dynvar_export "${varible_prefix}_LIB_INT_DIR" "/var/lib/\${${varible_prefix}_APPL_NAME}"
dynvar_export "${varible_prefix}_LIB_EXT_DIR" "./var/lib/\${${varible_prefix}_APPL_NAME}"
dynvar_export "${varible_prefix}_LOG_INT_MAIN_DIR" "/var/log/\${${varible_prefix}_APPL_NAME}"
dynvar_export "${varible_prefix}_LOG_EXT_MAIN_DIR" "./var/log/\${${varible_prefix}_APPL_NAME}"
fi
if [[ $( eval echo \${${varible_prefix}_IMG_NAME}) != "-" ]] if [[ $( eval echo \${${varible_prefix}_IMG_NAME}) != "-" ]]
then then
# No Build # No Build
dynvar_export "${varible_prefix}_IMG_URL" "\${${varible_prefix}_URL_PREFIX}/\${${varible_prefix}_IMG_NAME}:\${${varible_prefix}_VERSION_INT}" dynvar_export "${varible_prefix}_IMG_URL" "\${${varible_prefix}_URL_PREFIX}/\${${varible_prefix}_IMG_NAME}:\${${varible_prefix}_VERSION_EXT}"
else else
# Build # Build
dynvar_export "${varible_prefix}_IMG_URL" "\${${varible_prefix}_URL_PREFIX}/\${${varible_prefix}_NAME}:\${${varible_prefix}_VERSION_INT}" dynvar_export "${varible_prefix}_IMG_URL" "\${${varible_prefix}_URL_PREFIX}/\${${varible_prefix}_NAME}:\${${varible_prefix}_VERSION_EXT}"
dynvar_export "${varible_prefix}_MODULE_NAME" "\${${varible_prefix}_NAME}" dynvar_export "${varible_prefix}_MODULE_NAME" "\${${varible_prefix}_NAME}"
dynvar_export "${varible_prefix}_MODULE_PATH" "src/\${${varible_prefix}_NAME}" dynvar_export "${varible_prefix}_MODULE_PATH" "src/\${${varible_prefix}_NAME}"