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

This commit is contained in:
Marc Beninca 2024-04-26 20:09:11 +02:00
parent af3e2ad8ed
commit f2e530efc5
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

34
cd.sh
View file

@ -3,8 +3,9 @@
CD_DNS_SERVERS=(
'9.9.9.9'
)
CD_REPOSITORIES_GROUP='rwx.work'
CD_REPOSITORIES_PARENT='rwx'
CD_REPOSITORY_NAME='cd'
CD_REPOSITORY_PATH='rwx.work'
CD_DNS_FILE='/etc/resolv.conf'
case "${CD_OS_NAME}" in
@ -24,12 +25,12 @@ 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}"
[ "${CI_SERVER_URL}" ] && CD_REPOSITORIES_URL="${CI_SERVER_URL}"
[ "${GITHUB_SERVER_URL}" ] && CD_REPOSITORIES_URL="${GITHUB_SERVER_URL}"
if [ "${CD_REPOSITORIES_URL}" ] ; then
CD_REPOSITORIES_URL+="/${CD_REPOSITORIES_GROUP}"
else
echo '_REPOSITORY_URL'
echo 'CD_REPOSITORIES_URL'
exit 3
fi
CD_STEP=0
@ -182,11 +183,24 @@ function cd_clean_packages_cache {
}
function cd_install {
local directory
local repository
local root
local target
cd_step "${FUNCNAME}"
directory="$(mktemp --directory)" || exit
git clone "${CD_REPOSITORY_URL}" "${directory}" || exit
# TODO copy
case "${CD_OS_NAME}" in
'debian') target='/usr/lib/python3/dist-packages' || exit ;;
*) exit 1 ;;
esac
root="$(mktemp --directory)" || exit
for repository in \
"${CD_REPOSITORIES_PARENT}" \
"${CD_REPOSITORY_NAME}" \
; do
git clone \
"${CD_REPOSITORIES_URL}/${repository}" "{root}/${repository}" || exit
cp --recursive --verbose "${root}/${repository}" "${target}"
# TODO commands
done
}
function cd_bootstrap {