Compare commits
6 commits
b1dc6e7ea9
...
b414222048
Author | SHA1 | Date | |
---|---|---|---|
b414222048 | |||
7822b94f47 | |||
1b9996a13d | |||
9e2cd54c66 | |||
461303c736 | |||
b77ff553ee |
4 changed files with 30 additions and 15 deletions
|
@ -1 +1,2 @@
|
||||||
enable=all
|
enable=all
|
||||||
|
shell=sh
|
||||||
|
|
14
readme.md
14
readme.md
|
@ -44,8 +44,8 @@ from various contexts of CA, CI and OCI / OS.
|
||||||
| SPCD_BRANCH_RELEASE | Release deployment branch | main |
|
| SPCD_BRANCH_RELEASE | Release deployment branch | main |
|
||||||
| SPCD_BRANCH_STAGING | Staging deployment branch | dev |
|
| SPCD_BRANCH_STAGING | Staging deployment branch | dev |
|
||||||
| SPCD_BRANCH_FEATURE | Feature deployment branch | f |
|
| SPCD_BRANCH_FEATURE | Feature deployment branch | f |
|
||||||
| SPCD_CA_n | Numbered CA certificate | |
|
| SPCD_CA_n | Numbered CA certificates | |
|
||||||
| SPCD_DNS | Space separated servers | 9.9.9.9 |
|
| SPCD_DNS_n | Numbered name servers | 9.9.9.9 |
|
||||||
| SPCD_GIT_MAIN | Main Git repository | spcd |
|
| SPCD_GIT_MAIN | Main Git repository | spcd |
|
||||||
| SPCD_GIT_ROOT | Root Git repository | rwx |
|
| SPCD_GIT_ROOT | Root Git repository | rwx |
|
||||||
| SPCD_SSH_HOSTS | domain.tld ssh-type pub | |
|
| SPCD_SSH_HOSTS | domain.tld ssh-type pub | |
|
||||||
|
@ -80,6 +80,14 @@ from various contexts of CA, CI and OCI / OS.
|
||||||
|
|
||||||
## Tasks
|
## Tasks
|
||||||
|
|
||||||
|
* define templates
|
||||||
|
* actions
|
||||||
|
* includes
|
||||||
|
* handle python virtual environment
|
||||||
|
* install venv if necessary
|
||||||
|
* upgrade pip
|
||||||
|
* install packages
|
||||||
|
* ruff
|
||||||
* relay environment module name
|
* relay environment module name
|
||||||
* write tests
|
* write tests
|
||||||
|
|
||||||
|
@ -93,8 +101,6 @@ from various contexts of CA, CI and OCI / OS.
|
||||||
* shellcheck
|
* shellcheck
|
||||||
* graphviz
|
* graphviz
|
||||||
* openssh
|
* openssh
|
||||||
* pip
|
|
||||||
* ruff
|
|
||||||
* rsync
|
* rsync
|
||||||
* shfmt
|
* shfmt
|
||||||
* lint
|
* lint
|
||||||
|
|
12
spcd.sh
12
spcd.sh
|
@ -4,9 +4,7 @@
|
||||||
[ -n "${SPCD_BRANCH_RELEASE}" ] || SPCD_BRANCH_RELEASE="main"
|
[ -n "${SPCD_BRANCH_RELEASE}" ] || SPCD_BRANCH_RELEASE="main"
|
||||||
[ -n "${SPCD_BRANCH_STAGING}" ] || SPCD_BRANCH_STAGING="dev"
|
[ -n "${SPCD_BRANCH_STAGING}" ] || SPCD_BRANCH_STAGING="dev"
|
||||||
[ -n "${SPCD_BRANCH_FEATURE}" ] || SPCD_BRANCH_FEATURE="f"
|
[ -n "${SPCD_BRANCH_FEATURE}" ] || SPCD_BRANCH_FEATURE="f"
|
||||||
[ -n "${SPCD_DNS}" ] || SPCD_DNS="\
|
[ -n "${SPCD_DNS_1}" ] || SPCD_DNS_1="9.9.9.9"
|
||||||
9.9.9.9 \
|
|
||||||
"
|
|
||||||
[ -n "${SPCD_GIT_MAIN}" ] || SPCD_GIT_MAIN="spcd"
|
[ -n "${SPCD_GIT_MAIN}" ] || SPCD_GIT_MAIN="spcd"
|
||||||
[ -n "${SPCD_GIT_ROOT}" ] || SPCD_GIT_ROOT="rwx"
|
[ -n "${SPCD_GIT_ROOT}" ] || SPCD_GIT_ROOT="rwx"
|
||||||
|
|
||||||
|
@ -529,10 +527,14 @@ spcd_set_https_verification_off() {
|
||||||
|
|
||||||
spcd_set_dns_resolving() {
|
spcd_set_dns_resolving() {
|
||||||
spcd_step "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}\
|
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
|
done
|
||||||
spcd_write "${SPCD_DNS_FILE}" "${spcd_sdr__text}"
|
spcd_write "${SPCD_DNS_FILE}" "${spcd_sdr__text}"
|
||||||
}
|
}
|
||||||
|
|
18
spcd/cmd.py
18
spcd/cmd.py
|
@ -22,12 +22,18 @@ def spcd_build_project() -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def spcd_synchronize() -> None:
|
def spcd_synchronize(
|
||||||
host = env.SPCD_PROJECT_PATH
|
target: str | None = None, source: str | None = None
|
||||||
source = "out"
|
) -> None:
|
||||||
user = "cd"
|
if not target:
|
||||||
root = Path(os.sep) / user / project.branch / projects.group / project.name
|
user = "cd"
|
||||||
target = f"{user}@{host}:{root}"
|
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(
|
ps.run(
|
||||||
"rsync",
|
"rsync",
|
||||||
"--archive",
|
"--archive",
|
||||||
|
|
Loading…
Reference in a new issue