branch first
This commit is contained in:
parent
60f1a717c5
commit
88cb222ebe
1 changed files with 12 additions and 12 deletions
24
spcd.sh
24
spcd.sh
|
@ -56,6 +56,12 @@ spcd_set_environment_variables() {
|
|||
spcd_step "Set environment variables"
|
||||
# continuous integration / github → gitea → forgejo
|
||||
if [ -n "${GITHUB_ACTIONS}" ]; then
|
||||
# project branch
|
||||
if [ -n "${GITHUB_REF_NAME}" ]; then
|
||||
SPCD_PROJECT_BRANCH="${GITHUB_REF_NAME}"
|
||||
else
|
||||
spcd_error_ci "GITHUB_REF_NAME"
|
||||
fi
|
||||
# project root
|
||||
if [ -n "${GITHUB_SERVER_URL}" ]; then
|
||||
SPCD_PROJECT_ROOT="$(dirname "${GITHUB_SERVER_URL}")//"
|
||||
|
@ -74,14 +80,14 @@ spcd_set_environment_variables() {
|
|||
else
|
||||
spcd_error_ci "GITHUB_REPOSITORY"
|
||||
fi
|
||||
# project branch
|
||||
if [ -n "${GITHUB_REF_NAME}" ]; then
|
||||
SPCD_PROJECT_BRANCH="${GITHUB_REF_NAME}"
|
||||
else
|
||||
spcd_error_ci "GITHUB_REF_NAME"
|
||||
fi
|
||||
# continuous integration / gitlab
|
||||
elif [ -n "${GITLAB_CI}" ]; then
|
||||
# project branch
|
||||
if [ -n "${CI_COMMIT_BRANCH}" ]; then
|
||||
SPCD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}"
|
||||
else
|
||||
spcd_error_ci "CI_COMMIT_BRANCH"
|
||||
fi
|
||||
# project root / protocol
|
||||
if [ -n "${CI_SERVER_PROTOCOL}" ]; then
|
||||
# project root / login
|
||||
|
@ -117,12 +123,6 @@ spcd_set_environment_variables() {
|
|||
else
|
||||
spcd_error_ci "CI_SERVER_PROTOCOL"
|
||||
fi
|
||||
# project branch
|
||||
if [ -n "${CI_COMMIT_BRANCH}" ]; then
|
||||
SPCD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}"
|
||||
else
|
||||
spcd_error_ci "CI_COMMIT_BRANCH"
|
||||
fi
|
||||
# continuous integration / unsupported
|
||||
else
|
||||
spcd_error_ci "ø"
|
||||
|
|
Loading…
Reference in a new issue