Skip to content

Commit

Permalink
Maintenance bash-tools-framework 6.1.1
Browse files Browse the repository at this point in the history
- Update github worflows cron scheduling
- Update github worflows versions
- bash-compiler uses DEFAULT_TEMPLATE_FOLDER
- recompiled all binaries to use bash-tools-framework 6.1.1
- updated pre-commit versions
  • Loading branch information
fchastanet committed Dec 28, 2024
1 parent c626ddf commit 7937422
Show file tree
Hide file tree
Showing 26 changed files with 258 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .bash-compiler
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FRAMEWORK_ROOT_DIR=${ROOT_DIR}/vendor/bash-tools-framework
BASH_TOOLS_ROOT_DIR=${ROOT_DIR}
TEMPLATES_ROOT_DIR=${HOME}/fchastanet/bash-compiler/examples/templates
TEMPLATES_ROOT_DIR=${DEFAULT_TEMPLATE_FOLDER}
2 changes: 2 additions & 0 deletions .cspell/softwares.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ pcmanfm
phpmd
phpstorm
Phpstorm
pipx
pixbuf
plantuml
Plantuml
Expand Down Expand Up @@ -181,3 +182,4 @@ xsession
Xsrv
xvfb
Xvfb
yapf
4 changes: 3 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ updates:
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
interval: "monthly"
day: "friday"
time: "22:00"
timezone: "Europe/Paris"
open-pull-requests-limit: 1
2 changes: 1 addition & 1 deletion .github/workflows/docsify-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
./bin/doc --ci
- name: Setup Pages
uses: actions/configure-pages@v4
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
# needed by megalinter
pull-requests: write
steps:
- uses: akatov/commit-status-updater@a9e988ec5454692ff7745a509452422a35172ad6
- uses: ouzi-dev/commit-status-updater@v2
with:
name: build-bash-tools
status: pending
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- uses: akatov/commit-status-updater@a9e988ec5454692ff7745a509452422a35172ad6
- uses: ouzi-dev/commit-status-updater@v2
with:
name: pre-commit-megalinter
status: pending
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
env.COND_UPDATED_SOURCES == 'true' &&
env.COND_APPLY_FIXES_NEEDED == 'true' &&
!contains(github.event.head_commit.message, 'skip fix')
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.generate-token.outputs.token }}
committer: fchastanet <[email protected]>
Expand All @@ -191,7 +191,7 @@ jobs:
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- uses: akatov/commit-status-updater@a9e988ec5454692ff7745a509452422a35172ad6
- uses: ouzi-dev/commit-status-updater@v2
if: ${{ always() }}
with:
name: pre-commit-megalinter
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- uses: akatov/commit-status-updater@a9e988ec5454692ff7745a509452422a35172ad6
- uses: ouzi-dev/commit-status-updater@v2
with:
name: unit-tests-${{matrix.vendor}}-${{matrix.bashTarVersion}}
status: pending
Expand Down Expand Up @@ -315,7 +315,7 @@ jobs:
path: |
logs/**
- uses: akatov/commit-status-updater@a9e988ec5454692ff7745a509452422a35172ad6
- uses: ouzi-dev/commit-status-updater@v2
with:
name: unit-tests-${{matrix.vendor}}-${{matrix.bashTarVersion}}
status: ${{ job.status }}
Expand All @@ -334,7 +334,7 @@ jobs:
# You can get the conclusion via env (env.WORKFLOW_CONCLUSION)
- uses: AbsoLouie/[email protected]

- uses: akatov/commit-status-updater@a9e988ec5454692ff7745a509452422a35172ad6
- uses: ouzi-dev/commit-status-updater@v2
with:
name: build-bash-tools
# neutral, success, skipped, cancelled, timed_out, action_required, failure
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/precommit-autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: # yamllint disable-line rule:truthy
workflow_dispatch:
schedule:
# https://crontab.cronhub.io/
- cron: "30 10 * * *"
- cron: "30 22 1-7 */3 FRI"
jobs:
auto-update:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.generate-token.outputs.token }}
committer: fchastanet <[email protected]>
Expand Down
16 changes: 13 additions & 3 deletions .pre-commit-config-github.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ default_stages: [pre-commit, manual]
minimum_pre_commit_version: 3.5.0
fail_fast: false
repos:
# enables pre-commit to install the hooks using pipx
- repo: https://github.com/pypa/pipx
rev: 1.7.1
hooks:
- id: pipx
alias: yapf
name: yapf
args: ["yapf", "-i"]
types: ["python"]

- repo: local
# this hook is not intended to be run on github
# it just allows to generate the same pre-commit
Expand All @@ -25,7 +35,7 @@ repos:

