ifs
Some checks failed
/ job (push) Failing after 11m49s

This commit is contained in:
Marc Beninca 2024-06-08 23:14:27 +02:00
parent 76070daa43
commit 8c016627f9
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

24
cd.sh
View file

@ -350,16 +350,40 @@ Acquire::https::Verify-Peer False;
# continuous integration platform
if [ -n "${GITHUB_ACTIONS}" ] ; then
# github → gitea → forgejo
if [ -n "${GITHUB_SERVER_URL}" ] ; then
CD_SERVER_URL="${GITHUB_SERVER_URL}"
else
cd_error_ci "GITHUB_SERVER_URL"
fi
if [ -n "${GITHUB_REPOSITORY}" ] ; then
CD_PROJECTS_GROUP="$(dirname "${GITHUB_REPOSITORY}")"
CD_PROJECT_NAME="$(basename "${GITHUB_REPOSITORY}")"
else
cd_error_ci "GITHUB_REPOSITORY"
fi
if [ -n "${GITHUB_REF_NAME}" ] ; then
CD_PROJECT_BRANCH="${GITHUB_REF_NAME}"
else
cd_error_ci "GITHUB_REF_NAME"
fi
elif [ -n "${GITLAB_CI}" ] ; then
# gitlab
if [ -n "${CI_SERVER_URL}" ] ; then
CD_SERVER_URL="${CI_SERVER_URL}"
else
cd_error_ci "CI_SERVER_URL"
fi
if [ -n "${CI_PROJECT_PATH}" ] ; then
CD_PROJECTS_GROUP="$(dirname "${CI_PROJECT_PATH}")"
CD_PROJECT_NAME="$(basename "${CI_PROJECT_PATH}")"
else
cd_error_ci "CI_PROJECT_PATH"
fi
if [ -n "${CI_COMMIT_BRANCH}" ] ; then
CD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}"
else
cd_error_ci "CI_COMMIT_BRANCH"
fi
else
# unsupported
cd_error_ci "ø"