From e52764c8bf0c79b705cb4eec3b04fbb44e78bf33 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 19 Aug 2024 14:27:10 +0200 Subject: [PATCH] spcd_cmd_sum --- readme.md | 15 ++++++++++----- spcd.sh | 7 ++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/readme.md b/readme.md index 0fa11f1..db778e6 100644 --- a/readme.md +++ b/readme.md @@ -45,6 +45,7 @@ from various contexts of CA, CI and OCI / OS. | SPCD_BRANCH_STAGING | Staging deployment branch | dev | | SPCD_BRANCH_FEATURE | Feature deployment branch | f | | SPCD_CA_n | Numbered CA certificates | | +| SPCD_CMD_SUM | Command to check sums | sha512sum | | SPCD_DNS_n | Numbered name servers | 9.9.9.9 | | SPCD_GIT_MAIN | Main Git repository | spcd | | SPCD_GIT_ROOT | Root Git repository | rwx | @@ -87,7 +88,15 @@ from various contexts of CA, CI and OCI / OS. * relay environment module name * write tests -### .py +### sh + +* support opensuse + +### sh → py + +* check file & variable sums + +### py * detect ssh private key type * implement project repository cloning @@ -102,7 +111,3 @@ from various contexts of CA, CI and OCI / OS. * lint * .py * .sh - -### .sh - -* support opensuse diff --git a/spcd.sh b/spcd.sh index ad425f4..24d6d2e 100644 --- a/spcd.sh +++ b/spcd.sh @@ -4,6 +4,7 @@ [ -n "${SPCD_BRANCH_RELEASE}" ] || SPCD_BRANCH_RELEASE="main" [ -n "${SPCD_BRANCH_STAGING}" ] || SPCD_BRANCH_STAGING="dev" [ -n "${SPCD_BRANCH_FEATURE}" ] || SPCD_BRANCH_FEATURE="f" +[ -n "${SPCD_CMD_SUM}" ] || SPCD_CMD_SUM="sha512sum" [ -n "${SPCD_DNS_1}" ] || SPCD_DNS_1="9.9.9.9" [ -n "${SPCD_GIT_MAIN}" ] || SPCD_GIT_MAIN="spcd" [ -n "${SPCD_GIT_ROOT}" ] || SPCD_GIT_ROOT="rwx" @@ -661,13 +662,13 @@ ${spcd_ipm__target}" spcd_ipm__script="${spcd_ipm__root}/${spcd_ipm__name}/spcd.sh" if [ -f "${spcd_ipm__script}" ]; then spcd_split - spcd_ipm__check="${spcd_ipm__root}/check.sha512sum" - sha512sum "${spcd_ipm__script}" >"${spcd_ipm__check}" + spcd_ipm__check="${spcd_ipm__root}/check.${SPCD_CMD_SUM}" + "${SPCD_CMD_SUM}" "${spcd_ipm__script}" >"${spcd_ipm__check}" printf "%s" "${SPCD}" >"${spcd_ipm__script}" ls -l "${spcd_ipm__script}" dos2unix "${spcd_ipm__script}" ls -l "${spcd_ipm__script}" - sha512sum -c "${spcd_ipm__check}" || spcd_error_ci "SPCD" + "${SPCD_CMD_SUM}" -c "${spcd_ipm__check}" || spcd_error_ci "SPCD" fi done spcd_split