refactor(bash): unify all installers on a shared boilerplate and Verb-Noun style#86
Merged
Merged
Conversation
…-Noun style All bash scripts now share one byte-identical boilerplate block (logging, root check, package-manager detection, command runner) with PowerShell-style Verb-Noun function names, verified by .github/scripts/check-boilerplate.sh. Consistency: - Standardize on '#!/usr/bin/env bash' and 'set -euo pipefail' everywhere (terraform previously ran without pipefail, masking pipe failures) - Replace the three divergent logging implementations with Write-Log - Rename snake_case functions to Verb-Noun across all scripts Compatibility (target: apt + dnf + pacman everywhere): - docker: add Arch support (community packages) - kubernetes: add Arch support via checksum-verified kubectl binary - ansible: add Arch support (python/python-pip) - terraform: add Arch support, drop legacy yum branch - openssh: add Arch support, drop legacy yum branches Bug fixes: - kubernetes: pkgs.k8s.io repos are per minor version; deriving the repo URL from the full patch version (v1.36.2) produced a dead URL after Renovate patch bumps. Use the minor channel (v1.36) instead. - openssh: detect the ssh/sshd service name after package install instead of before; prefer the ACTIVE firewall instead of firewalld-if-installed; remove undefined $ssh_version reference in verify; avoid ((i++)) exiting under 'set -e' when the counter is zero - docker: initialize CODENAME so the dnf/pacman paths survive 'set -u'; fallback to get.docker.com now warns and can be disabled (DOCKER_FALLBACK=0) - nginx: install rustup via a checksum-verified rustup-init download instead of 'curl | sh' (twice); drop the no-op self syntax check; replace the 'exec > >(tee ...)' redirect with explicit logging https://claude.ai/code/session_01CwcGoChWejL9QXdwkYHFzQ
- Rename 'Install HPIA.ps1' -> Install-HPImageAssistant.ps1, 'Install Dell-Command_Update.ps1' -> Install-DellCommandUpdate.ps1 and configure-Windows-VM.ps1 -> Optimize-WindowsVM.ps1 (Verb-Noun, no spaces) - Add comment-based help, Set-StrictMode and ErrorActionPreference=Stop to all Windows scripts, matching nginx_installer.ps1 and TLS-checker.ps1 - Check winget exit codes in the HP/Dell wrappers - Optimize-WindowsVM: skip services that do not exist on a given edition instead of aborting; translate the remaining Dutch comment - Get-InstalledSoftware: English output column names (Naam -> DisplayName etc.) Install-VagrantVMware.ps1 keeps its filename and the VAGRANT_VERSION line format because Renovate's custom manager matches both. https://claude.ai/code/session_01CwcGoChWejL9QXdwkYHFzQ
- Enable the git-submodules manager: the TLS-tools/testssl.sh submodule was the only dependency in the repo that Renovate never updated - Drop the dockerfile/docker-compose managers and their package rule; the repo contains no Dockerfiles - Translate the remaining Dutch descriptions to English Validated with renovate-config-validator. https://claude.ai/code/session_01CwcGoChWejL9QXdwkYHFzQ
- validate-scripts.yml: fail when a script's boilerplate block drifts from .github/scripts/boilerplate.sh - README: add the Linux distro support matrix (apt/dnf/pacman), document the Verb-Noun and shared-boilerplate conventions, update renamed Windows files - CONTRIBUTING: replace the stale Dependabot/check-dependencies instructions (neither exists) with the actual Renovate + checksum-workflow setup, and document the new script conventions https://claude.ai/code/session_01CwcGoChWejL9QXdwkYHFzQ
Fedora 41+ ships dnf5, where 'config-manager --add-repo' no longer exists; use the dnf5 'addrepo --from-repofile' syntax with a dnf4 fallback for RHEL. Also pick HashiCorp's dedicated Fedora repo on Fedora instead of the RHEL one. Verified in a fedora:latest container. https://claude.ai/code/session_01CwcGoChWejL9QXdwkYHFzQ
The shared helper functions stay in every script, but without the separate .github/scripts/boilerplate.sh reference copy, the check-boilerplate.sh CI gate and the BEGIN/END markers. The helpers are now just a regular 'Common Helper Functions' section in each script. https://claude.ai/code/session_01CwcGoChWejL9QXdwkYHFzQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All bash scripts now share one byte-identical boilerplate block (logging,
root check, package-manager detection, command runner) with PowerShell-style
Verb-Noun function names, verified by .github/scripts/check-boilerplate.sh.
Consistency:
(terraform previously ran without pipefail, masking pipe failures)
Compatibility (target: apt + dnf + pacman everywhere):
Bug fixes:
from the full patch version (v1.36.2) produced a dead URL after Renovate
patch bumps. Use the minor channel (v1.36) instead.
before; prefer the ACTIVE firewall instead of firewalld-if-installed;
remove undefined $ssh_version reference in verify; avoid ((i++)) exiting
under 'set -e' when the counter is zero
fallback to get.docker.com now warns and can be disabled (DOCKER_FALLBACK=0)
of 'curl | sh' (twice); drop the no-op self syntax check; replace the
'exec > >(tee ...)' redirect with explicit logging
https://claude.ai/code/session_01CwcGoChWejL9QXdwkYHFzQ