steps
Some checks failed
/ job (push) Failing after 7s

This commit is contained in:
Marc Beninca 2024-04-27 22:37:16 +02:00
parent b051c5b4e3
commit fd6998a68f
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

29
cd.sh
View file

@ -25,6 +25,7 @@ cd_main () {
#
cd_set_environment () {
cd_step 'Set environment'
CD_DNS_FILE='/etc/resolv.conf'
case "${CD_OS_NAME}" in
'debian')
@ -86,7 +87,7 @@ cd_set_environment () {
cd_set_dns_resolving () {
local server
local text=''
cd_step "${FUNCNAME}"
cd_step 'Set DNS resolving'
for server in "${@}" ; do
text="${text}nameserver ${server}
"
@ -95,7 +96,7 @@ local text=''
}
cd_set_packages_repositories () {
cd_step "${FUNCNAME}"
cd_step 'Set packages repositories'
case "${CD_OS_NAME}" in
'debian')
cd_write '/etc/apt/sources.list' "\
@ -110,7 +111,7 @@ deb https://deb.debian.org/debian-security bookworm-security main
}
cd_set_packages_configuration () {
cd_step "${FUNCNAME}"
cd_step 'Set packages configuration'
case "${CD_OS_NAME}" in
'debian')
export DEBIAN_FRONTEND='noninteractive'
@ -127,7 +128,7 @@ Dir::Etc::SourceParts \"\";
}
cd_set_https_verification_off () {
cd_step "${FUNCNAME}"
cd_step 'Set HTTPS verification off'
case "${CD_OS_NAME}" in
'debian')
cd_write '/etc/apt/apt.conf.d/https' "\
@ -139,7 +140,7 @@ Acquire::https::Verify-Peer False;
}
cd_update_packages_catalog () {
cd_step "${FUNCNAME}"
cd_step 'Update packages catalog'
case "${CD_OS_NAME}" in
'debian') apt-get update || exit ;;
*) exit 1 ;;
@ -147,7 +148,7 @@ cd_update_packages_catalog () {
}
cd_install_packages_tools () {
cd_step "${FUNCNAME}"
cd_step 'Install packages tools'
case "${CD_OS_NAME}" in
'debian') cd_install_package 'apt-utils' ;;
*) exit 1 ;;
@ -155,7 +156,7 @@ cd_install_packages_tools () {
}
cd_install_ca () {
cd_step "${FUNCNAME}"
cd_step 'Install CA'
case "${CD_OS_NAME}" in
'debian') cd_install_package 'ca-certificates' ;;
*) exit 1 ;;
@ -163,7 +164,7 @@ cd_install_ca () {
}
cd_set_https_verification_on () {
cd_step "${FUNCNAME}"
cd_step 'Set HTTPS verification on'
case "${CD_OS_NAME}" in
'debian') rm '/etc/apt/apt.conf.d/https' ;;
*) exit 1 ;;
@ -171,7 +172,7 @@ cd_set_https_verification_on () {
}
cd_upgrade_packages () {
cd_step "${FUNCNAME}"
cd_step 'Upgrade packages'
case "${CD_OS_NAME}" in
'debian') apt-get upgrade --yes || exit ;;
*) exit 1 ;;
@ -179,7 +180,7 @@ cd_upgrade_packages () {
}
cd_install_git () {
cd_step "${FUNCNAME}"
cd_step 'Install Git'
case "${CD_OS_NAME}" in
'debian') cd_install_package 'git' ;;
*) exit 1 ;;
@ -187,7 +188,7 @@ cd_install_git () {
}
cd_install_python () {
cd_step "${FUNCNAME}"
cd_step 'Install Python'
case "${CD_OS_NAME}" in
'debian') cd_install_package 'python3' ;;
*) exit 1 ;;
@ -195,7 +196,7 @@ cd_install_python () {
}
cd_clean_packages_cache () {
cd_step "${FUNCNAME}"
cd_step 'Clean packages cache'
case "${CD_OS_NAME}" in
'debian') apt-get clean || exit ;;
*) exit 1 ;;
@ -205,7 +206,7 @@ cd_clean_packages_cache () {
cd_install () {
local repository
local root
cd_step "${FUNCNAME}"
cd_step 'Install'
root="$(mktemp --directory)" || exit
for repository in "${@}" ; do
git clone \
@ -219,7 +220,7 @@ local root
}
cd_bootstrap () {
cd_step "${FUNCNAME}"
cd_step 'Bootstrap'
"${CD_PYTHON_COMMAND}" -m "${1}"
}