Skip to content

Commit

Permalink
migrated to bash-tools-framework 1.1.8 - get rid of build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
fchastanet committed Nov 27, 2023
1 parent 912e8da commit a828135
Show file tree
Hide file tree
Showing 39 changed files with 1,186 additions and 4,609 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
".jscpd.json",
".mega-linter.yml",
".shellcheckrc",
"**/*.svg",
".env",
"**/*.help.txt"
],
Expand Down
23 changes: 18 additions & 5 deletions .framework-config
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
#!/usr/bin/env bash
# shellcheck disable=SC2034

BASH_TOOLS_ROOT_DIR="${BASH_TOOLS_ROOT_DIR:-$(pwd)}"
REAL_SCRIPT_FILE="${REAL_SCRIPT_FILE:-$(readlink -e "$(realpath "${BASH_SOURCE[0]}")")}"
FRAMEWORK_ROOT_DIR="${FRAMEWORK_ROOT_DIR:-$(cd "$(readlink -e "${REAL_SCRIPT_FILE%/*}")" && pwd -P)}"
BASH_TOOLS_ROOT_DIR="${BASH_TOOLS_ROOT_DIR:-$(cd "$(readlink -e "${BASH_SOURCE[0]%/*}")" && pwd -P)}"
FRAMEWORK_ROOT_DIR="${FRAMEWORK_ROOT_DIR:-${BASH_TOOLS_ROOT_DIR}/vendor/bash-tools-framework}"
FRAMEWORK_SRC_DIR="${FRAMEWORK_SRC_DIR:-${FRAMEWORK_ROOT_DIR}/src}"
FRAMEWORK_BIN_DIR="${FRAMEWORK_BIN_DIR:-${FRAMEWORK_ROOT_DIR}/bin}"
FRAMEWORK_VENDOR_DIR="${FRAMEWORK_VENDOR_DIR:-${FRAMEWORK_ROOT_DIR}/vendor}"
FRAMEWORK_VENDOR_BIN_DIR="${FRAMEWORK_VENDOR_BIN_DIR:-${FRAMEWORK_ROOT_DIR}/vendor/bin}"

# compile parameters
# srcFile : file that needs to be compiled
# templateDir : directory from which bash-tpl templates will be searched
# binDir : fallback bin directory in case BIN_FILE has not been provided
# rootDir : directory used to compute src file relative path
# srcDirs : additional directories where to find the functions
COMPILE_PARAMETERS=(
--src-dir "${BASH_TOOLS_ROOT_DIR}/src"
--src-dir "${FRAMEWORK_SRC_DIR}"
--bin-dir "${BASH_TOOLS_ROOT_DIR}/bin"
--root-dir "${BASH_TOOLS_ROOT_DIR}"
--template-dir "${BASH_TOOLS_ROOT_DIR}/src"
)

