parent
76070daa43
commit
8c016627f9
1 changed files with 32 additions and 8 deletions
40
cd.sh
40
cd.sh
|
@ -350,16 +350,40 @@ Acquire::https::Verify-Peer False;
|
||||||
# continuous integration platform
|
# continuous integration platform
|
||||||
if [ -n "${GITHUB_ACTIONS}" ] ; then
|
if [ -n "${GITHUB_ACTIONS}" ] ; then
|
||||||
# github → gitea → forgejo
|
# github → gitea → forgejo
|
||||||
CD_SERVER_URL="${GITHUB_SERVER_URL}"
|
if [ -n "${GITHUB_SERVER_URL}" ] ; then
|
||||||
CD_PROJECTS_GROUP="$(dirname "${GITHUB_REPOSITORY}")"
|
CD_SERVER_URL="${GITHUB_SERVER_URL}"
|
||||||
CD_PROJECT_NAME="$(basename "${GITHUB_REPOSITORY}")"
|
else
|
||||||
CD_PROJECT_BRANCH="${GITHUB_REF_NAME}"
|
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
|
elif [ -n "${GITLAB_CI}" ] ; then
|
||||||
# gitlab
|
# gitlab
|
||||||
CD_SERVER_URL="${CI_SERVER_URL}"
|
if [ -n "${CI_SERVER_URL}" ] ; then
|
||||||
CD_PROJECTS_GROUP="$(dirname "${CI_PROJECT_PATH}")"
|
CD_SERVER_URL="${CI_SERVER_URL}"
|
||||||
CD_PROJECT_NAME="$(basename "${CI_PROJECT_PATH}")"
|
else
|
||||||
CD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}"
|
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
|
else
|
||||||
# unsupported
|
# unsupported
|
||||||
cd_error_ci "ø"
|
cd_error_ci "ø"
|
||||||
|
|
Loading…
Reference in a new issue