cd_install
Some checks failed
/ job (push) Failing after 6s

This commit is contained in:
Marc Beninca 2024-04-26 18:54:09 +02:00
parent af80453e2e
commit f523acaa2a
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

33
cd.sh
View file

@ -3,14 +3,15 @@
CD_DNS_SERVERS=(
'9.9.9.9'
)
CD_REPOSITORY='rwx.work/cd'
CD_REPOSITORY_NAME='cd'
CD_REPOSITORY_PATH='rwx.work'
CD_DNS_FILE='/etc/resolv.conf'
case "${CD_OS_NAME}" in
'debian')
case "${CD_OS_VERSION}" in
'bookworm')
echo 'bookworm!'
echo 'TODO'
;;
*)
echo 'CD_OS_VERSION'
@ -23,6 +24,14 @@ case "${CD_OS_NAME}" in
exit 1
;;
esac
[ "${CI_SERVER_URL}" ] && CD_REPOSITORY_URL="${CI_SERVER_URL}"
[ "${GITHUB_SERVER_URL}" ] && CD_REPOSITORY_URL="${GITHUB_SERVER_URL}"
if [ "${CD_REPOSITORY_URL}" ] ; then
CD_REPOSITORY_URL+="/${CD_REPOSITORY_PATH}/${CD_REPOSITORY_NAME}"
else
echo '_REPOSITORY_URL'
exit 3
fi
CD_STEP=0
function cd_step {
@ -172,6 +181,14 @@ function cd_clean_packages_cache {
esac
}
function cd_install {
local directory
cd_step "${FUNCNAME}"
directory="$(mktemp --directory)" || exit
git clone "${CD_REPOSITORY_URL}" "${directory}" || exit
# TODO copy
}
function cd_main {
cd_set_dns_resolving
cd_set_packages_repositories
@ -186,18 +203,10 @@ function cd_main {
cd_install_git
cd_install_python
cd_clean_packages_cache
cd_install
DIRECTORY="$(mktemp --directory)" \
|| exit
cd_step "clone Continuous Delivery"
git clone \
"${GITHUB_SERVER_URL}/${CD_REPOSITORY}" \
"${DIRECTORY}" \
|| exit
cd_step "bootstrap"
cd_step 'bootstrap'
"${DIRECTORY}/bootstrap.sh"
}
cd_main