- repo: https://github.com/executablebooks/mdformat
# Do this before other tools "fixing" the line endings
rev: 0.7.19
rev: 0.7.21
hooks:
- id: mdformat
name: Format Markdown
Expand Down Expand Up @@ -161,7 +171,7 @@ repos:
exclude: /testsData/

- repo: https://github.com/fchastanet/bash-tools-framework
rev: 6.0.0
rev: 6.1.1
hooks:
- id: fixShebangExecutionBit
- id: awkLint
Expand Down Expand Up @@ -210,6 +220,6 @@ repos:
stages: [manual] # GITHUB

- repo: https://github.com/fchastanet/bash-compiler
rev: v3.0.0
rev: 3.1.2
hooks:
- id: buildBashBinaries
16 changes: 13 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ default_stages: [pre-commit, manual]
minimum_pre_commit_version: 3.5.0
fail_fast: true
repos:
# enables pre-commit to install the hooks using pipx
- repo: https://github.com/pypa/pipx
rev: 1.7.1
hooks:
- id: pipx
alias: yapf
name: yapf
args: ["yapf", "-i"]
types: ["python"]

- repo: local
# this hook is not intended to be run on github
# it just allows to generate the same pre-commit
Expand All @@ -20,7 +30,7 @@ repos:

- repo: https://github.com/executablebooks/mdformat
# Do this before other tools "fixing" the line endings
rev: 0.7.19
rev: 0.7.21
hooks:
- id: mdformat
name: Format Markdown
Expand Down Expand Up @@ -156,7 +166,7 @@ repos:
exclude: /testsData/

- repo: https://github.com/fchastanet/bash-tools-framework
rev: 6.0.0
rev: 6.1.1
hooks:
- id: fixShebangExecutionBit
- id: awkLint
Expand Down Expand Up @@ -205,6 +215,6 @@ repos:
stages: [] # GITHUB

