From c8cfefd321be8fe210a65007511dd393c39da04a Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Tue, 14 Oct 2025 23:28:20 +0530 Subject: [PATCH 1/6] bump version to 12.0.1+murena-20251014 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index d54d53e4..dbe613c5 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -10,7 +10,7 @@ - 12.0.1 + 12.0.1+murena-20251014 agpl Murena SAS EcloudAccounts -- GitLab From 4a24a4d007ca5c1caab7a56554a02229be38a6bb Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Tue, 14 Oct 2025 23:40:47 +0530 Subject: [PATCH 2/6] bump version to 12.0.1+murena-20251014 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index dbe613c5..0667b9fc 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -10,7 +10,7 @@ - 12.0.1+murena-20251014 + v12.0.1 agpl Murena SAS EcloudAccounts -- GitLab From 017cfcfb13f5381d807c35734df43c8a01217bba Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Wed, 15 Oct 2025 16:47:45 +0530 Subject: [PATCH 3/6] ci: add GitLab pipeline to build and publish artifacts --- .gitlab-ci.yml | 111 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 08326169..0499fdc0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,114 @@ +stages: + - build + - publish + +default: + interruptible: true + before_script: + - 'echo "Running on $(uname -a)"' + +.rules_default: &rules_default + rules: + - if: '$CI_COMMIT_TAG' + - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + - when: manual + allow_failure: true + +.extract_version: &extract_version + - | + set -euo pipefail + echo "Deriving package version from appinfo/info.xml ..." + RAW_VERSION=$(xmllint --xpath 'string(/info/version)' appinfo/info.xml 2>/dev/null || true) + if [ -z "${RAW_VERSION:-}" ]; then + RAW_VERSION=$(grep -oP '\K[^<]+' appinfo/info.xml | head -n1 || true) + fi + if [ -z "${RAW_VERSION:-}" ]; then + echo "Could not extract version from appinfo/info.xml" >&2 + exit 1 + fi + RAW_VERSION=${RAW_VERSION#v} + if [ -n "${CI_COMMIT_TAG:-}" ]; then + PACKAGE_VERSION="${CI_COMMIT_TAG#v}" + else + # Append short SHA to make version unique for non-tag builds + PACKAGE_VERSION="${RAW_VERSION}-${CI_COMMIT_SHORT_SHA}" + fi + echo "PACKAGE_VERSION=${PACKAGE_VERSION}" | tee -a version.env + +variables: + NODE_ENV: production + npm_config_ci: 'true' + +cache: + paths: + - .npm/ + - vendor/cache/ + +build:vendor: + stage: build + image: composer:2 + needs: [] + <<: *rules_default + before_script: + - composer --version + - php -v + script: + - *extract_version + - composer install --no-dev --prefer-dist --no-progress --optimize-autoloader --classmap-authoritative + - tar -czf vendor.tar.gz vendor + artifacts: + name: "vendor-$CI_COMMIT_REF_SLUG" + paths: + - vendor.tar.gz + - version.env + expire_in: 7 days + +build:frontend: + stage: build + image: node:16-bullseye + needs: [] + <<: *rules_default + before_script: + - node -v + - npm -v + script: + - *extract_version + - npm ci --cache .npm --prefer-offline + - npm run build + - tar -czf assets.tar.gz js css + artifacts: + name: "assets-$CI_COMMIT_REF_SLUG" + paths: + - assets.tar.gz + - version.env + expire_in: 7 days + +publish:generic-registry: + stage: publish + image: curlimages/curl:8.10.1 + needs: + - job: build:vendor + artifacts: true + - job: build:frontend + artifacts: true + <<: *rules_default + script: + - | + set -euo pipefail + source version.env + echo "Publishing vendor and assets to Generic Package Registry (version: $PACKAGE_VERSION)" + BASE_URL="$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic" + VENDOR_PKG_NAME="ecloud-accounts-vendor" + ASSETS_PKG_NAME="ecloud-accounts-assets" + echo "Uploading vendor.tar.gz ..." + curl --fail --show-error --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file vendor.tar.gz "$BASE_URL/$VENDOR_PKG_NAME/$PACKAGE_VERSION/vendor.tar.gz" + echo "Uploading assets.tar.gz ..." + curl --fail --show-error --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file assets.tar.gz "$BASE_URL/$ASSETS_PKG_NAME/$PACKAGE_VERSION/assets.tar.gz" + artifacts: + when: always + reports: + dotenv: version.env + stages: - test - build -- GitLab From a8b3d8647c1e858a3e9b9ae4d7a85b0154eb71d4 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Wed, 15 Oct 2025 16:57:41 +0530 Subject: [PATCH 4/6] ci: align stages with shared templates; run publish in deploy stage --- .gitlab-ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0499fdc0..e9be421b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,3 @@ -stages: - - build - - publish - default: interruptible: true before_script: @@ -84,7 +80,7 @@ build:frontend: expire_in: 7 days publish:generic-registry: - stage: publish + stage: deploy image: curlimages/curl:8.10.1 needs: - job: build:vendor -- GitLab From d96a1334bd40d985272f089047baa597900318e6 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Wed, 15 Oct 2025 17:02:25 +0530 Subject: [PATCH 5/6] ci: run publish on all branches (rules widened) --- .gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9be421b..b47ad540 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,9 +6,7 @@ default: .rules_default: &rules_default rules: - if: '$CI_COMMIT_TAG' - - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - - when: manual - allow_failure: true + - if: '$CI_COMMIT_BRANCH' .extract_version: &extract_version - | -- GitLab From 10b97067a971f5e066600f4771d81aab44585ed0 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Wed, 15 Oct 2025 17:05:05 +0530 Subject: [PATCH 6/6] ci: fix version extraction for BusyBox shell; use PHP fallback --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b47ad540..cfdd1187 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ default: echo "Deriving package version from appinfo/info.xml ..." RAW_VERSION=$(xmllint --xpath 'string(/info/version)' appinfo/info.xml 2>/dev/null || true) if [ -z "${RAW_VERSION:-}" ]; then - RAW_VERSION=$(grep -oP '\K[^<]+' appinfo/info.xml | head -n1 || true) + RAW_VERSION=$(php -r '$x=@simplexml_load_file("appinfo/info.xml"); if(!$x||empty($x->version)){exit(1);} echo $x->version, PHP_EOL;' 2>/dev/null || true) fi if [ -z "${RAW_VERSION:-}" ]; then echo "Could not extract version from appinfo/info.xml" >&2 -- GitLab