parent
76070daa43
commit
8c016627f9
1 changed files with 32 additions and 8 deletions
24
cd.sh
24
cd.sh
|
@ -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 "ø"
|
||||
|
|
Loading…
Reference in a new issue