Loading .gitlab-ci.yml +2 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,8 @@ include: - component: "$CI_SERVER_FQDN/to-be-continuous/python/gitlab-ci-python@7.11" inputs: pylint-enabled: true # Bash template - component: "$CI_SERVER_FQDN/to-be-continuous/bash/gitlab-ci-bash@3.9" # your pipeline stages stages: Loading scripts/release.sh +16 −16 Original line number Diff line number Diff line Loading @@ -21,20 +21,20 @@ SHORT_TAG="$CI_COMMIT_SHORT_SHA" BRANCH="$CI_COMMIT_BRANCH" # ✅ Map default branch (main/master) to "latest" if [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ]; then case "$CI_COMMIT_BRANCH" in "$CI_DEFAULT_BRANCH") BRANCH_TAG="latest" # prevent 'Ref is ambiguous' # prevent 'The file has changed since you started editing it' # Match if branch contains dev|test|ci|pre|production elif [[ "$CI_COMMIT_BRANCH" =~ (dev|test|ci|pre|production) ]]; then if [[ "$CI_COMMIT_BRANCH" =~ -ci$ ]]; then BRANCH_TAG="$CI_COMMIT_BRANCH" # already ends with -ci else BRANCH_TAG="${CI_COMMIT_BRANCH}-ci" fi else BRANCH_TAG="${CI_COMMIT_REF_NAME}" fi ;; *dev*|*test*|*ci*|*pre*|*production*) case "$CI_COMMIT_BRANCH" in *-ci) BRANCH_TAG="$CI_COMMIT_BRANCH" ;; *) BRANCH_TAG="${CI_COMMIT_BRANCH}-ci" ;; esac ;; *) BRANCH_TAG="$CI_COMMIT_REF_NAME" ;; esac echo "📦 Publishing Release for $CI_PROJECT_PATH @ $SHORT_TAG ($BRANCH → $BRANCH_TAG)" Loading @@ -42,9 +42,9 @@ echo "📦 Publishing Release for $CI_PROJECT_PATH @ $SHORT_TAG ($BRANCH → $BR mkdir -p release_files echo "🔍 Collecting build artifacts for commit $CI_COMMIT_SHORT_SHA ..." cp *_${CI_COMMIT_SHORT_SHA}_* release_files/ 2>/dev/null || true cp ./*_"${CI_COMMIT_SHORT_SHA}"_* release_files/ 2>/dev/null || true if [ -z "$(ls -A release_files)" ]; then if [ -z "$(ls -A release_files 2>/dev/null)" ]; then echo "❌ No artifacts found matching pattern '*_${CI_COMMIT_SHORT_SHA}_*'" exit 1 fi Loading Loading
.gitlab-ci.yml +2 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,8 @@ include: - component: "$CI_SERVER_FQDN/to-be-continuous/python/gitlab-ci-python@7.11" inputs: pylint-enabled: true # Bash template - component: "$CI_SERVER_FQDN/to-be-continuous/bash/gitlab-ci-bash@3.9" # your pipeline stages stages: Loading
scripts/release.sh +16 −16 Original line number Diff line number Diff line Loading @@ -21,20 +21,20 @@ SHORT_TAG="$CI_COMMIT_SHORT_SHA" BRANCH="$CI_COMMIT_BRANCH" # ✅ Map default branch (main/master) to "latest" if [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ]; then case "$CI_COMMIT_BRANCH" in "$CI_DEFAULT_BRANCH") BRANCH_TAG="latest" # prevent 'Ref is ambiguous' # prevent 'The file has changed since you started editing it' # Match if branch contains dev|test|ci|pre|production elif [[ "$CI_COMMIT_BRANCH" =~ (dev|test|ci|pre|production) ]]; then if [[ "$CI_COMMIT_BRANCH" =~ -ci$ ]]; then BRANCH_TAG="$CI_COMMIT_BRANCH" # already ends with -ci else BRANCH_TAG="${CI_COMMIT_BRANCH}-ci" fi else BRANCH_TAG="${CI_COMMIT_REF_NAME}" fi ;; *dev*|*test*|*ci*|*pre*|*production*) case "$CI_COMMIT_BRANCH" in *-ci) BRANCH_TAG="$CI_COMMIT_BRANCH" ;; *) BRANCH_TAG="${CI_COMMIT_BRANCH}-ci" ;; esac ;; *) BRANCH_TAG="$CI_COMMIT_REF_NAME" ;; esac echo "📦 Publishing Release for $CI_PROJECT_PATH @ $SHORT_TAG ($BRANCH → $BRANCH_TAG)" Loading @@ -42,9 +42,9 @@ echo "📦 Publishing Release for $CI_PROJECT_PATH @ $SHORT_TAG ($BRANCH → $BR mkdir -p release_files echo "🔍 Collecting build artifacts for commit $CI_COMMIT_SHORT_SHA ..." cp *_${CI_COMMIT_SHORT_SHA}_* release_files/ 2>/dev/null || true cp ./*_"${CI_COMMIT_SHORT_SHA}"_* release_files/ 2>/dev/null || true if [ -z "$(ls -A release_files)" ]; then if [ -z "$(ls -A release_files 2>/dev/null)" ]; then echo "❌ No artifacts found matching pattern '*_${CI_COMMIT_SHORT_SHA}_*'" exit 1 fi Loading