From 53f0b608eb376c59428cf019a3737d24babc370d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chastanet?= Date: Sun, 3 Dec 2023 22:19:44 +0100 Subject: [PATCH] migrated to bash-tools-framework 2.0.1 --- .github/workflows/lint-test.yml | 12 +- .pre-commit-config.yaml | 2 +- bin/dbImport | 2 +- bin/dbImportStream | 2 +- bin/dbQueryAllDatabases | 6 +- bin/dbScriptAllDatabases | 4 +- bin/doc | 204 +++++++++++++++--- src/_binaries/DbImport/testsData/gawk | 2 +- .../DbQueryAllDatabases/testsData/gawk | 2 +- src/_binaries/build/doc.options.tpl | 22 -- src/_binaries/build/doc.sh | 23 +- 11 files changed, 213 insertions(+), 68 deletions(-) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 8f83d349..dfc396e1 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -24,33 +24,33 @@ jobs: include: - vendor: ubuntu bashImage: ubuntu:20.04 - batsOptions: -j 30 + batsOptions: -j 1 bashTarVersion: 4.4 runPrecommitTests: false - vendor: ubuntu bashImage: ubuntu:20.04 bashTarVersion: 5.0 - batsOptions: -j 30 + batsOptions: -j 1 runPrecommitTests: false - vendor: ubuntu bashImage: ubuntu:20.04 bashTarVersion: 5.1 - batsOptions: -j 30 + batsOptions: -j 1 runPrecommitTests: true - vendor: alpine bashTarVersion: 4.4 bashImage: amd64/bash:4.4-alpine3.18 - batsOptions: -j 30 + batsOptions: -j 1 runPrecommitTests: false - vendor: alpine bashTarVersion: 5.0 bashImage: amd64/bash:5.0-alpine3.18 - batsOptions: -j 30 + batsOptions: -j 1 runPrecommitTests: false - vendor: alpine bashTarVersion: 5.1 bashImage: amd64/bash:5.1-alpine3.18 - batsOptions: -j 30 + batsOptions: -j 1 runPrecommitTests: false steps: - name: Checkout diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4379fbb0..a3d70d1d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -61,7 +61,7 @@ repos: - id: prettier - repo: https://github.com/fchastanet/bash-tools-framework - rev: 2.0.0 + rev: 2.0.1 hooks: - id: fixShebangExecutionBit - id: fixShebangExecutionBitGithubActions diff --git a/bin/dbImport b/bin/dbImport index c2fdb4fd..8669380f 100755 --- a/bin/dbImport +++ b/bin/dbImport @@ -816,7 +816,7 @@ Version::checkMinimal() { Version::compare "${version}" "${minimalVersion}" || { local result=$? if [[ "${result}" = "1" ]]; then - Log::displayWarning "${commandName} version is ${version} greater than ${minimalVersion}, OK let's continue" + Log::displayDebug "${commandName} version is ${version} greater than ${minimalVersion}, OK let's continue" elif [[ "${result}" = "2" ]]; then Log::displayError "${commandName} minimal version is ${minimalVersion}, your version is ${version}" return 1 diff --git a/bin/dbImportStream b/bin/dbImportStream index a7c9b1d2..4b213b9b 100755 --- a/bin/dbImportStream +++ b/bin/dbImportStream @@ -726,7 +726,7 @@ Version::checkMinimal() { Version::compare "${version}" "${minimalVersion}" || { local result=$? if [[ "${result}" = "1" ]]; then - Log::displayWarning "${commandName} version is ${version} greater than ${minimalVersion}, OK let's continue" + Log::displayDebug "${commandName} version is ${version} greater than ${minimalVersion}, OK let's continue" elif [[ "${result}" = "2" ]]; then Log::displayError "${commandName} minimal version is ${minimalVersion}, your version is ${version}" return 1 diff --git a/bin/dbQueryAllDatabases b/bin/dbQueryAllDatabases index 358666fa..96980d37 100755 --- a/bin/dbQueryAllDatabases +++ b/bin/dbQueryAllDatabases @@ -709,7 +709,7 @@ Version::checkMinimal() { Version::compare "${version}" "${minimalVersion}" || { local result=$? if [[ "${result}" = "1" ]]; then - Log::displayWarning "${commandName} version is ${version} greater than ${minimalVersion}, OK let's continue" + Log::displayDebug "${commandName} version is ${version} greater than ${minimalVersion}, OK let's continue" elif [[ "${result}" = "2" ]]; then Log::displayError "${commandName} minimal version is ${minimalVersion}, your version is ${version}" return 1 @@ -1094,8 +1094,8 @@ Log::logSkipped() { # @require Compiler::Embed::requireEm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oKZmFjYWRlX21haW5fZW1iZWRGcmFtZXdvcmtGdW5jdGlvbmJpbkZpbGV0cGwgIiRAIgo=" Compiler::Embed::extractFileFromBase64 \ "${embed_function_DbQueryOneDatabase}" \ diff --git a/bin/dbScriptAllDatabases b/bin/dbScriptAllDatabases index 0ea90f86..bc6ddc93 100755 --- a/bin/dbScriptAllDatabases +++ b/bin/dbScriptAllDatabases @@ -1014,8 +1014,8 @@ Log::logSkipped() { # @require Compiler::Embed::requireEmbedBinDir -declare -gx embed_function_DbQueryOneDatabase="${PERSISTENT_TMPDIR:-/tmp}/bin/4cef0342315f0f46df05f211b9babac8/dbQueryOneDatabase" -declare -gx encoded_binary_file_DbQueryOneDatabase="IyEvdXNyL2Jpbi9lbnYgYmFzaAojIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjCiMgR0VORVJBVEVEIEZBQ0FERSBGUk9NIGh0dHBzOi8vZ2l0aHViLmNvbS9mY2hhc3RhbmV0L2Jhc2gtdG9vbHMvdHJlZS9tYXN0ZXIvLi4vLi4vLmNhY2hlL3ByZS1jb21taXQvcmVwb3NoZTNpZXJnL3NyYy9Db21waWxlci9FbWJlZC9lbWJlZEZyYW1ld29ya0Z1bmN0aW9uLmJpbkZpbGUudHBsCiMgRE8gTk9UIEVESVQgSVQKIyBAZ2VuZXJhdGVkCiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKIyBzaGVsbGNoZWNrIGRpc2FibGU9U0MyMjg4LFNDMjAzNAojIEJJTl9GSUxFPSR7QklOX0ZJTEV9CiMgRkFDQURFCgojIGVuc3VyZSB0aGF0IG5vIHVzZXIgYWxpYXNlcyBjb3VsZCBpbnRlcmZlcmUgd2l0aAojIGNvbW1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21waWxlcjo6RmFjYWRlOjpyZXF1aXJlQ29tbWFuZEJpbkRpcgoKIyBAcmVxdWlyZSBDb21waWxlcjo6RmFjYWRlOjpyZXF1aXJlQ29tbWFuZEJpbkRpcgoKIyBzaGVsbGNoZWNrIGRpc2FibGU9U0MyMTU0LFNDMjAxNgpmdW5jdGlvblRvQ2FsbD0nRGI6OnF1ZXJ5T25lRGF0YWJhc2UnCiIke2Z1bmN0aW9uVG9DYWxsfSIgIiRAIgoKfQoKZmFjYWRlX21haW5fZW1iZWRGcmFtZXdvcmtGdW5jdGlvbmJpbkZpbGV0cGwgIiRAIgo=" Compiler::Embed::extractFileFromBase64 \ "${embed_function_DbQueryOneDatabase}" \ diff --git a/bin/doc b/bin/doc index bfd43842..38ef42c7 100755 --- a/bin/doc +++ b/bin/doc @@ -211,6 +211,108 @@ Array::wrap() { #set -x #Array::wrap ":" 40 0 "Lorem ipsum dolor sit amet," "consectetur adipiscing elit." "Curabitur ac elit id massa" "condimentum finibus." +# @description checkout usage doc below +# +# [DockerNamespace usage](DockerUsage.md ':include') + +# @description run the container specified by args provided. +# build and push the image if needed +# +# @env DOCKER_BUILD_OPTIONS +# @env SKIP_USER +# @env USER_ID +# @env GROUP_ID +# @env FRAMEWORK_ROOT_DIR +# @env DOCKER_OPTION_IMAGE_TAG +# @env RUN_CONTAINER_ARGV_FILTERED +Docker::runBuildContainer() { + local optionVendor="$1" + local optionBashVersion="$2" + local optionBashBaseImage="$3" + local optionSkipDockerBuild="$4" + local optionTraceVerbose="$5" + local optionContinuousIntegrationMode="$6" + local -n localDockerRunCmd=$7 + local -n localDockerRunArgs=$8 + if tty -s; then + localDockerRunArgs+=("-it") + fi + if [[ -d "$(pwd)/vendor/bash-tools-framework" ]]; then + localDockerRunArgs+=( + -v "$(cd "$(pwd)/vendor/bash-tools-framework" && pwd -P):/bash/vendor/bash-tools-framework" + ) + fi + + # shellcheck disable=SC2154 + if [[ "${optionContinuousIntegrationMode}" = "0" ]]; then + localDockerRunArgs+=(-v "/tmp:/tmp") + fi + + # shellcheck disable=SC2154 + Log::displayInfo "Using ${optionVendor}:${optionBashVersion}" + + local imageRef="${DOCKER_OPTION_IMAGE_TAG:-build:bash-tools-${optionVendor}-${optionBashVersion}}" + if [[ "${optionSkipDockerBuild:-0}" != "1" ]]; then + Log::displayInfo "Build docker image ${imageRef}" + # shellcheck disable=SC2154 + ( + if [[ "${optionTraceVerbose}" = "1" ]]; then + set -x + fi + Docker::buildPushDockerImage \ + "${optionVendor}" \ + "${optionBashVersion}" \ + "${optionBashBaseImage}" \ + "${optionPush}" \ + "${optionTraceVerbose}" + ) + fi + if [[ -f "${FRAMEWORK_ROOT_DIR}/.docker/DockerfileUser" ]]; then + local imageRefUser="${imageRef}-user" + if [[ "${optionSkipDockerBuild:-0}" != "1" ]]; then + Log::displayInfo "build docker image ${imageRefUser} with user configuration" + # shellcheck disable=SC2154 + ( + if [[ "${optionTraceVerbose}" = "1" ]]; then + set -x + fi + # shellcheck disable=SC2086 + DOCKER_BUILDKIT=1 docker build \ + ${DOCKER_BUILD_OPTIONS} \ + --cache-from "scrasnups/${imageRef}" \ + --build-arg "BASH_IMAGE=scrasnups/${imageRef}" \ + --build-arg SKIP_USER="${SKIP_USER:-0}" \ + --build-arg USER_ID="${USER_ID:-$(id -u)}" \ + --build-arg GROUP_ID="${GROUP_ID:-$(id -g)}" \ + -f "${FRAMEWORK_ROOT_DIR}/.docker/DockerfileUser" \ + -t "${imageRefUser}" \ + "${FRAMEWORK_ROOT_DIR}/.docker" + ) + fi + fi + + Log::displayDebug "Run container with localDockerRunCmd: ${localDockerRunCmd[*]}" + Log::displayDebug "Run container with localDockerRunArgs: ${localDockerRunArgs[*]}" + Log::displayDebug "Run container with RUN_CONTAINER_ARGV_FILTERED: ${RUN_CONTAINER_ARGV_FILTERED[*]}" + ( + # shellcheck disable=SC2154 + if [[ "${optionTraceVerbose}" = "1" ]]; then + set -x + fi + # shellcheck disable=SC2086 + docker run \ + --rm \ + "${localDockerRunArgs[@]}" \ + ${DOCKER_RUN_OPTIONS} \ + "${RUN_CONTAINER_ARGV_FILTERED[@]}" \ + -w /bash \ + -v "$(pwd):/bash" \ + --user "${USER_ID:-$(id -u)}:${GROUP_ID:-$(id -g)}" \ + "${imageRefUser}" \ + "${localDockerRunCmd[@]}" + ) +} + # @description ensure env files are loaded # @arg $@ list of default files to load at the end # @exitcode 1 if one of env files fails to load @@ -570,6 +672,63 @@ Assert::tty() { [[ -t 1 || -t 2 ]] } +# @description build image and push it ot registry +# @env DOCKER_OPTION_IMAGE_TAG String computed from optionVendor and optionBashVersion if not provided +# @env DOCKER_OPTION_IMAGE String default scrasnups/${DOCKER_OPTION_IMAGE_TAG} +# @env DOCKER_BUILD_OPTIONS String list of docker arguments to pass to docker build command +# @env FRAMEWORK_ROOT_DIR String path allowing to deduce .docker/Dockerfile.{vendor} +Docker::buildPushDockerImage() { + local optionVendor="$1" + local optionBashVersion="$2" + local optionBashBaseImage="$3" + local optionPush="$4" + local optionTraceVerbose="$5" + # parameters based on env variables + local imageTag="${DOCKER_OPTION_IMAGE_TAG:-build:bash-tools-${optionVendor}-${optionBashVersion}}" + local image="${DOCKER_OPTION_IMAGE:-scrasnups/${imageTag}}" + local DOCKER_BUILD_OPTIONS="${DOCKER_BUILD_OPTIONS:-}" + + Log::displayInfo "Pull image ${image}" + ( + if [[ "${optionTraceVerbose}" = "1" ]]; then + set -x + fi + docker pull "${image}" || true + ) + + Log::displayInfo "Build image ${image}" + # shellcheck disable=SC2086 + ( + if [[ "${optionTraceVerbose}" = "1" ]]; then + set -x + fi + DOCKER_BUILDKIT=1 docker build \ + ${DOCKER_BUILD_OPTIONS} \ + -f "${FRAMEWORK_ROOT_DIR}/.docker/Dockerfile.${optionVendor}" \ + --cache-from "${image}" \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ + --build-arg argBashVersion="${optionBashVersion}" \ + --build-arg BASH_IMAGE="${optionBashBaseImage}" \ + -t "${imageTag}" \ + -t "${image}" \ + "${FRAMEWORK_ROOT_DIR}/.docker" + ) + + Log::displayInfo "Image ${image} - bash version check" + docker run --rm "${imageTag}" bash --version + + # shellcheck disable=SC2154 + if [[ "${optionPush}" = "1" ]]; then + Log::displayInfo "Push image ${image}" + ( + if [[ "${optionTraceVerbose}" = "1" ]]; then + set -x + fi + docker push "scrasnups/${imageTag}" + ) + fi +} + # @description prepend directories to the PATH environment variable # @arg $@ args:String[] list of directories to prepend # @set PATH update PATH with the directories prepended @@ -774,7 +933,6 @@ Compiler::Facade::requireCommandBinDir DOC_DIR="${BASH_TOOLS_ROOT_DIR}/pages" declare copyrightBeginYear="2020" -declare -a RUN_CONTAINER_ARGV_FILTERED=() declare -a BASH_FRAMEWORK_ARGV_FILTERED=() @@ -1415,35 +1573,29 @@ docCommand() { fi } -updateOptionSkipDockerBuildCallback() { - if [[ "${IN_BASH_DOCKER:-}" != "You're in docker" ]]; then - BASH_FRAMEWORK_ARGV_FILTERED+=("$1") - RUN_CONTAINER_ARGV_FILTERED+=("$1") - fi -} -# shellcheck disable=SC2317 # if function is overridden -updateArgListInfoVerboseCallback() { - RUN_CONTAINER_ARGV_FILTERED+=(--verbose) - BASH_FRAMEWORK_ARGV_FILTERED+=(--verbose) -} -# shellcheck disable=SC2317 # if function is overridden -updateArgListDebugVerboseCallback() { - RUN_CONTAINER_ARGV_FILTERED+=(-vv) - BASH_FRAMEWORK_ARGV_FILTERED+=(-vv) -} -# shellcheck disable=SC2317 # if function is overridden -updateArgListTraceVerboseCallback() { - RUN_CONTAINER_ARGV_FILTERED+=(-vvv) - BASH_FRAMEWORK_ARGV_FILTERED+=(-vvv) -} - docCommand parse "${BASH_FRAMEWORK_ARGV[@]}" run() { if [[ "${IN_BASH_DOCKER:-}" != "You're in docker" ]]; then - DOCKER_RUN_OPTIONS=$"-e ORIGINAL_DOC_DIR=${DOC_DIR}" \ - "${FRAMEWORK_BIN_DIR}/runBuildContainer" "/bash/bin/doc" \ - "${RUN_CONTAINER_ARGV_FILTERED[@]}" + local -a dockerRunCmd=( + "/bash/bin/doc" + "${BASH_FRAMEWORK_ARGV_FILTERED[@]}" + ) + # shellcheck disable=SC2034 + local -a dockerArgvFiltered=( + -e ORIGINAL_DOC_DIR="${DOC_DIR}" + ) + # shellcheck disable=SC2154 + Docker::runBuildContainer \ + "${optionVendor:-ubuntu}" \ + "${optionBashVersion:-5.1}" \ + "${optionBashBaseImage:-ubuntu:20.04}" \ + "${optionSkipDockerBuild}" \ + "${optionTraceVerbose}" \ + "${optionContinuousIntegrationMode}" \ + dockerRunCmd \ + dockerArgvFiltered + return $? fi diff --git a/src/_binaries/DbImport/testsData/gawk b/src/_binaries/DbImport/testsData/gawk index 29177b2d..aed42815 100755 --- a/src/_binaries/DbImport/testsData/gawk +++ b/src/_binaries/DbImport/testsData/gawk @@ -1,6 +1,6 @@ #!/usr/bin/env bash if [[ "$1" = "--version" ]]; then - echo "GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.1.0, GNU MP 6.2.0)" + echo "GNU Awk 5.1.1, API: 2.0 (GNU MPFR 4.1.0, GNU MP 6.2.0)" else echo "$( parse "${BASH_FRAMEWORK_ARGV[@]}" diff --git a/src/_binaries/build/doc.sh b/src/_binaries/build/doc.sh index 14890978..e2d6a6a4 100755 --- a/src/_binaries/build/doc.sh +++ b/src/_binaries/build/doc.sh @@ -6,15 +6,30 @@ DOC_DIR="${BASH_TOOLS_ROOT_DIR}/pages" declare copyrightBeginYear="2020" -declare -a RUN_CONTAINER_ARGV_FILTERED=() .INCLUDE "$(dynamicTemplateDir _binaries/build/doc.options.tpl)" run() { if [[ "${IN_BASH_DOCKER:-}" != "You're in docker" ]]; then - DOCKER_RUN_OPTIONS=$"-e ORIGINAL_DOC_DIR=${DOC_DIR}" \ - "${FRAMEWORK_BIN_DIR}/runBuildContainer" "/bash/bin/doc" \ - "${RUN_CONTAINER_ARGV_FILTERED[@]}" + local -a dockerRunCmd=( + "/bash/bin/doc" + "${BASH_FRAMEWORK_ARGV_FILTERED[@]}" + ) + # shellcheck disable=SC2034 + local -a dockerArgvFiltered=( + -e ORIGINAL_DOC_DIR="${DOC_DIR}" + ) + # shellcheck disable=SC2154 + Docker::runBuildContainer \ + "${optionVendor:-ubuntu}" \ + "${optionBashVersion:-5.1}" \ + "${optionBashBaseImage:-ubuntu:20.04}" \ + "${optionSkipDockerBuild}" \ + "${optionTraceVerbose}" \ + "${optionContinuousIntegrationMode}" \ + dockerRunCmd \ + dockerArgvFiltered + return $? fi