From 60f1a717c594bc7c3165be00ae4676c2f62a496b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 20 Jul 2024 16:51:14 +0200 Subject: [PATCH] ci comments --- spcd.sh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/spcd.sh b/spcd.sh index c039494..b5ed78b 100644 --- a/spcd.sh +++ b/spcd.sh @@ -54,9 +54,9 @@ spcd_list_environment_variables() { spcd_set_environment_variables() { spcd_step "Set environment variables" - # continuous integration platform + # continuous integration / github → gitea → forgejo if [ -n "${GITHUB_ACTIONS}" ]; then - # github → gitea → forgejo + # project root if [ -n "${GITHUB_SERVER_URL}" ]; then SPCD_PROJECT_ROOT="$(dirname "${GITHUB_SERVER_URL}")//" [ -n "${GITHUB_TOKEN}" ] && @@ -65,27 +65,38 @@ spcd_set_environment_variables() { else spcd_error_ci "GITHUB_SERVER_URL" fi + # project path & name if [ -n "${GITHUB_REPOSITORY}" ]; then + # project path SPCD_PROJECT_PATH="$(dirname "${GITHUB_REPOSITORY}")" + # project name SPCD_PROJECT_NAME="$(basename "${GITHUB_REPOSITORY}")" 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 - # gitlab + # project root / protocol if [ -n "${CI_SERVER_PROTOCOL}" ]; then + # project root / login if [ -n "${CI_REGISTRY_USER}" ]; then + # project root / password if [ -n "${CI_REGISTRY_PASSWORD}" ]; then + # project root / host if [ -n "${CI_SERVER_FQDN}" ]; then + # project root SPCD_PROJECT_ROOT="${CI_SERVER_PROTOCOL}\ ://${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD}@${CI_SERVER_FQDN}" + # project path if [ -n "${CI_PROJECT_NAMESPACE}" ]; then SPCD_PROJECT_PATH="${CI_PROJECT_NAMESPACE}" + # project name if [ -n "${CI_PROJECT_NAME}" ]; then SPCD_PROJECT_NAME="${CI_PROJECT_NAME}" else @@ -106,15 +117,17 @@ 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 - # unsupported spcd_error_ci "ø" fi + # [ -n "${SPCD_PROJECT_ROOT}" ] || spcd_error_ci "SPCD_PROJECT_ROOT" [ -n "${SPCD_PROJECT_PATH}" ] || spcd_error_ci "SPCD_PROJECT_PATH" [ -n "${SPCD_PROJECT_NAME}" ] || spcd_error_ci "SPCD_PROJECT_NAME"