Compare commits
5 commits
1e4ad2125e
...
a376f1b148
Author | SHA1 | Date | |
---|---|---|---|
a376f1b148 | |||
5593c26ded | |||
4d5ed3faed | |||
e52764c8bf | |||
3a58be34e0 |
2 changed files with 47 additions and 35 deletions
29
readme.md
29
readme.md
|
@ -45,6 +45,7 @@ from various contexts of CA, CI and OCI / OS.
|
||||||
| 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 certificates | |
|
| 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_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 |
|
||||||
|
@ -87,11 +88,16 @@ from various contexts of CA, CI and OCI / OS.
|
||||||
* relay environment module name
|
* relay environment module name
|
||||||
* write tests
|
* write tests
|
||||||
|
|
||||||
### .py
|
### sh
|
||||||
|
|
||||||
* detect ssh private key type
|
* support
|
||||||
* implement project repository cloning
|
* arch python virtual environment
|
||||||
* install
|
* opensuse operating system
|
||||||
|
|
||||||
|
### sh → py
|
||||||
|
|
||||||
|
* check file & variable sums
|
||||||
|
* install system packages
|
||||||
* epel
|
* epel
|
||||||
* plantuml
|
* plantuml
|
||||||
* shellcheck
|
* shellcheck
|
||||||
|
@ -99,10 +105,17 @@ from various contexts of CA, CI and OCI / OS.
|
||||||
* openssh
|
* openssh
|
||||||
* rsync
|
* rsync
|
||||||
* shfmt
|
* shfmt
|
||||||
|
* python virtual environment
|
||||||
|
* install system package
|
||||||
|
* configure pip
|
||||||
|
* venv
|
||||||
|
* create
|
||||||
|
* activate
|
||||||
|
|
||||||
|
### py
|
||||||
|
|
||||||
|
* detect ssh private key type
|
||||||
|
* implement project repository cloning
|
||||||
* lint
|
* lint
|
||||||
* .py
|
* .py
|
||||||
* .sh
|
* .sh
|
||||||
|
|
||||||
### .sh
|
|
||||||
|
|
||||||
* support opensuse
|
|
||||||
|
|
53
spcd.sh
53
spcd.sh
|
@ -4,6 +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_CMD_SUM}" ] || SPCD_CMD_SUM="sha512sum"
|
||||||
[ -n "${SPCD_DNS_1}" ] || SPCD_DNS_1="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_MAIN}" ] || SPCD_GIT_MAIN="spcd"
|
||||||
[ -n "${SPCD_GIT_ROOT}" ] || SPCD_GIT_ROOT="rwx"
|
[ -n "${SPCD_GIT_ROOT}" ] || SPCD_GIT_ROOT="rwx"
|
||||||
|
@ -32,7 +33,6 @@ spcd_main() {
|
||||||
spcd_install_git
|
spcd_install_git
|
||||||
spcd_install_python
|
spcd_install_python
|
||||||
spcd_install_python_modules
|
spcd_install_python_modules
|
||||||
# TODO move to Python
|
|
||||||
spcd_install_packages
|
spcd_install_packages
|
||||||
spcd_write_python_module
|
spcd_write_python_module
|
||||||
spcd_switch_to_python
|
spcd_switch_to_python
|
||||||
|
@ -605,6 +605,28 @@ spcd_install_python() {
|
||||||
spcd_install_package "${SPCD_PYTHON_PACKAGE}"
|
spcd_install_package "${SPCD_PYTHON_PACKAGE}"
|
||||||
spcd_split
|
spcd_split
|
||||||
spcd_ln_python "${SPCD_PYTHON_COMMAND}"
|
spcd_ln_python "${SPCD_PYTHON_COMMAND}"
|
||||||
|
# venv
|
||||||
|
spcd_step "Install Python virtual environment"
|
||||||
|
case "${SPCD_OS_ID}" in
|
||||||
|
"${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
|
||||||
|
spcd_install_package "python3-venv"
|
||||||
|
;;
|
||||||
|
"${SPCD_OS_ARCH}")
|
||||||
|
echo "Not supported!"
|
||||||
|
exit 255
|
||||||
|
;;
|
||||||
|
*) ;;
|
||||||
|
esac
|
||||||
|
spcd_split
|
||||||
|
spcd_write "/etc/pip.conf" "\
|
||||||
|
[global]
|
||||||
|
index-url = ${SPCD_URL_PYTHON}
|
||||||
|
"
|
||||||
|
spcd_split
|
||||||
|
"${SPCD_PYTHON_ALIAS}" -m "venv" "${SPCD_PYTHON_VENV}"
|
||||||
|
spcd_split
|
||||||
|
export PATH="${SPCD_PYTHON_VENV_BINARIES}:${PATH}"
|
||||||
|
export VIRTUAL_ENV="${SPCD_PYTHON_VENV}"
|
||||||
}
|
}
|
||||||
|
|
||||||
spcd_install_python_modules() {
|
spcd_install_python_modules() {
|
||||||
|
@ -639,13 +661,13 @@ ${spcd_ipm__target}"
|
||||||
spcd_ipm__script="${spcd_ipm__root}/${spcd_ipm__name}/spcd.sh"
|
spcd_ipm__script="${spcd_ipm__root}/${spcd_ipm__name}/spcd.sh"
|
||||||
if [ -f "${spcd_ipm__script}" ]; then
|
if [ -f "${spcd_ipm__script}" ]; then
|
||||||
spcd_split
|
spcd_split
|
||||||
spcd_ipm__check="${spcd_ipm__root}/check.sha512sum"
|
spcd_ipm__check="${spcd_ipm__root}/check.${SPCD_CMD_SUM}"
|
||||||
sha512sum "${spcd_ipm__script}" >"${spcd_ipm__check}"
|
"${SPCD_CMD_SUM}" "${spcd_ipm__script}" >"${spcd_ipm__check}"
|
||||||
printf "%s" "${SPCD}" >"${spcd_ipm__script}"
|
printf "%s" "${SPCD}" >"${spcd_ipm__script}"
|
||||||
ls -l "${spcd_ipm__script}"
|
ls -l "${spcd_ipm__script}"
|
||||||
dos2unix "${spcd_ipm__script}"
|
dos2unix "${spcd_ipm__script}"
|
||||||
ls -l "${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
|
fi
|
||||||
done
|
done
|
||||||
spcd_split
|
spcd_split
|
||||||
|
@ -654,7 +676,6 @@ ${spcd_ipm__target}"
|
||||||
spcd_rm "${spcd_ipm__root}"
|
spcd_rm "${spcd_ipm__root}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO move to Python
|
|
||||||
spcd_install_packages() {
|
spcd_install_packages() {
|
||||||
# epel
|
# epel
|
||||||
spcd_step "Install EPEL"
|
spcd_step "Install EPEL"
|
||||||
|
@ -704,28 +725,6 @@ spcd_install_packages() {
|
||||||
"${SPCD_PM_PACMAN}") spcd_install_package "openssh" ;;
|
"${SPCD_PM_PACMAN}") spcd_install_package "openssh" ;;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
# venv
|
|
||||||
spcd_step "Install Python virtual environment"
|
|
||||||
case "${SPCD_OS_ID}" in
|
|
||||||
"${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
|
|
||||||
spcd_install_package "python3-venv"
|
|
||||||
;;
|
|
||||||
"${SPCD_OS_ARCH}")
|
|
||||||
# FIXME arch
|
|
||||||
exit 255
|
|
||||||
;;
|
|
||||||
*) ;;
|
|
||||||
esac
|
|
||||||
spcd_split
|
|
||||||
spcd_write "/etc/pip.conf" "\
|
|
||||||
[global]
|
|
||||||
index-url = ${SPCD_URL_PYTHON}
|
|
||||||
"
|
|
||||||
spcd_split
|
|
||||||
"${SPCD_PYTHON_ALIAS}" -m "venv" "${SPCD_PYTHON_VENV}"
|
|
||||||
spcd_split
|
|
||||||
export PATH="${SPCD_PYTHON_VENV_BINARIES}:${PATH}"
|
|
||||||
export VIRTUAL_ENV="${SPCD_PYTHON_VENV}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
spcd_write_python_module() {
|
spcd_write_python_module() {
|
||||||
|
|
Loading…
Reference in a new issue