diff --git a/.cicd-tools/bin/manifest.sh b/.cicd-tools/bin/manifest.sh deleted file mode 100755 index e8fcabb..0000000 --- a/.cicd-tools/bin/manifest.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash - -# Manifest file reader. -# Requires the jq binary: https://stedolan.github.io/jq/download/ - -# CICD-Tools script. - -set -eo pipefail - -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/logging.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../boxes/bootstrap/libraries/logging.sh" - -manifest() { - local MANIFEST_FILE - _manifest_args "$@" -} - -_manifest_args() { - local OPTARG - local OPTIND - local OPTION - - while getopts "m:" OPTION; do - case "$OPTION" in - m) - MANIFEST_FILE="${OPTARG}" - ;; - \?) - _manifest_usage - ;; - :) - _manifest_usage - ;; - *) - _manifest_usage - ;; - esac - done - shift $((OPTIND - 1)) - if [[ -z "${MANIFEST_FILE}" ]]; then - _manifest_usage - fi - _manifest_commands "$@" -} - -_manifest_commands() { - case "$1" in - security) - [[ -n "${2}" ]] && _manifest_usage - log "DEBUG" "MANIFEST > Reading security status from manifest." - _manifest_security - ;; - toolbox_url) - [[ -z "${2}" ]] && _manifest_usage - log "DEBUG" "MANIFEST > Reading toolbox url for '${2}' from manifest." - _manifest_toolbox_url "${2}" - ;; - toolbox_sha) - [[ -z "${2}" ]] && _manifest_usage - log "DEBUG" "MANIFEST > Reading toolbox checksum for '${2}' from manifest." - _manifest_toolbox_sha "${2}" - ;; - *) - _manifest_usage - ;; - esac -} - -_manifest_usage() { - log "ERROR" "manifest.sh -- interact with the CICD-Tools manifest file." - log "ERROR" "USAGE: manifest.sh -p [PATH TO MANIFEST] [COMMAND]" - log "ERROR" " COMMANDS:" - log "ERROR" " toolbox_url [VERSION] - Retrieves the URL of the given toolbox version." - log "ERROR" " toolbox_sha [FILENAME] - Retrieves the checksum of the given file." - log "ERROR" " security - Indicates if hash validation is enabled or disabled." - exit 127 -} - -_manifest_security() { - jq -rM ".disable_security" "${MANIFEST_FILE}" -} - -_manifest_toolbox_prefix() { - local REMOTE_SHA - local REMOTE_SOURCE - local REMOTE_PATH - REMOTE_SHA="$(jq -erM '.version' "${MANIFEST_FILE}")" - REMOTE_SOURCE="$(jq -erM '.source' "${MANIFEST_FILE}")" - REMOTE_PATH="$(jq -erM '.toolbox_path' "${MANIFEST_FILE}")" - echo "${REMOTE_SOURCE}/${REMOTE_SHA}/${REMOTE_PATH}" -} - -_manifest_toolbox_is_present() { - jq --arg version "${1}.tar.gz" -erM '.manifest[$version]' "${MANIFEST_FILE}" -} - -_manifest_toolbox_url() { - if ! _manifest_toolbox_is_present "${1}" > /dev/null; then - log "ERROR" "MANIFEST > Toolbox version '${1}' is not in the manifest." - exit 127 - fi - echo "$(_manifest_toolbox_prefix)/${1}.tar.gz" -} - -_manifest_toolbox_sha() { - if ! _manifest_toolbox_is_present "${1}" > /dev/null; then - log "ERROR" "MANIFEST > Toolbox version '${1}' is not in the manifest." - exit 127 - fi - jq --arg version "${1}.tar.gz" -erM '.manifest[$version]' "${MANIFEST_FILE}" -} - -manifest "$@" diff --git a/.cicd-tools/bin/toolbox.sh b/.cicd-tools/bin/toolbox.sh deleted file mode 100755 index ae7c6fe..0000000 --- a/.cicd-tools/bin/toolbox.sh +++ /dev/null @@ -1,167 +0,0 @@ -#!/bin/bash - -# Remote toolbox downloader. -# Requires gpg binary: https://gnupg.org/ - -# CICD-Tools script. - -set -eo pipefail - -TOOLBOX_PATH="$(pwd)/.cicd-tools" -TOOLBOX_REMOTES_FOLDER="boxes" -TOOLBOX_MANIFEST_FILE="${TOOLBOX_PATH}/manifest.json" - -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/environment.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../boxes/bootstrap/libraries/environment.sh" - -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/logging.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../boxes/bootstrap/libraries/logging.sh" - -main() { - local MANIFEST_ASC - local MANIFEST_DISABLE_SECURITY="false" - local TARGET_TOOLBOX_VERSION - local TARGET_TOOLBOX_URL - local TEMP_DIRECTORY - - TEMP_DIRECTORY="$(mktemp -d)" - - environment \ - -o "DOWNLOAD_RETRIES DOWNLOAD_MAX_TIME" \ - -d "3 30" - - _toolbox_args "$@" - _toolbox_manifest_download - _toolbox_manifest_load - _toolbox_box_download - _toolbox_box_checksum - _toolbox_box_install -} - -_toolbox_args() { - local OPTARG - local OPTIND=1 - local OPTION - - while getopts "b:m:r:t:" OPTION; do - case "$OPTION" in - b) - TARGET_TOOLBOX_VERSION="${OPTARG}" - TARGET_TOOLBOX_FILENAME="${TARGET_TOOLBOX_VERSION}.tar.gz" - ;; - m) - MANIFEST_ASC="${OPTARG}" - ;; - r) - DOWNLOAD_RETRIES="${OPTARG}" - ;; - t) - DOWNLOAD_MAX_TIME="${OPTARG}" - ;; - \?) - _toolbox_usage - ;; - :) - _toolbox_usage - ;; - *) - _toolbox_usage - ;; - esac - done - shift $((OPTIND - 1)) - - if [[ -z "${TARGET_TOOLBOX_VERSION}" ]] || - [[ -z "${MANIFEST_ASC}" ]]; then - _toolbox_usage - fi -} - -_toolbox_box_checksum() { - pushd "${TEMP_DIRECTORY}" >> /dev/null - if [[ "${MANIFEST_DISABLE_SECURITY}" == "false" ]]; then - if ! echo "${TARGET_TOOLBOX_SHA} ${TARGET_TOOLBOX_FILENAME}" | sha256sum -c; then - log "ERROR" "CHECKSUM > Hash of remote file does not match!" - log "ERROR" "CHECKSUM > Cannot proceed." - exit 127 - else - log "INFO" "CHECKSUM > Hash verification has passed." - fi - else - log "WARNING" "CHECKSUM > The manifest has DISABLED all checksum validation." - fi - cp "${TARGET_TOOLBOX_FILENAME}" "${TOOLBOX_PATH}/${TOOLBOX_REMOTES_FOLDER}" - popd >> /dev/null -} - -_toolbox_box_download() { - if [[ -f "${TOOLBOX_PATH}/${TOOLBOX_REMOTES_FOLDER}/${TARGET_TOOLBOX_FILENAME}" ]]; then - mv "${TOOLBOX_PATH}/${TOOLBOX_REMOTES_FOLDER}/${TARGET_TOOLBOX_FILENAME}" "${TEMP_DIRECTORY}" - log "INFO" "BOX > Toolbox Version ${TARGET_TOOLBOX_VERSION} has already been downloaded." - else - _toolbox_box_fetch - fi -} - -_toolbox_box_fetch() { - log "DEBUG" "BOX > Target Toolbox Version: ${TARGET_TOOLBOX_VERSION}" - log "DEBUG" "BOX > Target Toolbox SHA: ${TARGET_TOOLBOX_SHA}" - log "DEBUG" "BOX > Target Toolbox URL: ${TARGET_TOOLBOX_URL}" - - mkdir -p "${TOOLBOX_PATH}/${TOOLBOX_REMOTES_FOLDER}" - - pushd "${TEMP_DIRECTORY}" >> /dev/null - _toolbox_fetch "${TARGET_TOOLBOX_URL}" > "${TARGET_TOOLBOX_FILENAME}" - popd >> /dev/null - - log "INFO" "BOX > Remote toolbox retrieved." -} - -_toolbox_box_install() { - pushd "${TOOLBOX_PATH}/${TOOLBOX_REMOTES_FOLDER}" >> /dev/null - tar xvzf "${TARGET_TOOLBOX_FILENAME}" - log "DEBUG" "BOX > Toolbox Version ${TARGET_TOOLBOX_VERSION} has been installed to ${TOOLBOX_PATH}/${TOOLBOX_REMOTES_FOLDER}." - ln -sf "${TARGET_TOOLBOX_VERSION}" active - log "INFO" "BOX > Toolbox Version ${TARGET_TOOLBOX_VERSION} has been activated." - popd >> /dev/null -} - -_toolbox_fetch() { - # 1: url - log "DEBUG" "FETCH > URL: ${1}" - log "DEBUG" "FETCH > Retries: ${DOWNLOAD_RETRIES}" - log "DEBUG" "FETCH > Max Time: ${DOWNLOAD_MAX_TIME}" - - set -x - curl --fail \ - --location \ - --silent \ - --show-error \ - --retry "${DOWNLOAD_RETRIES}" \ - --retry-max-time "${DOWNLOAD_MAX_TIME}" \ - "${1}" - { set +x; } 2> /dev/null - - log "DEBUG" "FETCH > Fetch complete." -} - -_toolbox_manifest_download() { - gpg --yes --output "${TOOLBOX_MANIFEST_FILE}" --verify <(_toolbox_fetch "${MANIFEST_ASC}") - log "INFO" "MANIFEST > Remote manifest retrieved." -} - -_toolbox_manifest_load() { - TARGET_TOOLBOX_SHA="$(./.cicd-tools/bin/manifest.sh -m "${TOOLBOX_MANIFEST_FILE}" toolbox_sha "${TARGET_TOOLBOX_VERSION}")" - MANIFEST_DISABLE_SECURITY="$(./.cicd-tools/bin/manifest.sh -m "${TOOLBOX_MANIFEST_FILE}" security)" - TARGET_TOOLBOX_URL="$(./.cicd-tools/bin/manifest.sh -m "${TOOLBOX_MANIFEST_FILE}" toolbox_url "${TARGET_TOOLBOX_VERSION}")" - log "INFO" "MANIFEST > Remote manifest loaded." -} - -_toolbox_usage() { - log "ERROR" "toolbox.sh -- download a remote toolbox from the CICD-Tools manifest." - log "ERROR" "USAGE: toolbox.sh -b [TOOLBOX VERSION] -m [REMOTE MANIFEST URL]" - log "ERROR" " Optional: -r [OPTIONAL RETRY COUNT] -t [OPTIONAL MAX RETRY TIME]" - exit 127 -} - -main "$@" diff --git a/.cicd-tools/bin/verify.sh b/.cicd-tools/bin/verify.sh deleted file mode 100755 index 8ce00a3..0000000 --- a/.cicd-tools/bin/verify.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -# Remote gpg key verification. -# Requires gpg binary: https://gnupg.org/ - -# CICD-Tools script. - -set -eo pipefail - -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/logging.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../boxes/bootstrap/libraries/logging.sh" - -main() { - local CICD_TOOLS_GPG_KEY - - _verify_args "$@" - _verify_check_key - _verify_trust_key -} - -_verify_args() { - local OPTARG - local OPTIND - local OPTION - - while getopts "k:" OPTION; do - case "$OPTION" in - k) - CICD_TOOLS_GPG_KEY="${OPTARG}" - ;; - \?) - _toolbox_usage - ;; - :) - _toolbox_usage - ;; - *) - _toolbox_usage - ;; - esac - done - shift $((OPTIND - 1)) - - if [[ -z "${CICD_TOOLS_GPG_KEY}" ]]; then - _verify_usage - fi -} - -_verify_check_key() { - gpg \ - --verify "$(dirname -- "${BASH_SOURCE[0]}")/../pgp/verification.sign" \ - "$(dirname -- "${BASH_SOURCE[0]}")/../pgp/verification.txt" -} - -_verify_trust_key() { - echo "${CICD_TOOLS_GPG_KEY}:6:" | gpg --import-ownertrust -} - -_verify_usage() { - log "ERROR" "verify.sh -- verify the CICD-Tools gpg key." - log "ERROR" "USAGE: verify.sh -k [GPG KEY ID]" - exit 127 -} - -main "$@" diff --git a/.cicd-tools/configuration/pre-commit-bootstrap.yaml b/.cicd-tools/configuration/pre-commit-bootstrap.yaml new file mode 100644 index 0000000..8ff0bec --- /dev/null +++ b/.cicd-tools/configuration/pre-commit-bootstrap.yaml @@ -0,0 +1,11 @@ +--- +default_install_hook_types: [] +repos: + - repo: https://github.com/cicd-tools-org/pre-commit.git + rev: a8e03131d971f19df29f5555e6853c60855e4ae5 + hooks: + - id: cicd-tools-box + entry: ./src/pre-commit/cicd-tools-box.sh -c system -j system -g system + - id: cicd-tools-key + entry: ./src/pre-commit/cicd-tools-key.sh -g system + - id: commitizen-pre-bump diff --git a/.cicd-tools/pgp/verification.sign b/.cicd-tools/pgp/verification.sign deleted file mode 100644 index 44bc538..0000000 --- a/.cicd-tools/pgp/verification.sign +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iHUEABYKAB0WIQTwenlkfpHlYaeGttDZAg9/7iDb8gUCZCkYCQAKCRDZAg9/7iDb -8nvIAQDTZImTu5eKtipUhlDA5TYXroyOhX0CZnwbEsS9ySNsmgEAqcXQZBeXW2FZ -VyKPtGiGe4bUvD+BJJPa6yjw35gS5wY= -=w1bO ------END PGP SIGNATURE----- diff --git a/.cicd-tools/pgp/verification.txt b/.cicd-tools/pgp/verification.txt deleted file mode 100644 index 844c10f..0000000 --- a/.cicd-tools/pgp/verification.txt +++ /dev/null @@ -1 +0,0 @@ -CICD-Tools Verified diff --git a/.github/actions/action-00-toolbox/action.yml b/.github/actions/action-00-toolbox/action.yml index b2bcc9e..0c8b2f7 100644 --- a/.github/actions/action-00-toolbox/action.yml +++ b/.github/actions/action-00-toolbox/action.yml @@ -1,6 +1,6 @@ --- name: action-00-toolbox -description: "Fetches the CICD-Tools toolbox." +description: "Fetches the specified remote toolbox." author: niall@niallbyrne.ca inputs: @@ -12,7 +12,70 @@ inputs: runs: using: "composite" steps: - - name: Toolbox - Install CICD-Tools Toolbox - uses: cicd-tools-org/cicd-tools/.github/actions/action-00-toolbox@main + - name: Toolbox -- Install Required Software (Mac OSX Only) + if: runner.os == 'macOS' + run: | + HOMEBREW_NO_AUTO_UPDATE=1 brew install coreutils + shell: bash + + - name: Toolbox -- Save Environment + run: | + cp "${GITHUB_ENV}" /tmp/pre-toolbox-env + shell: bash + + - name: Toolbox -- Identify Toolbox Cache Targets + run: | + TOOLBOX_CACHE_PIP_TARGET="$(python -m site --user-site)" + TOOLBOX_CACHE_BIN_TARGET="$(dirname $(dirname -- $(dirname -- "${TOOLBOX_CACHE_PIP_TARGET}")))/bin" + TOOLBOX_CACHE_PRECOMMIT_TARGET="${HOME}/.toolbox/pre-commit" + TOOLBOX_CACHE_TTL="$(date +%d)" + echo "PRE_COMMIT_HOME=${TOOLBOX_CACHE_PRECOMMIT_TARGET}" >> "${GITHUB_ENV}" + echo "TOOLBOX_CACHE_BIN_TARGET=${TOOLBOX_CACHE_BIN_TARGET}" >> "${GITHUB_ENV}" + echo "TOOLBOX_CACHE_PIP_TARGET=${TOOLBOX_CACHE_PIP_TARGET}" >> "${GITHUB_ENV}" + echo "TOOLBOX_CACHE_PRECOMMIT_TARGET=${TOOLBOX_CACHE_PRECOMMIT_TARGET}" >> "${GITHUB_ENV}" + echo "TOOLBOX_CACHE_TTL=${TOOLBOX_CACHE_TTL}" >> "${GITHUB_ENV}" + shell: bash + + - name: Toolbox -- Initialize Toolbox Cache + run: | + mkdir -p "${{ env.TOOLBOX_CACHE_BIN_TARGET }}" + mkdir -p "${{ env.TOOLBOX_CACHE_PIP_TARGET }}" + mkdir -p "${{ env.TOOLBOX_CACHE_PRECOMMIT_TARGET }}" + shell: bash + + - name: Toolbox -- Mount Toolbox Cache + uses: actions/cache@v4 + id: toolbox-install-cache with: - PROJECT_ROOT_PATH: ${{ inputs.PROJECT_ROOT_PATH }} + path: | + ${{ env.TOOLBOX_CACHE_BIN_TARGET }} + ${{ env.TOOLBOX_CACHE_PIP_TARGET }} + ${{ env.TOOLBOX_CACHE_PRECOMMIT_TARGET }} + key: $${{ hashFiles('.github/actions/action-00-toolbox') }}-toolbox-install-${{ env.TOOLBOX_CACHE_TTL }}-${{ runner.os }} + + - name: Toolbox -- Use Sandboxed Toolbox Pre-Commit Cache + run: | + echo "PRE_COMMIT_HOME=${TOOLBOX_CACHE_PRECOMMIT_TARGET}" >> "${GITHUB_ENV}" + shell: bash + + - name: Toolbox -- Install Pre-Commit + if: steps.toolbox-install-cache.outputs.cache-hit != 'true' + run: | + pip install -v pre-commit + shell: bash + + - name: Toolbox -- Import GPG Key + run: | + pre-commit run --hook-stage=manual cicd-tools-key --verbose -c .cicd-tools/configuration/pre-commit-bootstrap.yaml + shell: bash + + - name: Toolbox -- Install the Project's Toolbox + run: | + pre-commit run --hook-stage=manual cicd-tools-box --verbose -c .cicd-tools/configuration/pre-commit-bootstrap.yaml + shell: bash + + - name: Toolbox -- Restore Environment + run: | + mv /tmp/pre-toolbox-env "${GITHUB_ENV}" + cat "${GITHUB_ENV}" + shell: bash diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 011b545..9b8f763 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,9 +27,10 @@ repos: - "./.yamllint.yml" stages: [commit] - repo: https://github.com/cicd-tools-org/pre-commit.git - rev: d1beab76aee01c287e4b7fc98d220e68e7e64c67 + rev: a8e03131d971f19df29f5555e6853c60855e4ae5 hooks: - - id: commitizen-pre-bump + - id: cicd-tools-box + - id: cicd-tools-key - id: format-shell exclude: "^\\.cicd-tools/boxes/disabled$" - id: format-toml diff --git a/Makefile b/Makefile index 9dd1e73..4d57a3f 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,8 @@ clean-git: dogfood: @echo "Creating dogfood commit ..." - @sed -i.bak "s,rev: .\{40\},rev: $(shell git rev-parse HEAD),g" .pre-commit-config.yaml; rm .pre-commit-config.yaml.bak - @git stage .pre-commit-config.yaml + @sed -i.bak "s,rev: .\{40\},rev: $(shell git rev-parse HEAD),g" .pre-commit-config.yaml .cicd-tools/configuration/pre-commit-bootstrap.yaml; rm .pre-commit-config.yaml.bak .cicd-tools/configuration/pre-commit-bootstrap.yaml.bak + @git stage .pre-commit-config.yaml .cicd-tools/configuration/pre-commit-bootstrap.yaml @git commit -m "ci(PRE-COMMIT): move dog food hash" --no-verify format-toml: diff --git a/pyproject.toml b/pyproject.toml index 9f14713..a940c9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ requires = ['poetry-core'] [tool] [tool.commitizen] bump_message = 'bump(RELEASE): $current_version → $new_version' -pre_bump_hooks = ['poetry run pre-commit run --hook-stage=manual commitizen-pre-bump --files pyproject.toml || true'] +pre_bump_hooks = ['poetry run pre-commit run --hook-stage=manual commitizen-pre-bump --files pyproject.toml -c .cicd-tools/configuration/pre-commit-bootstrap.yaml || true'] version = '0.5.0' version_files = ['pyproject.toml:version'] version_provider = 'poetry' diff --git a/.cicd-tools/boxes/bootstrap/libraries/colours.sh b/src/cicd-tools/libraries/colours.sh similarity index 100% rename from .cicd-tools/boxes/bootstrap/libraries/colours.sh rename to src/cicd-tools/libraries/colours.sh diff --git a/.cicd-tools/boxes/bootstrap/libraries/container.sh b/src/cicd-tools/libraries/container.sh similarity index 100% rename from .cicd-tools/boxes/bootstrap/libraries/container.sh rename to src/cicd-tools/libraries/container.sh diff --git a/.cicd-tools/boxes/bootstrap/libraries/environment.sh b/src/cicd-tools/libraries/environment.sh similarity index 98% rename from .cicd-tools/boxes/bootstrap/libraries/environment.sh rename to src/cicd-tools/libraries/environment.sh index 2ff94e1..a1627b6 100644 --- a/.cicd-tools/boxes/bootstrap/libraries/environment.sh +++ b/src/cicd-tools/libraries/environment.sh @@ -4,7 +4,7 @@ set -eo pipefail -# shellcheck source=/dev/null +# shellcheck source=./logging.sh source "$(dirname -- "${BASH_SOURCE[0]}")/logging.sh" environment() { diff --git a/.cicd-tools/boxes/bootstrap/libraries/logging.sh b/src/cicd-tools/libraries/logging.sh similarity index 98% rename from .cicd-tools/boxes/bootstrap/libraries/logging.sh rename to src/cicd-tools/libraries/logging.sh index 1264469..1cb7761 100644 --- a/.cicd-tools/boxes/bootstrap/libraries/logging.sh +++ b/src/cicd-tools/libraries/logging.sh @@ -5,7 +5,7 @@ set -eo pipefail -# shellcheck source=/dev/null +# shellcheck source=./colours.sh source "$(dirname -- "${BASH_SOURCE[0]}")/colours.sh" LOGGING_LEVEL=${LOGGING_LEVEL-"DEBUG"} diff --git a/.cicd-tools/boxes/bootstrap/libraries/tools.sh b/src/cicd-tools/libraries/tools.sh similarity index 97% rename from .cicd-tools/boxes/bootstrap/libraries/tools.sh rename to src/cicd-tools/libraries/tools.sh index 9b2065f..2744f19 100644 --- a/.cicd-tools/boxes/bootstrap/libraries/tools.sh +++ b/src/cicd-tools/libraries/tools.sh @@ -4,7 +4,7 @@ set -eo pipefail -# shellcheck source=/dev/null +# shellcheck source=./logging.sh source "$(dirname -- "${BASH_SOURCE[0]}")/logging.sh" cicd_tools() { diff --git a/.cicd-tools/boxes/bootstrap/schemas/cookiecutter.json b/src/cicd-tools/schemas/cookiecutter.json similarity index 100% rename from .cicd-tools/boxes/bootstrap/schemas/cookiecutter.json rename to src/cicd-tools/schemas/cookiecutter.json diff --git a/.cicd-tools/boxes/bootstrap/schemas/manifest.json b/src/cicd-tools/schemas/manifest.json similarity index 100% rename from .cicd-tools/boxes/bootstrap/schemas/manifest.json rename to src/cicd-tools/schemas/manifest.json diff --git a/src/pre-commit/cicd-tools-box.sh b/src/pre-commit/cicd-tools-box.sh index 4efcc95..bdb8356 100755 --- a/src/pre-commit/cicd-tools-box.sh +++ b/src/pre-commit/cicd-tools-box.sh @@ -12,11 +12,11 @@ TOOLBOX_ABSOLUTE_PATH="${PWD}/${TOOLBOX_PATH}" TOOLBOX_REMOTES_FOLDER="boxes" TOOLBOX_MANIFEST_FILE="${TOOLBOX_PATH}/manifest.json" -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/container.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../../.cicd-tools/boxes/bootstrap/libraries/container.sh" +# shellcheck source=./../cicd-tools/libraries/container.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/../cicd-tools/libraries/container.sh" -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/logging.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../../.cicd-tools/boxes/bootstrap/libraries/logging.sh" +# shellcheck source=./../cicd-tools/libraries/logging.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/../cicd-tools/libraries/logging.sh" main() { local TOOLBOX_DOCKER_IMAGE_CURL="system" diff --git a/src/pre-commit/cicd-tools-key.sh b/src/pre-commit/cicd-tools-key.sh index 4e61bfb..ebcbeed 100755 --- a/src/pre-commit/cicd-tools-key.sh +++ b/src/pre-commit/cicd-tools-key.sh @@ -7,11 +7,11 @@ set -eo pipefail -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/container.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../../.cicd-tools/boxes/bootstrap/libraries/container.sh" +# shellcheck source=./../cicd-tools/libraries/container.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/../cicd-tools/libraries/container.sh" -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/logging.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../../.cicd-tools/boxes/bootstrap/libraries/logging.sh" +# shellcheck source=./../cicd-tools/libraries/logging.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/../cicd-tools/libraries/logging.sh" main() { local TOOLBOX_GPG_DECRYPTED_FILE diff --git a/src/pre-commit/commitizen-pre-bump.sh b/src/pre-commit/commitizen-pre-bump.sh index 55166d0..b60e852 100755 --- a/src/pre-commit/commitizen-pre-bump.sh +++ b/src/pre-commit/commitizen-pre-bump.sh @@ -7,11 +7,11 @@ set -eo pipefail -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/environment.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../../.cicd-tools/boxes/bootstrap/libraries/environment.sh" +# shellcheck source=./../cicd-tools/libraries/environment.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/../cicd-tools/libraries/environment.sh" -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/logging.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../../.cicd-tools/boxes/bootstrap/libraries/logging.sh" +# shellcheck source=./../cicd-tools/libraries/logging.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/../cicd-tools/libraries/logging.sh" main() { environment -m "CZ_PRE_NEW_VERSION" diff --git a/src/pre-commit/gettext-translations.sh b/src/pre-commit/gettext-translations.sh index 9bb18e1..406c28d 100755 --- a/src/pre-commit/gettext-translations.sh +++ b/src/pre-commit/gettext-translations.sh @@ -7,14 +7,14 @@ set -eo pipefail -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/container.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../../.cicd-tools/boxes/bootstrap/libraries/container.sh" +# shellcheck source=./../cicd-tools/libraries/container.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/../cicd-tools/libraries/container.sh" -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/environment.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../../.cicd-tools/boxes/bootstrap/libraries/environment.sh" +# shellcheck source=./../cicd-tools/libraries/environment.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/../cicd-tools/libraries/environment.sh" -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/logging.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../../.cicd-tools/boxes/bootstrap/libraries/logging.sh" +# shellcheck source=./../cicd-tools/libraries/logging.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/../cicd-tools/libraries/logging.sh" GETTEXT_TRANSLATIONS_SED_PATTERN='s,^\"Content-Type: text/plain; charset=CHARSET\\n\"$,\"Content-Type: text/plain; charset=UTF-8\\n\",g' GETTEXT_TRANSLATIONS_EXAMPLE_LANGUAGES_CODES_URL="https://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html" diff --git a/src/pre-commit/lint-ansible.sh b/src/pre-commit/lint-ansible.sh index 5e83b08..21289fb 100755 --- a/src/pre-commit/lint-ansible.sh +++ b/src/pre-commit/lint-ansible.sh @@ -8,11 +8,11 @@ set -eo pipefail -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/logging.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../../.cicd-tools/boxes/bootstrap/libraries/logging.sh" +# shellcheck source=./../cicd-tools/libraries/logging.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/../cicd-tools/libraries/logging.sh" -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/tools.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../../.cicd-tools/boxes/bootstrap/libraries/tools.sh" +# shellcheck source=./../cicd-tools/libraries/tools.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/../cicd-tools/libraries/tools.sh" main() { local TARGET_FOLDERS=${*-"."} diff --git a/src/pre-commit/lint-github-workflow-header.sh b/src/pre-commit/lint-github-workflow-header.sh index 1d340f4..6a44167 100755 --- a/src/pre-commit/lint-github-workflow-header.sh +++ b/src/pre-commit/lint-github-workflow-header.sh @@ -8,8 +8,8 @@ set -eo pipefail -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/logging.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../../.cicd-tools/boxes/bootstrap/libraries/logging.sh" +# shellcheck source=./../cicd-tools/libraries/logging.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/../cicd-tools/libraries/logging.sh" main() { for WORKFLOW_FILE_PATH in "$@"; do diff --git a/src/pre-commit/spelling-commit-message.sh b/src/pre-commit/spelling-commit-message.sh index 5ed8811..d96a133 100755 --- a/src/pre-commit/spelling-commit-message.sh +++ b/src/pre-commit/spelling-commit-message.sh @@ -9,11 +9,11 @@ set -eo pipefail -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/logging.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../../.cicd-tools/boxes/bootstrap/libraries/logging.sh" +# shellcheck source=./../cicd-tools/libraries/logging.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/../cicd-tools/libraries/logging.sh" -# shellcheck source=./.cicd-tools/boxes/bootstrap/libraries/container.sh -source "$(dirname -- "${BASH_SOURCE[0]}")/../../.cicd-tools/boxes/bootstrap/libraries/container.sh" +# shellcheck source=./../cicd-tools/libraries/container.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/../cicd-tools/libraries/container.sh" main() { local PRECOMMIT_GIT_COMMIT_MESSAGE_FILE