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

81
spcd.sh
View file

@ -739,8 +739,9 @@ ${spcd_ipm__target}"
} }
spcd_install_packages() { spcd_install_packages() {
spcd_step "Install packages"
# epel # epel
spcd_step "Install EPEL" spcd_substep "Install EPEL"
case "${SPCD_OS_ID}" in case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") "${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}")
spcd_install_package "epel-release" spcd_install_package "epel-release"
@ -754,36 +755,13 @@ spcd_install_packages() {
*) ;; *) ;;
esac esac
# bats # bats
spcd_step "Install BATS" spcd_substep "Install BATS"
spcd_install_package "bats" spcd_install_package "bats"
# graphviz # graphviz
spcd_step "Install GraphViz" spcd_substep "Install GraphViz"
spcd_install_package "graphviz" spcd_install_package "graphviz"
# plantuml # openssh
spcd_step "Install PlantUML" spcd_substep "Install OpenSSH"
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"
case "${SPCD_PM}" in case "${SPCD_PM}" in
"${SPCD_PM_APK}" | "${SPCD_PM_APT}") "${SPCD_PM_APK}" | "${SPCD_PM_APT}")
spcd_install_package "openssh-client" spcd_install_package "openssh-client"
@ -794,6 +772,29 @@ spcd_install_packages() {
"${SPCD_PM_PACMAN}") spcd_install_package "openssh" ;; "${SPCD_PM_PACMAN}") spcd_install_package "openssh" ;;
*) ;; *) ;;
esac 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() { spcd_write_python_module() {
@ -827,6 +828,13 @@ ${SPCD_PYTHON_ALIAS} / ${spcd_stp__name}"
# functions # functions
spcd_banner() {
echo "\
${SPCD_DOWN}
${SPCD_VERT} ${*}
${SPCD___UP}"
}
spcd_cat() { spcd_cat() {
spcd_cat__file="${1}" spcd_cat__file="${1}"
if [ -n "${spcd_cat__file}" ]; then if [ -n "${spcd_cat__file}" ]; then
@ -944,10 +952,19 @@ spcd_split() {
spcd_step() { spcd_step() {
SPCD_STEP=$((SPCD_STEP + 1)) SPCD_STEP=$((SPCD_STEP + 1))
echo "\ SPCD_STEP_TEXT="${*}"
${SPCD_DOWN} unset SPCD_SUBSTEP
${SPCD_VERT} ${SPCD_STEP} ${*} spcd_banner "${SPCD_STEP}" "${SPCD_VERT}" "${SPCD_STEP_TEXT}"
${SPCD___UP}" }
spcd_substep() {
SPCD_SUBSTEP=$((SPCD_SUBSTEP + 1))
spcd_banner \
"${SPCD_STEP}.${SPCD_SUBSTEP}" \
"${SPCD_VERT}" \
"${SPCD_STEP_TEXT}" \
"${SPCD_VERT}" \
"${*}"
} }
spcd_write() { spcd_write() {