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