Commit fcd63c91 authored by Watchtek's avatar Watchtek
Browse files

Update 2 files

- /scripts/release.sh
- /.gitlab-ci.yml
parent 9c7a1d42
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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:
+16 −16
Original line number Diff line number Diff line
@@ -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)"

@@ -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