# describe the functions that will be skipped from being imported
FRAMEWORK_FUNCTIONS_IGNORE_REGEXP="${FRAMEWORK_FUNCTIONS_IGNORE_REGEXP:-^(Namespace::functions|Functions::myFunction|Namespace::requireSomething|IMPORT::dir::file|Acquire::ForceIPv4)$}"
# describe the files that do not contain function to be imported
NON_FRAMEWORK_FILES_REGEXP="${NON_FRAMEWORK_FILES_REGEXP:-(^bin/|.framework-config|^install$|.bats$|/testsData/|^manualTests/|/_.sh$|/ZZZ.sh$|/__all.sh$|^src/_binaries|^src/_includes|^src/batsHeaders.sh$|^conf/)}"
# describe the files that are allowed to not have an associated bats file
BATS_FILE_NOT_NEEDED_REGEXP="${BATS_FILE_NOT_NEEDED_REGEXP:-(^build.sh$|^conf/|^bin/|.framework-config|^install$|.bats$|/testsData/|^manualTests/|/_.sh$|/ZZZ.sh$|/__all.sh$|^src/batsHeaders.sh$|^src/_includes)}"
BATS_FILE_NOT_NEEDED_REGEXP="${BATS_FILE_NOT_NEEDED_REGEXP:-(^conf/|^bin/|.framework-config|^install$|.bats$|/testsData/|^manualTests/|/_.sh$|/ZZZ.sh$|/__all.sh$|^src/batsHeaders.sh$|^src/_includes)}"
# describe the files that are allowed to not have a function matching the filename
FRAMEWORK_FILES_FUNCTION_MATCHING_IGNORE_REGEXP="${FRAMEWORK_FILES_FUNCTION_MATCHING_IGNORE_REGEXP:-^conf/|^bin/|^\.framework-config$|^build.sh$|\.tpl$|testsData/binaryFile$}"
FRAMEWORK_FILES_FUNCTION_MATCHING_IGNORE_REGEXP="${FRAMEWORK_FILES_FUNCTION_MATCHING_IGNORE_REGEXP:-^conf/|^bin/|^\.framework-config$|\.tpl$|testsData/binaryFile$}"
# Source directories
if [[ ! -v FRAMEWORK_SRC_DIRS ]]; then
FRAMEWORK_SRC_DIRS=(
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,6 @@ jobs:
name: build bash-tools-${{matrix.vendor}}-${{matrix.bashTarVersion}}
status: pending

- name: Pull/Build/Push docker image
env:
BRANCH: ${GITHUB_REF##*/}
run: |
vendor/bash-tools-framework/bin/buildPushDockerImage \
--vendor "${{ matrix.vendor }}" \
--bash-version "${{ matrix.bashTarVersion }}" \
--bash-base-image "${{ matrix.bashImage }}" \
--branch-name "${GITHUB_REF##*/}" \
--push -vvv
- name: Check image
run: |
docker run --rm \
Expand Down
26 changes: 12 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ repos:
hooks:
- id: mixed-line-ending
- id: end-of-file-fixer
exclude: |
(?x)(
.svg$
)
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-xml
Expand Down Expand Up @@ -57,7 +61,7 @@ repos:
- id: prettier

- repo: https://github.com/fchastanet/bash-tools-framework
rev: 1.1.5
rev: 1.1.8
hooks:
- id: fixShebangExecutionBit
- id: fixShebangExecutionBitGithubActions
Expand Down Expand Up @@ -87,6 +91,12 @@ repos:
- id: plantuml
- id: buildShFiles
- id: buildShFilesGithubAction
- id: runUnitTests
# not manual as github will run UT with several versions of bash and arch
stages: [pre-commit]
- id: megalinterCheckVersion
- id: megalinter
- id: megalinterGithubAction

- repo: local
hooks:
Expand All @@ -95,7 +105,7 @@ repos:
name: build doc files
language: script
entry: bin/doc
args: [--verbose, --skip-docker-build]
args: [-vvv]
pass_filenames: false
require_serial: true
always_run: true
Expand All @@ -104,17 +114,5 @@ repos:
- <<: *BUILD_DOC_FILES
id: buildDocFilesGithubAction
name: build doc files for Github Actions
args: [--verbose]
fail_fast: false
stages: [manual]

# manual stage used to select github action with megalinter full config
- repo: https://github.com/fchastanet/bash-tools-framework
rev: 1.1.5
hooks:
- id: runUnitTests
# not manual as github will run UT with several versions of bash and arch
stages: [pre-commit]
- id: megalinterCheckVersion
- id: megalinter
- id: megalinterGithubAction
9 changes: 0 additions & 9 deletions Commands.tmpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
- [1.4. bin/doc](#14-bindoc)
- [1.5. bin/findShebangFiles](#15-binfindshebangfiles)
- [1.6. bin/test](#16-bintest)
- [1.7. bin/runBuildContainer](#17-binrunbuildcontainer)
- [2. Converter and Generator tools](#2-converter-and-generator-tools)
- [2.1. bin/generateShellDoc](#21-bingenerateshelldoc)
- [2.2. bin/mysql2puml](#22-binmysql2puml)
Expand Down Expand Up @@ -78,14 +77,6 @@ imported from bash-tools-framework
@@@test_help@@@
```

### 1.7. bin/runBuildContainer

imported from bash-tools-framework

```text
@@@runBuildContainer_help@@@
```

## 2. Converter and Generator tools

### 2.1. bin/generateShellDoc
Expand Down
Loading

0 comments on commit a828135

Please sign in to comment.