From 5298190779d0176c7def8f6d2fcb03c3b97b0a1e Mon Sep 17 00:00:00 2001 From: YvesCesar Date: Sat, 14 Nov 2026 09:57:15 -0400 Subject: [PATCH 1/4] fix: pin every component cloned at runtime to a commit Signed-off-by: YvesCesar --- Makefile | 22 ++++++++++++---------- README.md | 11 ++++++++--- docker-compose.override.yml | 13 ++++++++++++- tests/E2E/support/nextcloud-setup.sh | 11 +++++++---- 4 files changed, 39 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 21273ce..b9601a6 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,9 @@ NEXTCLOUD_DIR := $(ROOT_DIR)/nextcloud-development WORDPRESS_DIR := $(ROOT_DIR)/wordpress-docker SITE_DIR := $(ROOT_DIR)/site SITE_REPO_URL ?= https://github.com/LibreSign/site.git -SITE_REPO_BRANCH ?= main +SITE_REPO_REF ?= e57d6ad84d478612913f9112a381db5940ffb8b6 +ADMIN_GROUP_MANAGER_REF ?= ae7e1f9b67071b3d4bdae9f9865099ed0368f812 +WORDPRESS_LOGIN_BACKEND_REF ?= 6837f710416f96c62176d7d2873fe28f9762189e SITE_HTTP_PORT ?= 8081 SITE_BROWSERSYNC_PORT ?= 3000 SITE_SERVER_MODE ?= build @@ -62,6 +64,9 @@ _help: @echo " SITE_HTTP_PORT - Static site port (default: 8081)" @echo " SITE_BROWSERSYNC_PORT - Static site HMR port (default: 3000)" @echo " SITE_SERVER_MODE - Static site container mode for make up (default: build)" + @echo " SITE_REPO_REF - Commit of the static site checked out by make up" + @echo " ADMIN_GROUP_MANAGER_REF - Commit of admin_group_manager checked out by make up" + @echo " WORDPRESS_LOGIN_BACKEND_REF - Commit of wordpress_login_backend checked out by make up" @echo " NEXTCLOUD_HTTP_PORT - Nextcloud port (default: 8082)" @echo " NEXTCLOUD_ADMIN_USER - Nextcloud admin username (default: admin)" @echo " NEXTCLOUD_ADMIN_PASSWORD - Nextcloud admin password (default: admin)" @@ -124,9 +129,8 @@ _ensure-site-repo: git clone "$(SITE_REPO_URL)" "$(SITE_DIR)"; \ fi @git -C "$(SITE_DIR)" remote set-url origin "$(SITE_REPO_URL)" - @git -C "$(SITE_DIR)" fetch origin "$(SITE_REPO_BRANCH)" - @git -C "$(SITE_DIR)" checkout "$(SITE_REPO_BRANCH)" - @git -C "$(SITE_DIR)" pull --ff-only origin "$(SITE_REPO_BRANCH)" + @git -C "$(SITE_DIR)" fetch origin + @git -C "$(SITE_DIR)" checkout -q "$(SITE_REPO_REF)" _prepare-site-output-dir: @echo "Preparing site output directory..." @@ -245,18 +249,16 @@ _ensure-wordpress-app: @if [ ! -d "$(NEXTCLOUD_APPS_DIR)/wordpress_login_backend/.git" ]; then \ git clone https://github.com/LibreSign/wordpress_login_backend.git $(NEXTCLOUD_APPS_DIR)/wordpress_login_backend; \ fi - @git -C $(NEXTCLOUD_APPS_DIR)/wordpress_login_backend fetch origin main - @git -C $(NEXTCLOUD_APPS_DIR)/wordpress_login_backend checkout main - @git -C $(NEXTCLOUD_APPS_DIR)/wordpress_login_backend pull --ff-only origin main + @git -C $(NEXTCLOUD_APPS_DIR)/wordpress_login_backend fetch origin + @git -C $(NEXTCLOUD_APPS_DIR)/wordpress_login_backend checkout -q $(WORDPRESS_LOGIN_BACKEND_REF) _ensure-nextcloud-app: @echo "Setting up admin_group_manager app..." @if [ ! -d "$(NEXTCLOUD_APPS_DIR)/admin_group_manager/.git" ]; then \ git clone https://github.com/LibreSign/admin_group_manager.git $(NEXTCLOUD_APPS_DIR)/admin_group_manager; \ fi - @git -C $(NEXTCLOUD_APPS_DIR)/admin_group_manager fetch origin main - @git -C $(NEXTCLOUD_APPS_DIR)/admin_group_manager checkout main - @git -C $(NEXTCLOUD_APPS_DIR)/admin_group_manager pull --ff-only origin main + @git -C $(NEXTCLOUD_APPS_DIR)/admin_group_manager fetch origin + @git -C $(NEXTCLOUD_APPS_DIR)/admin_group_manager checkout -q $(ADMIN_GROUP_MANAGER_REF) _enable-apps: @echo "Enabling apps..." diff --git a/README.md b/README.md index db9716b..28362ba 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ git submodule update --init The static site (`site/`) is a regular cloned repository managed by `make up`. On the first run, the Makefile clones `https://github.com/LibreSign/site.git` -automatically and checks out `main`. +automatically and checks out the commit set in `SITE_REPO_REF`. Then start the stack: @@ -82,8 +82,13 @@ layout: `make up` refreshes the remote Docker images used by the WordPress, static site, and Nextcloud services and rebuilds local buildable services before starting the stack. During `make up site`, the `site/` clone is also synced from -`https://github.com/LibreSign/site.git` (`main`) automatically, so no manual -site update step is required. +`https://github.com/LibreSign/site.git` and checked out at `SITE_REPO_REF` +automatically, so no manual site update step is required. + +Every component cloned at runtime is pinned to a commit: the Nextcloud apps and +the static site through the `*_REF` variables of the `Makefile`, and the +WordPress plugins and theme through the `post_install_commands` in +`docker-compose.override.yml`. Bump these commits to update a component. On a fresh WordPress database, `make up` also performs the initial WordPress installation via WP-CLI and restarts the WordPress container once so the diff --git a/docker-compose.override.yml b/docker-compose.override.yml index de40397..7cdb2c3 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -29,12 +29,18 @@ services: - slug: polylang-pro source: https://gitlab.com/wordpress-premium/polylang-pro post_install_commands: + - git -C "$$PLUGIN_DIR" fetch -q origin 851df56e647a4c19450d69ddff9c77aa67963a0d && git -C "$$PLUGIN_DIR" checkout -q 851df56e647a4c19450d69ddff9c77aa67963a0d - if [ ! -L "$$PLUGIN_DIR/integrations/ACF" ]; then rm -rf "$$PLUGIN_DIR/integrations/ACF" && ln -s acf "$$PLUGIN_DIR/integrations/ACF"; fi || true - slug: libresign-wp-customizations source: https://github.com/LibreSign/libresign-wp-customizations.git + post_install_commands: + - git -C "$$PLUGIN_DIR" fetch -q origin 32f3cdc85f51d5e35c4f7bda69dc27a2f98d751d && git -C "$$PLUGIN_DIR" checkout -q 32f3cdc85f51d5e35c4f7bda69dc27a2f98d751d + - if [ ! -d wp-content/themes/libresign ]; then git clone -q https://github.com/LibreSign/wordpress-theme.git wp-content/themes/libresign; fi + - git -C "wp-content/themes/libresign" fetch -q origin ed096e48496d321a3b5f52555470e105e8982978 && git -C "wp-content/themes/libresign" checkout -q ed096e48496d321a3b5f52555470e105e8982978 - slug: wp-simple-smtp source: https://github.com/LibreCodeCoop/wp-simple-smtp.git post_install_commands: + - git -C "$$PLUGIN_DIR" fetch -q origin a1fc2e92feed9a80ed054be398441c045cad99d9 && git -C "$$PLUGIN_DIR" checkout -q a1fc2e92feed9a80ed054be398441c045cad99d9 - wp option update smtp_xmailer LibreSign - wp option update smtp_hostname localhost - wp option update smtp_host mailpit @@ -48,13 +54,18 @@ services: - slug: woocommerce-nextcloud-admin-group-manager source: https://github.com/LibreSign/woocommerce-nextcloud-admin-group-manager.git post_install_commands: + - git -C "$$PLUGIN_DIR" fetch -q origin afb65367067fb2e3c3fb08cc052ad59e4a1f34c9 && git -C "$$PLUGIN_DIR" checkout -q afb65367067fb2e3c3fb08cc052ad59e4a1f34c9 - wp option update nextcloud_api_host $$NEXTCLOUD_LOCAL_URL - wp option update nextcloud_api_login ${NEXTCLOUD_ADMIN_USER:-admin} - wp option update nextcloud_api_password ${NEXTCLOUD_ADMIN_PASSWORD:-admin} - slug: woocommerce-restrict-switch source: https://github.com/LibreSign/woocommerce-restrict-switch.git + post_install_commands: + - git -C "$$PLUGIN_DIR" fetch -q origin d412c7df1674a373720237b1ffa41479515d09c3 && git -C "$$PLUGIN_DIR" checkout -q d412c7df1674a373720237b1ffa41479515d09c3 - slug: woocommerce-subscriptions source: https://github.com/pronamic/woocommerce-subscriptions.git + post_install_commands: + - git -C "$$PLUGIN_DIR" fetch -q origin 2459d9c8662884d62b9a92221eb21c7c6c051a62 && git -C "$$PLUGIN_DIR" checkout -q 2459d9c8662884d62b9a92221eb21c7c6c051a62 wordpress_custom_themes: - slug: libresign source: https://github.com/LibreSign/wordpress-theme.git @@ -71,6 +82,6 @@ services: service: mariadb mailpit: - image: axllent/mailpit:latest + image: axllent/mailpit:v1.31.2 ports: - "127.0.0.1:8025:8025" diff --git a/tests/E2E/support/nextcloud-setup.sh b/tests/E2E/support/nextcloud-setup.sh index 41aecee..c420e7d 100755 --- a/tests/E2E/support/nextcloud-setup.sh +++ b/tests/E2E/support/nextcloud-setup.sh @@ -1,10 +1,13 @@ #!/bin/sh set -e -for app in admin_group_manager wordpress_login_backend; do - mkdir -p "custom_apps/$app" - curl -fsSL "https://github.com/LibreSign/$app/archive/refs/heads/main.tar.gz" | tar -xz --strip-components=1 -C "custom_apps/$app" -done +download_app() { + mkdir -p "custom_apps/$1" + curl -fsSL "https://github.com/LibreSign/$1/archive/$2.tar.gz" | tar -xz --strip-components=1 -C "custom_apps/$1" +} + +download_app admin_group_manager ae7e1f9b67071b3d4bdae9f9865099ed0368f812 +download_app wordpress_login_backend 6837f710416f96c62176d7d2873fe28f9762189e php occ app:install groupquota --force --keep-disabled php occ app:enable wordpress_login_backend From 4d0650a02f5088853492cffb87b0f6763242bce7 Mon Sep 17 00:00:00 2001 From: YvesCesar Date: Sat, 14 Nov 2026 10:28:18 -0400 Subject: [PATCH 2/4] fix: prorate subscription upgrades in the local and e2e stores Signed-off-by: YvesCesar --- docker-compose.override.yml | 1 + tests/E2E/PlanChange.spec.ts | 6 ++++-- tests/E2E/support/seed.php | 1 - tests/E2E/support/wordpress.ts | 4 ++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 7cdb2c3..990d1b9 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -66,6 +66,7 @@ services: source: https://github.com/pronamic/woocommerce-subscriptions.git post_install_commands: - git -C "$$PLUGIN_DIR" fetch -q origin 2459d9c8662884d62b9a92221eb21c7c6c051a62 && git -C "$$PLUGIN_DIR" checkout -q 2459d9c8662884d62b9a92221eb21c7c6c051a62 + - wp option update woocommerce_subscriptions_apportion_recurring_price yes-upgrade wordpress_custom_themes: - slug: libresign source: https://github.com/LibreSign/wordpress-theme.git diff --git a/tests/E2E/PlanChange.spec.ts b/tests/E2E/PlanChange.spec.ts index 8e40bb8..2cae28a 100644 --- a/tests/E2E/PlanChange.spec.ts +++ b/tests/E2E/PlanChange.spec.ts @@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test'; import { nextcloud } from './support/nextcloud'; import { agreeToTheTerms, aSubscriber, logInToTheStore, placeTheOrder, plansInTheStore, STORE_URL } from './support/store'; -import { subscriptionStatus } from './support/wordpress'; +import { orderTotal, subscriptionStatus } from './support/wordpress'; const GIGABYTE = 1024 ** 3; @@ -23,7 +23,7 @@ test.describe( 'Changing plan', () => { await expect( page.getByRole( 'link', { name: 'Professional', exact: true } ) ).toHaveCount( 0 ); } ); - test( 'upgrading from Basic to Enterprise raises the workspace storage to 800 GB', async ( { browser, page } ) => { + test( 'upgrading from Basic to Enterprise charges the prorated difference and raises the workspace storage to 800 GB', async ( { browser, page } ) => { const { customer, subscriptionId } = await aSubscriber( page, 'Nilo' ); await logInToTheStore( page, customer.email, customer.password ); @@ -37,6 +37,8 @@ test.describe( 'Changing plan', () => { await page.getByRole( 'button', { name: 'Switch subscription' } ).click(); await expect( page ).toHaveURL( /\/checkout\/order-received\/\d+\//, { timeout: 90_000 } ); + const switchOrderId = Number( page.url().match( /order-received\/(\d+)\// )![ 1 ] ); + expect( orderTotal( switchOrderId ) ).toBeGreaterThan( 0 ); expect( subscriptionStatus( subscriptionId ) ).toBe( 'active' ); expect( await nextcloud.account( customer.email ) ).toMatchObject( { enabled: true, quota: { quota: 800 * GIGABYTE } } ); await nextcloud.expectToLogIn( browser, customer.email, customer.password ); diff --git a/tests/E2E/support/seed.php b/tests/E2E/support/seed.php index 9098382..304fa94 100644 --- a/tests/E2E/support/seed.php +++ b/tests/E2E/support/seed.php @@ -28,7 +28,6 @@ 'woocommerce_email_from_name' => 'LibreSign', 'woocommerce_email_from_address' => 'noreply@example.com', 'woocommerce_subscriptions_allow_switching' => 'grouped', - 'woocommerce_subscriptions_apportion_recurring_price' => 'no', 'woocommerce_subscriptions_enable_early_renewal' => 'yes', 'woocommerce_subscriptions_enable_retry' => 'no', 'woocommerce_subscriptions_multiple_purchase' => 'yes', diff --git a/tests/E2E/support/wordpress.ts b/tests/E2E/support/wordpress.ts index aeb54fa..6528081 100644 --- a/tests/E2E/support/wordpress.ts +++ b/tests/E2E/support/wordpress.ts @@ -27,6 +27,10 @@ export function orderStatus( orderId: number ): string { return wpEval( `echo wc_get_order( ${ orderId } )->get_status();` ); } +export function orderTotal( orderId: number ): number { + return Number( wpEval( `echo wc_get_order( ${ orderId } )->get_total();` ) ); +} + export function runTheScheduledNextcloudSyncRetry( orderId: number ): void { wpEval( ` if ( ! as_next_scheduled_action( 'agm_retry_nextcloud_sync', array( 'order_id' => ${ orderId } ), 'nextcloud-admin-group-manager' ) ) { From 63ecbd7827d807c022e1dc339fd8215284074225 Mon Sep 17 00:00:00 2001 From: YvesCesar Date: Mon, 16 Nov 2026 11:43:56 -0400 Subject: [PATCH 3/4] chore: bump the pinned components to the commits with the security fixes Signed-off-by: YvesCesar --- Makefile | 6 +++--- docker-compose.saas.yml | 10 +++++----- tests/E2E/support/nextcloud-setup.sh | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index eab408e..b9c125b 100644 --- a/Makefile +++ b/Makefile @@ -11,9 +11,9 @@ SITE_DIR := $(ROOT_DIR)/site SITE_NPM_CACHE_DIR ?= $(ROOT_DIR)/.cache/site-npm SITE_COMPOSER_HOME_DIR ?= $(ROOT_DIR)/.cache/site-composer SITE_REPO_URL ?= https://github.com/LibreSign/site.git -SITE_REPO_REF ?= e57d6ad84d478612913f9112a381db5940ffb8b6 -ADMIN_GROUP_MANAGER_REF ?= ae7e1f9b67071b3d4bdae9f9865099ed0368f812 -WORDPRESS_LOGIN_BACKEND_REF ?= 6837f710416f96c62176d7d2873fe28f9762189e +SITE_REPO_REF ?= c1b338ed9ef581c8166073d332b7a028dfdcd6fa +ADMIN_GROUP_MANAGER_REF ?= 826b04a5364a03495da8bdfed8416eca1284a21b +WORDPRESS_LOGIN_BACKEND_REF ?= eab143d586b2331329d406ef4460734499fb66c4 SITE_HTTP_PORT ?= 8081 SITE_BROWSERSYNC_PORT ?= 3000 SITE_SERVER_MODE ?= build diff --git a/docker-compose.saas.yml b/docker-compose.saas.yml index 5ab6e70..510f54e 100644 --- a/docker-compose.saas.yml +++ b/docker-compose.saas.yml @@ -34,13 +34,13 @@ services: - slug: libresign-wp-customizations source: https://github.com/LibreSign/libresign-wp-customizations.git post_install_commands: - - git -C "$$PLUGIN_DIR" fetch -q origin 32f3cdc85f51d5e35c4f7bda69dc27a2f98d751d && git -C "$$PLUGIN_DIR" checkout -q 32f3cdc85f51d5e35c4f7bda69dc27a2f98d751d + - git -C "$$PLUGIN_DIR" fetch -q origin f2bf08e53013e46ca586ab53d90fc7eec9267600 && git -C "$$PLUGIN_DIR" checkout -q f2bf08e53013e46ca586ab53d90fc7eec9267600 - if [ ! -d wp-content/themes/libresign ]; then git clone -q https://github.com/LibreSign/wordpress-theme.git wp-content/themes/libresign; fi - - git -C "wp-content/themes/libresign" fetch -q origin ed096e48496d321a3b5f52555470e105e8982978 && git -C "wp-content/themes/libresign" checkout -q ed096e48496d321a3b5f52555470e105e8982978 + - git -C "wp-content/themes/libresign" fetch -q origin 387d02d5622fa6fc90a3c2713ef0d6cd7d0ed846 && git -C "wp-content/themes/libresign" checkout -q 387d02d5622fa6fc90a3c2713ef0d6cd7d0ed846 - slug: wp-simple-smtp source: https://github.com/LibreCodeCoop/wp-simple-smtp.git post_install_commands: - - git -C "$$PLUGIN_DIR" fetch -q origin a1fc2e92feed9a80ed054be398441c045cad99d9 && git -C "$$PLUGIN_DIR" checkout -q a1fc2e92feed9a80ed054be398441c045cad99d9 + - git -C "$$PLUGIN_DIR" fetch -q origin 24729b5a34d8c67584b2c2608285d499866b2b25 && git -C "$$PLUGIN_DIR" checkout -q 24729b5a34d8c67584b2c2608285d499866b2b25 - wp option update smtp_xmailer LibreSign - wp option update smtp_hostname localhost - wp option update smtp_host mailpit @@ -54,13 +54,13 @@ services: - slug: woocommerce-nextcloud-admin-group-manager source: https://github.com/LibreSign/woocommerce-nextcloud-admin-group-manager.git post_install_commands: - - git -C "$$PLUGIN_DIR" fetch -q origin afb65367067fb2e3c3fb08cc052ad59e4a1f34c9 && git -C "$$PLUGIN_DIR" checkout -q afb65367067fb2e3c3fb08cc052ad59e4a1f34c9 + - git -C "$$PLUGIN_DIR" fetch -q origin 4f4eb83b61bb423a2b730a552a604a33ab3c344d && git -C "$$PLUGIN_DIR" checkout -q 4f4eb83b61bb423a2b730a552a604a33ab3c344d - wp option update nextcloud_api_login ${NEXTCLOUD_ADMIN_USER:-admin} - wp option update nextcloud_api_password ${NEXTCLOUD_ADMIN_PASSWORD:-admin} - slug: woocommerce-restrict-switch source: https://github.com/LibreSign/woocommerce-restrict-switch.git post_install_commands: - - git -C "$$PLUGIN_DIR" fetch -q origin d412c7df1674a373720237b1ffa41479515d09c3 && git -C "$$PLUGIN_DIR" checkout -q d412c7df1674a373720237b1ffa41479515d09c3 + - git -C "$$PLUGIN_DIR" fetch -q origin c524fbf18447b61abdd93d9f5ffd379169242bb1 && git -C "$$PLUGIN_DIR" checkout -q c524fbf18447b61abdd93d9f5ffd379169242bb1 - slug: woocommerce-subscriptions source: https://github.com/pronamic/woocommerce-subscriptions.git post_install_commands: diff --git a/tests/E2E/support/nextcloud-setup.sh b/tests/E2E/support/nextcloud-setup.sh index 28fcd2d..706d32d 100755 --- a/tests/E2E/support/nextcloud-setup.sh +++ b/tests/E2E/support/nextcloud-setup.sh @@ -6,8 +6,8 @@ download_app() { curl -fsSL "https://github.com/LibreSign/$1/archive/$2.tar.gz" | tar -xz --strip-components=1 -C "custom_apps/$1" } -download_app admin_group_manager ae7e1f9b67071b3d4bdae9f9865099ed0368f812 -download_app wordpress_login_backend 6837f710416f96c62176d7d2873fe28f9762189e +download_app admin_group_manager 826b04a5364a03495da8bdfed8416eca1284a21b +download_app wordpress_login_backend eab143d586b2331329d406ef4460734499fb66c4 php occ app:install groupquota --force --keep-disabled php occ app:enable wordpress_login_backend From d2e295a18d260bac9173b09cf696d5fb7f8044bd Mon Sep 17 00:00:00 2001 From: YvesCesar Date: Mon, 16 Nov 2026 12:00:31 -0400 Subject: [PATCH 4/4] chore: let renovate bump the commits the cloned components are pinned to Signed-off-by: YvesCesar --- .github/renovate.json5 | 59 +++++++++++++++++++++++++++++++++++++++++ README.md | 7 ++++- docker-compose.saas.yml | 14 +++++----- 3 files changed, 72 insertions(+), 8 deletions(-) create mode 100644 .github/renovate.json5 diff --git a/.github/renovate.json5 b/.github/renovate.json5 new file mode 100644 index 0000000..54058eb --- /dev/null +++ b/.github/renovate.json5 @@ -0,0 +1,59 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "enabledManagers": ["custom.regex"], + "timezone": "America/Sao_Paulo", + "customManagers": [ + { + "customType": "regex", + "managerFilePatterns": ["/^Makefile$/"], + "matchStrings": ["SITE_REPO_REF \\?= (?[0-9a-f]{40})"], + "datasourceTemplate": "git-refs", + "depNameTemplate": "site", + "packageNameTemplate": "https://github.com/LibreSign/site.git", + "currentValueTemplate": "main" + }, + { + "customType": "regex", + "managerFilePatterns": ["/^Makefile$/"], + "matchStrings": ["ADMIN_GROUP_MANAGER_REF \\?= (?[0-9a-f]{40})"], + "datasourceTemplate": "git-refs", + "depNameTemplate": "admin_group_manager", + "packageNameTemplate": "https://github.com/LibreSign/admin_group_manager.git", + "currentValueTemplate": "main" + }, + { + "customType": "regex", + "managerFilePatterns": ["/^Makefile$/"], + "matchStrings": ["WORDPRESS_LOGIN_BACKEND_REF \\?= (?[0-9a-f]{40})"], + "datasourceTemplate": "git-refs", + "depNameTemplate": "wordpress_login_backend", + "packageNameTemplate": "https://github.com/LibreSign/wordpress_login_backend.git", + "currentValueTemplate": "main" + }, + { + "customType": "regex", + "managerFilePatterns": ["/^tests\\/E2E\\/support\\/nextcloud-setup\\.sh$/"], + "matchStrings": ["download_app (?[a-z_]+) (?[0-9a-f]{40})"], + "datasourceTemplate": "git-refs", + "packageNameTemplate": "https://github.com/LibreSign/{{{depName}}}.git", + "currentValueTemplate": "main" + }, + { + "customType": "regex", + "managerFilePatterns": ["/^docker-compose\\.saas\\.yml$/"], + "matchStrings": [ + "- slug: (?\\S+)\\n\\s+source: (?\\S+)\\n\\s+post_install_commands:\\n\\s+- git -C \"\\$\\$PLUGIN_DIR\" fetch -q origin (?[0-9a-f]{40})", + "git clone -q (?\\S+) wp-content/themes/(?[a-z-]+); fi\\n\\s+- git -C \"wp-content/themes/[a-z-]+\" fetch -q origin (?[0-9a-f]{40})" + ], + "datasourceTemplate": "git-refs", + "currentValueTemplate": "{{#if (containsString packageName 'gitlab.com/wordpress-premium/')}}master{{else}}main{{/if}}" + } + ], + "packageRules": [ + { + "matchDatasources": ["git-refs"], + "groupName": "pinned components", + "schedule": ["* * * * 1"] + } + ] +} diff --git a/README.md b/README.md index b213c05..f4cfe6c 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,12 @@ automatically, so no manual site update step is required. Every component cloned at runtime is pinned to a commit: the Nextcloud apps and the static site through the `*_REF` variables of the `Makefile`, and the WordPress plugins and theme through the `post_install_commands` in -`docker-compose.saas.yml`. Bump these commits to update a component. +`docker-compose.saas.yml`. The end-to-end suite downloads the same Nextcloud app +commits in `tests/E2E/support/nextcloud-setup.sh`. + +Renovate (`.github/renovate.json5`) follows the branch each component is +released from and, on Mondays, opens a single pull request that bumps every +commit that moved, so the CI runs the new versions before they reach the stack. On a fresh WordPress database, `make up` also performs the initial WordPress installation via WP-CLI and restarts the WordPress container once so the diff --git a/docker-compose.saas.yml b/docker-compose.saas.yml index 510f54e..7e1d0a0 100644 --- a/docker-compose.saas.yml +++ b/docker-compose.saas.yml @@ -29,18 +29,18 @@ services: - slug: polylang-pro source: https://gitlab.com/wordpress-premium/polylang-pro post_install_commands: - - git -C "$$PLUGIN_DIR" fetch -q origin 851df56e647a4c19450d69ddff9c77aa67963a0d && git -C "$$PLUGIN_DIR" checkout -q 851df56e647a4c19450d69ddff9c77aa67963a0d + - git -C "$$PLUGIN_DIR" fetch -q origin 851df56e647a4c19450d69ddff9c77aa67963a0d && git -C "$$PLUGIN_DIR" checkout -q FETCH_HEAD - if [ ! -L "$$PLUGIN_DIR/integrations/ACF" ]; then rm -rf "$$PLUGIN_DIR/integrations/ACF" && ln -s acf "$$PLUGIN_DIR/integrations/ACF"; fi || true - slug: libresign-wp-customizations source: https://github.com/LibreSign/libresign-wp-customizations.git post_install_commands: - - git -C "$$PLUGIN_DIR" fetch -q origin f2bf08e53013e46ca586ab53d90fc7eec9267600 && git -C "$$PLUGIN_DIR" checkout -q f2bf08e53013e46ca586ab53d90fc7eec9267600 + - git -C "$$PLUGIN_DIR" fetch -q origin f2bf08e53013e46ca586ab53d90fc7eec9267600 && git -C "$$PLUGIN_DIR" checkout -q FETCH_HEAD - if [ ! -d wp-content/themes/libresign ]; then git clone -q https://github.com/LibreSign/wordpress-theme.git wp-content/themes/libresign; fi - - git -C "wp-content/themes/libresign" fetch -q origin 387d02d5622fa6fc90a3c2713ef0d6cd7d0ed846 && git -C "wp-content/themes/libresign" checkout -q 387d02d5622fa6fc90a3c2713ef0d6cd7d0ed846 + - git -C "wp-content/themes/libresign" fetch -q origin 387d02d5622fa6fc90a3c2713ef0d6cd7d0ed846 && git -C "wp-content/themes/libresign" checkout -q FETCH_HEAD - slug: wp-simple-smtp source: https://github.com/LibreCodeCoop/wp-simple-smtp.git post_install_commands: - - git -C "$$PLUGIN_DIR" fetch -q origin 24729b5a34d8c67584b2c2608285d499866b2b25 && git -C "$$PLUGIN_DIR" checkout -q 24729b5a34d8c67584b2c2608285d499866b2b25 + - git -C "$$PLUGIN_DIR" fetch -q origin 24729b5a34d8c67584b2c2608285d499866b2b25 && git -C "$$PLUGIN_DIR" checkout -q FETCH_HEAD - wp option update smtp_xmailer LibreSign - wp option update smtp_hostname localhost - wp option update smtp_host mailpit @@ -54,17 +54,17 @@ services: - slug: woocommerce-nextcloud-admin-group-manager source: https://github.com/LibreSign/woocommerce-nextcloud-admin-group-manager.git post_install_commands: - - git -C "$$PLUGIN_DIR" fetch -q origin 4f4eb83b61bb423a2b730a552a604a33ab3c344d && git -C "$$PLUGIN_DIR" checkout -q 4f4eb83b61bb423a2b730a552a604a33ab3c344d + - git -C "$$PLUGIN_DIR" fetch -q origin 4f4eb83b61bb423a2b730a552a604a33ab3c344d && git -C "$$PLUGIN_DIR" checkout -q FETCH_HEAD - wp option update nextcloud_api_login ${NEXTCLOUD_ADMIN_USER:-admin} - wp option update nextcloud_api_password ${NEXTCLOUD_ADMIN_PASSWORD:-admin} - slug: woocommerce-restrict-switch source: https://github.com/LibreSign/woocommerce-restrict-switch.git post_install_commands: - - git -C "$$PLUGIN_DIR" fetch -q origin c524fbf18447b61abdd93d9f5ffd379169242bb1 && git -C "$$PLUGIN_DIR" checkout -q c524fbf18447b61abdd93d9f5ffd379169242bb1 + - git -C "$$PLUGIN_DIR" fetch -q origin c524fbf18447b61abdd93d9f5ffd379169242bb1 && git -C "$$PLUGIN_DIR" checkout -q FETCH_HEAD - slug: woocommerce-subscriptions source: https://github.com/pronamic/woocommerce-subscriptions.git post_install_commands: - - git -C "$$PLUGIN_DIR" fetch -q origin 2459d9c8662884d62b9a92221eb21c7c6c051a62 && git -C "$$PLUGIN_DIR" checkout -q 2459d9c8662884d62b9a92221eb21c7c6c051a62 + - git -C "$$PLUGIN_DIR" fetch -q origin 2459d9c8662884d62b9a92221eb21c7c6c051a62 && git -C "$$PLUGIN_DIR" checkout -q FETCH_HEAD - wp option update woocommerce_subscriptions_apportion_recurring_price yes-upgrade wordpress_custom_themes: - slug: libresign