This commit is contained in:
Marc Beninca 2024-05-02 09:59:17 +02:00
parent e745890b33
commit b3adfe3182
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

41
cd.sh
View file

@ -33,6 +33,7 @@ cd_main () {
# functions
cd_set_environment () {
local variable
cd_step "Set environment"
#
CD_CA_PACKAGE="ca-certificates"
@ -42,12 +43,11 @@ cd_set_environment () {
#
case "${CD_OS_NAME}" in
"debian")
CD_CA_ROOT="/usr/local/share/ca-certificates"
CD_PYTHON_PACKAGE="python3"
CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages"
CD_CA_ROOT="/usr/local/share/ca-certificates"
;;
"alma")
CD_CA_ROOT="/etc/pki/ca-trust/source/anchors"
case "${CD_OS_VERSION}" in
"8"|"9")
CD_PYTHON_PACKAGE="python3.11"
@ -55,6 +55,7 @@ cd_set_environment () {
;;
*) cd_error_os "CD_OS_VERSION=${CD_OS_VERSION}" ;;
esac
CD_CA_ROOT="/etc/pki/ca-trust/source/anchors"
;;
*) cd_error_os "CD_OS_NAME=${CD_OS_NAME}" ;;
esac
@ -83,23 +84,16 @@ cd_set_environment () {
CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}"
CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}"
#
echo -n "\
CD_OS_NAME=${CD_OS_NAME}
CD_OS_VERSION=${CD_OS_VERSION}
#
CD_DNS_FILE=${CD_DNS_FILE}
#
CD_PYTHON_COMMAND=${CD_PYTHON_COMMAND}
CD_PYTHON_PACKAGES=${CD_PYTHON_PACKAGES}
#
CD_SERVER_URL=${CD_SERVER_URL}
CD_PROJECTS_GROUP=${CD_PROJECTS_GROUP}
CD_PROJECT_NAME=${CD_PROJECT_NAME}
CD_PROJECT_BRANCH=${CD_PROJECT_BRANCH}
#
CD_PROJECTS_URL=${CD_PROJECTS_URL}
CD_PROJECT_URL=${CD_PROJECT_URL}
"
cd_echo "CD_OS_NAME" "CD_OS_VERSION"
cd_split
cd_echo "CD_DNS_FILE"
cd_split
cd_echo "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" "CD_CA_ROOT"
cd_split
cd_echo "CD_SERVER_URL" \
"CD_PROJECTS_GROUP" "CD_PROJECT_NAME" "CD_PROJECT_BRANCH"
cd_split
cd_echo "CD_PROJECTS_URL" "CD_PROJECT_URL"
}
cd_set_dns_resolving () {
@ -302,6 +296,15 @@ cd_cat () {
fi
}
cd_echo () {
local name
if [ "${1}" ] ; then
for name in "${@}" ; do
eval "echo ${name}=\${${name}}"
done
fi
}
cd_error_ci () {
echo "× CI: ${1}"
exit 1