From b77ff553ee7d2931bc778918bcb3c553b066a0f3 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Jul 2024 09:19:25 +0200 Subject: [PATCH 1/6] shell=sh --- .shellcheckrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.shellcheckrc b/.shellcheckrc index b1d708a..202d63d 100644 --- a/.shellcheckrc +++ b/.shellcheckrc @@ -1 +1,2 @@ enable=all +shell=sh From 461303c7364b4959c5ccfe111d9c13e3d0f8c08d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Jul 2024 19:39:11 +0200 Subject: [PATCH 2/6] synchronize --- spcd/cmd.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/spcd/cmd.py b/spcd/cmd.py index bd1fc7b..07a942a 100644 --- a/spcd/cmd.py +++ b/spcd/cmd.py @@ -22,12 +22,18 @@ def spcd_build_project() -> None: pass -def spcd_synchronize() -> None: - host = env.SPCD_PROJECT_PATH - source = "out" - user = "cd" - root = Path(os.sep) / user / project.branch / projects.group / project.name - target = f"{user}@{host}:{root}" +def spcd_synchronize( + target: str | None = None, source: str | None = None +) -> None: + if not target: + user = "cd" + host = env.SPCD_PROJECT_PATH + root = ( + Path(os.sep) / user / project.branch / projects.group / project.name + ) + target = f"{user}@{host}:{root}" + if not source: + source = "out" ps.run( "rsync", "--archive", From 9e2cd54c66e750852d5950d8c2f8e9b04812b28c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 2 Aug 2024 21:17:40 +0200 Subject: [PATCH 3/6] tasks --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index 6a0a809..095eb26 100644 --- a/readme.md +++ b/readme.md @@ -80,6 +80,8 @@ from various contexts of CA, CI and OCI / OS. ## Tasks +* enumerate name servers +* handle python virtual environment * relay environment module name * write tests From 1b9996a13de97e805438ad3b270c38634e9a6194 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 2 Aug 2024 21:19:28 +0200 Subject: [PATCH 4/6] tasks --- readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.md b/readme.md index 095eb26..636e893 100644 --- a/readme.md +++ b/readme.md @@ -80,6 +80,9 @@ from various contexts of CA, CI and OCI / OS. ## Tasks +* define templates + * actions + * includes * enumerate name servers * handle python virtual environment * relay environment module name From 7822b94f4705e95450de79b97d2e3413ea882134 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 3 Aug 2024 00:51:58 +0200 Subject: [PATCH 5/6] pip --- readme.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 636e893..0a33a01 100644 --- a/readme.md +++ b/readme.md @@ -85,6 +85,10 @@ from various contexts of CA, CI and OCI / OS. * includes * enumerate name servers * handle python virtual environment + * install venv if necessary + * upgrade pip + * install packages + * ruff * relay environment module name * write tests @@ -98,8 +102,6 @@ from various contexts of CA, CI and OCI / OS. * shellcheck * graphviz * openssh - * pip - * ruff * rsync * shfmt * lint From b414222048b67e1e6c3ba2d21367d9e63d02fb31 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 6 Aug 2024 12:53:23 +0200 Subject: [PATCH 6/6] enumerate name servers --- readme.md | 5 ++--- spcd.sh | 12 +++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/readme.md b/readme.md index 0a33a01..30b7aa9 100644 --- a/readme.md +++ b/readme.md @@ -44,8 +44,8 @@ from various contexts of CA, CI and OCI / OS. | SPCD_BRANCH_RELEASE | Release deployment branch | main | | SPCD_BRANCH_STAGING | Staging deployment branch | dev | | SPCD_BRANCH_FEATURE | Feature deployment branch | f | -| SPCD_CA_n | Numbered CA certificate | | -| SPCD_DNS | Space separated servers | 9.9.9.9 | +| SPCD_CA_n | Numbered CA certificates | | +| SPCD_DNS_n | Numbered name servers | 9.9.9.9 | | SPCD_GIT_MAIN | Main Git repository | spcd | | SPCD_GIT_ROOT | Root Git repository | rwx | | SPCD_SSH_HOSTS | domain.tld ssh-type pub | | @@ -83,7 +83,6 @@ from various contexts of CA, CI and OCI / OS. * define templates * actions * includes -* enumerate name servers * handle python virtual environment * install venv if necessary * upgrade pip diff --git a/spcd.sh b/spcd.sh index 32be9e9..6af63bf 100644 --- a/spcd.sh +++ b/spcd.sh @@ -4,9 +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_DNS}" ] || SPCD_DNS="\ -9.9.9.9 \ -" +[ -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" @@ -529,10 +527,14 @@ spcd_set_https_verification_off() { spcd_set_dns_resolving() { spcd_step "Set DNS resolving" - for spcd_sdr__server in ${SPCD_DNS}; do + spcd_sdr__index=1 + eval "spcd_sdr__value=\"\${SPCD_DNS_${spcd_sdr__index}}\"" + while [ -n "${spcd_sdr__value}" ]; do spcd_sdr__text="${spcd_sdr__text}\ -nameserver ${spcd_sdr__server} +nameserver ${spcd_sdr__value} " + spcd_sdr__index=$((spcd_sdr__index + 1)) + eval "spcd_sdr__value=\"\${SPCD_DNS_${spcd_sdr__index}}\"" done spcd_write "${SPCD_DNS_FILE}" "${spcd_sdr__text}" }