Compare commits

..

7 commits

Author SHA1 Message Date
cd1a7810a4
tasks/shunit
All checks were successful
/ job (push) Successful in 13m23s
2024-08-21 11:53:26 +02:00
580b0f1d48
mv/openssh 2024-08-21 11:53:09 +02:00
01cfa3db65
use substeps for packages 2024-08-21 11:52:33 +02:00
8ab46c1d59
spcd_substep 2024-08-21 11:47:17 +02:00
96a35fdc8e
spcd_banner 2024-08-21 11:40:44 +02:00
3660bd23a2
spcd_step_text 2024-08-21 10:55:11 +02:00
00f6653d28
readme/substeps 2024-08-21 10:49:40 +02:00
2 changed files with 53 additions and 32 deletions

View file

@ -97,8 +97,11 @@ from various contexts of CA, CI and OCI / OS.
## Tasks
* try git repo url variable first for shunit
### sh
* implement substeps
* review repositories handling for systems
* opensuse
* codecs repository
@ -132,6 +135,7 @@ from various contexts of CA, CI and OCI / OS.
* .sh
* maximum line length
* detect ssh private key type
* implement substeps
* list sys.path
* set workflow templates
* actions

81
spcd.sh
View file

@ -739,8 +739,9 @@ ${spcd_ipm__target}"
}
spcd_install_packages() {
spcd_step "Install packages"
# epel
spcd_step "Install EPEL"
spcd_substep "Install EPEL"
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}")
spcd_install_package "epel-release"
@ -754,36 +755,13 @@ spcd_install_packages() {
*) ;;
esac
# bats
spcd_step "Install BATS"
spcd_substep "Install BATS"
spcd_install_package "bats"
# graphviz
spcd_step "Install GraphViz"
spcd_substep "Install GraphViz"
spcd_install_package "graphviz"
# plantuml
spcd_step "Install PlantUML"
spcd_install_package "plantuml"
# rsync
spcd_step "Install Rsync"
spcd_install_package "rsync"
# shell check
spcd_step "Install ShellCheck"
case "${SPCD_PM}" in
"${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}")
spcd_install_package "ShellCheck"
;;
*) spcd_install_package "shellcheck" ;;
esac
# shfmt
spcd_step "Install ShellFormat"
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") ;;
"${SPCD_OS_DEBIAN}")
[ "${SPCD_OS_VERSION}" != "bullseye" ] && spcd_install_package "shfmt"
;;
*) spcd_install_package "shfmt" ;;
esac
# ssh
spcd_step "Install SSH"
# openssh
spcd_substep "Install OpenSSH"
case "${SPCD_PM}" in
"${SPCD_PM_APK}" | "${SPCD_PM_APT}")
spcd_install_package "openssh-client"
@ -794,6 +772,29 @@ spcd_install_packages() {
"${SPCD_PM_PACMAN}") spcd_install_package "openssh" ;;
*) ;;
esac
# plantuml
spcd_substep "Install PlantUML"
spcd_install_package "plantuml"
# rsync
spcd_substep "Install Rsync"
spcd_install_package "rsync"
# shell check
spcd_substep "Install ShellCheck"
case "${SPCD_PM}" in
"${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}")
spcd_install_package "ShellCheck"
;;
*) spcd_install_package "shellcheck" ;;
esac
# shfmt
spcd_substep "Install ShellFormat"
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") ;;
"${SPCD_OS_DEBIAN}")
[ "${SPCD_OS_VERSION}" != "bullseye" ] && spcd_install_package "shfmt"
;;
*) spcd_install_package "shfmt" ;;
esac
}
spcd_write_python_module() {
@ -827,6 +828,13 @@ ${SPCD_PYTHON_ALIAS} / ${spcd_stp__name}"
# functions
spcd_banner() {
echo "\
${SPCD_DOWN}
${SPCD_VERT} ${*}
${SPCD___UP}"
}
spcd_cat() {
spcd_cat__file="${1}"
if [ -n "${spcd_cat__file}" ]; then
@ -944,10 +952,19 @@ spcd_split() {
spcd_step() {
SPCD_STEP=$((SPCD_STEP + 1))
echo "\
${SPCD_DOWN}
${SPCD_VERT} ${SPCD_STEP} ${*}
${SPCD___UP}"
SPCD_STEP_TEXT="${*}"
unset SPCD_SUBSTEP
spcd_banner "${SPCD_STEP}" "${SPCD_VERT}" "${SPCD_STEP_TEXT}"
}
spcd_substep() {
SPCD_SUBSTEP=$((SPCD_SUBSTEP + 1))
spcd_banner \
"${SPCD_STEP}.${SPCD_SUBSTEP}" \
"${SPCD_VERT}" \
"${SPCD_STEP_TEXT}" \
"${SPCD_VERT}" \
"${*}"
}
spcd_write() {