From 00f6653d2813ccaacc1fac97bb20f7e53805d6d9 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 21 Aug 2024 10:49:40 +0200 Subject: [PATCH 1/7] readme/substeps --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index bb48033..84e904c 100644 --- a/readme.md +++ b/readme.md @@ -99,6 +99,7 @@ from various contexts of CA, CI and OCI / OS. ### sh +* implement substeps * review repositories handling for systems * opensuse * codecs repository @@ -132,6 +133,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 From 3660bd23a296eb58e128f508ef03a861c0488c1a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 21 Aug 2024 10:55:11 +0200 Subject: [PATCH 2/7] spcd_step_text --- spcd.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spcd.sh b/spcd.sh index 035717e..12173e6 100644 --- a/spcd.sh +++ b/spcd.sh @@ -944,9 +944,10 @@ spcd_split() { spcd_step() { SPCD_STEP=$((SPCD_STEP + 1)) + SPCD_STEP_TEXT="${*}" echo "\ ${SPCD_DOWN} -${SPCD_VERT} ${SPCD_STEP} ${*} +${SPCD_VERT} ${SPCD_STEP} ${SPCD_STEP_TEXT} ${SPCD___UP}" } From 96a35fdc8e462a6a1a9742ed45c65536b564a051 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 21 Aug 2024 11:40:44 +0200 Subject: [PATCH 3/7] spcd_banner --- spcd.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/spcd.sh b/spcd.sh index 12173e6..808d706 100644 --- a/spcd.sh +++ b/spcd.sh @@ -827,6 +827,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 @@ -945,10 +952,7 @@ spcd_split() { spcd_step() { SPCD_STEP=$((SPCD_STEP + 1)) SPCD_STEP_TEXT="${*}" - echo "\ -${SPCD_DOWN} -${SPCD_VERT} ${SPCD_STEP} ${SPCD_STEP_TEXT} -${SPCD___UP}" + spcd_banner "${SPCD_STEP}" "${SPCD_STEP_TEXT}" } spcd_write() { From 8ab46c1d5928d5df3d23ace9e36a149ccb93734f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 21 Aug 2024 11:47:17 +0200 Subject: [PATCH 4/7] spcd_substep --- spcd.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/spcd.sh b/spcd.sh index 808d706..a5d95c0 100644 --- a/spcd.sh +++ b/spcd.sh @@ -952,7 +952,18 @@ spcd_split() { spcd_step() { SPCD_STEP=$((SPCD_STEP + 1)) SPCD_STEP_TEXT="${*}" - spcd_banner "${SPCD_STEP}" "${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() { From 01cfa3db652ac68ed775f368773e7cb95254ed0c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 21 Aug 2024 11:52:33 +0200 Subject: [PATCH 5/7] use substeps for packages --- spcd.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/spcd.sh b/spcd.sh index a5d95c0..abb3bc2 100644 --- a/spcd.sh +++ b/spcd.sh @@ -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,19 +755,19 @@ 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_substep "Install PlantUML" spcd_install_package "plantuml" # rsync - spcd_step "Install Rsync" + spcd_substep "Install Rsync" spcd_install_package "rsync" # shell check - spcd_step "Install ShellCheck" + spcd_substep "Install ShellCheck" case "${SPCD_PM}" in "${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}") spcd_install_package "ShellCheck" @@ -774,7 +775,7 @@ spcd_install_packages() { *) spcd_install_package "shellcheck" ;; esac # shfmt - spcd_step "Install ShellFormat" + spcd_substep "Install ShellFormat" case "${SPCD_OS_ID}" in "${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") ;; "${SPCD_OS_DEBIAN}") @@ -782,8 +783,8 @@ spcd_install_packages() { ;; *) 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" From 580b0f1d48dcd1b029859ff7c7cad8bc775ed452 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 21 Aug 2024 11:53:09 +0200 Subject: [PATCH 6/7] mv/openssh --- spcd.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/spcd.sh b/spcd.sh index abb3bc2..9301941 100644 --- a/spcd.sh +++ b/spcd.sh @@ -760,6 +760,18 @@ spcd_install_packages() { # graphviz spcd_substep "Install GraphViz" spcd_install_package "graphviz" + # openssh + spcd_substep "Install OpenSSH" + case "${SPCD_PM}" in + "${SPCD_PM_APK}" | "${SPCD_PM_APT}") + spcd_install_package "openssh-client" + ;; + "${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}") + spcd_install_package "openssh-clients" + ;; + "${SPCD_PM_PACMAN}") spcd_install_package "openssh" ;; + *) ;; + esac # plantuml spcd_substep "Install PlantUML" spcd_install_package "plantuml" @@ -783,18 +795,6 @@ spcd_install_packages() { ;; *) spcd_install_package "shfmt" ;; esac - # openssh - spcd_substep "Install OpenSSH" - case "${SPCD_PM}" in - "${SPCD_PM_APK}" | "${SPCD_PM_APT}") - spcd_install_package "openssh-client" - ;; - "${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}") - spcd_install_package "openssh-clients" - ;; - "${SPCD_PM_PACMAN}") spcd_install_package "openssh" ;; - *) ;; - esac } spcd_write_python_module() { From cd1a7810a490aeea32a86eb2dcebf7bdb0ea9f9b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 21 Aug 2024 11:53:26 +0200 Subject: [PATCH 7/7] tasks/shunit --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index 84e904c..8d53d3c 100644 --- a/readme.md +++ b/readme.md @@ -97,6 +97,8 @@ from various contexts of CA, CI and OCI / OS. ## Tasks +* try git repo url variable first for shunit + ### sh * implement substeps