- repo: https://github.com/fchastanet/bash-compiler
rev: v3.0.0
rev: 3.1.2
hooks:
- id: buildBashBinaries
13 changes: 12 additions & 1 deletion bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ Log::computeDuration() {
if ((${DISPLAY_DURATION:-0} == 1)); then
local -i duration=0
local -i delta=0
local durationStr deltaStr
local -i currentLogDate
currentLogDate="${EPOCHREALTIME/[^0-9]/}"
if ((LOG_LAST_LOG_DATE_INIT == 1)); then
Expand All @@ -809,7 +810,17 @@ Log::computeDuration() {
else
duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000))
delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000))
LOG_LAST_DURATION_STR="${duration}s/+${delta}s"
if ((duration > 59)); then
durationStr=$(date -ud "@${duration}" +'%H:%M:%S')
else
durationStr="${duration}s"
fi
if ((delta > 59)); then
deltaStr=$(date -ud "@${delta}" +'%H:%M:%S')
else
deltaStr="${delta}s"
fi
LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}"
fi
LOG_LAST_LOG_DATE="${currentLogDate}"
# shellcheck disable=SC2034
Expand Down
13 changes: 12 additions & 1 deletion bin/dbImport
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,7 @@ Log::computeDuration() {
if ((${DISPLAY_DURATION:-0} == 1)); then
local -i duration=0
local -i delta=0
local durationStr deltaStr
local -i currentLogDate
currentLogDate="${EPOCHREALTIME/[^0-9]/}"
if ((LOG_LAST_LOG_DATE_INIT == 1)); then
Expand All @@ -1039,7 +1040,17 @@ Log::computeDuration() {
else
duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000))
delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000))
LOG_LAST_DURATION_STR="${duration}s/+${delta}s"
if ((duration > 59)); then
durationStr=$(date -ud "@${duration}" +'%H:%M:%S')
else
durationStr="${duration}s"
fi
if ((delta > 59)); then
deltaStr=$(date -ud "@${delta}" +'%H:%M:%S')
else
deltaStr="${delta}s"
fi
LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}"
fi
LOG_LAST_LOG_DATE="${currentLogDate}"
# shellcheck disable=SC2034
Expand Down
13 changes: 12 additions & 1 deletion bin/dbImportProfile
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,7 @@ Log::computeDuration() {
if ((${DISPLAY_DURATION:-0} == 1)); then
local -i duration=0
local -i delta=0
local durationStr deltaStr
local -i currentLogDate
currentLogDate="${EPOCHREALTIME/[^0-9]/}"
if ((LOG_LAST_LOG_DATE_INIT == 1)); then
Expand All @@ -918,7 +919,17 @@ Log::computeDuration() {
else
duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000))
delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000))
LOG_LAST_DURATION_STR="${duration}s/+${delta}s"
if ((duration > 59)); then
durationStr=$(date -ud "@${duration}" +'%H:%M:%S')
else
durationStr="${duration}s"
fi
if ((delta > 59)); then
deltaStr=$(date -ud "@${delta}" +'%H:%M:%S')
else
deltaStr="${delta}s"
fi
LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}"
fi
LOG_LAST_LOG_DATE="${currentLogDate}"
# shellcheck disable=SC2034
Expand Down
13 changes: 12 additions & 1 deletion bin/dbImportStream
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,7 @@ Log::computeDuration() {
if ((${DISPLAY_DURATION:-0} == 1)); then
local -i duration=0
local -i delta=0
local durationStr deltaStr
local -i currentLogDate
currentLogDate="${EPOCHREALTIME/[^0-9]/}"
if ((LOG_LAST_LOG_DATE_INIT == 1)); then
Expand All @@ -946,7 +947,17 @@ Log::computeDuration() {
else
duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000))
delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000))
LOG_LAST_DURATION_STR="${duration}s/+${delta}s"
if ((duration > 59)); then
durationStr=$(date -ud "@${duration}" +'%H:%M:%S')
else
durationStr="${duration}s"
fi
if ((delta > 59)); then
deltaStr=$(date -ud "@${delta}" +'%H:%M:%S')
else
deltaStr="${delta}s"
fi
LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}"
fi
LOG_LAST_LOG_DATE="${currentLogDate}"
# shellcheck disable=SC2034
Expand Down
13 changes: 12 additions & 1 deletion bin/dbQueryAllDatabases
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,7 @@ Log::computeDuration() {
if ((${DISPLAY_DURATION:-0} == 1)); then
local -i duration=0
local -i delta=0
local durationStr deltaStr
local -i currentLogDate
currentLogDate="${EPOCHREALTIME/[^0-9]/}"
if ((LOG_LAST_LOG_DATE_INIT == 1)); then
Expand All @@ -996,7 +997,17 @@ Log::computeDuration() {
else
duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000))
delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000))
LOG_LAST_DURATION_STR="${duration}s/+${delta}s"
if ((duration > 59)); then
durationStr=$(date -ud "@${duration}" +'%H:%M:%S')
else
durationStr="${duration}s"
fi
if ((delta > 59)); then
deltaStr=$(date -ud "@${delta}" +'%H:%M:%S')
else
deltaStr="${delta}s"
fi
LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}"
fi
LOG_LAST_LOG_DATE="${currentLogDate}"
# shellcheck disable=SC2034
Expand Down
13 changes: 12 additions & 1 deletion bin/dbScriptAllDatabases
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,7 @@ Log::computeDuration() {
if ((${DISPLAY_DURATION:-0} == 1)); then
local -i duration=0
local -i delta=0
local durationStr deltaStr
local -i currentLogDate
currentLogDate="${EPOCHREALTIME/[^0-9]/}"
if ((LOG_LAST_LOG_DATE_INIT == 1)); then
Expand All @@ -898,7 +899,17 @@ Log::computeDuration() {
else
duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000))
delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000))
LOG_LAST_DURATION_STR="${duration}s/+${delta}s"
if ((duration > 59)); then
durationStr=$(date -ud "@${duration}" +'%H:%M:%S')
else
durationStr="${duration}s"
fi
if ((delta > 59)); then
deltaStr=$(date -ud "@${delta}" +'%H:%M:%S')
else
deltaStr="${delta}s"
fi
LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}"
fi
LOG_LAST_LOG_DATE="${currentLogDate}"
# shellcheck disable=SC2034
Expand Down
13 changes: 12 additions & 1 deletion bin/doc
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ Log::computeDuration() {
if ((${DISPLAY_DURATION:-0} == 1)); then
local -i duration=0
local -i delta=0
local durationStr deltaStr
local -i currentLogDate
currentLogDate="${EPOCHREALTIME/[^0-9]/}"
if ((LOG_LAST_LOG_DATE_INIT == 1)); then
Expand All @@ -736,7 +737,17 @@ Log::computeDuration() {
else
duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000))
delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000))
LOG_LAST_DURATION_STR="${duration}s/+${delta}s"
if ((duration > 59)); then
durationStr=$(date -ud "@${duration}" +'%H:%M:%S')
else
durationStr="${duration}s"
fi
if ((delta > 59)); then
deltaStr=$(date -ud "@${delta}" +'%H:%M:%S')
else
deltaStr="${delta}s"
fi
LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}"
fi
LOG_LAST_LOG_DATE="${currentLogDate}"
# shellcheck disable=SC2034
Expand Down
Loading

0 comments on commit 7937422

Please sign in to comment.