Public Access
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8af89aa23d |
@@ -1,4 +1,4 @@
|
||||
# MokoCLI
|
||||
# moko-platform
|
||||
|
||||
Enterprise automation, validation, sync, and governance engine for all Moko Consulting repositories.
|
||||
|
||||
@@ -9,7 +9,7 @@ Enterprise automation, validation, sync, and governance engine for all Moko Cons
|
||||
| **Language** | PHP 8.1+ |
|
||||
| **Version** | 09.01.00 |
|
||||
| **Branch** | develop on `dev`, merge to `main` (protected) |
|
||||
| **Wiki** | [MokoCLI Wiki](https://git.mokoconsulting.tech/MokoConsulting/mokocli/wiki) |
|
||||
| **Wiki** | [moko-platform Wiki](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki) |
|
||||
|
||||
## Commands
|
||||
|
||||
@@ -73,4 +73,4 @@ PHPStan runs with `--memory-limit=512M`. CI enforces PHPCS errors; PHPStan is `c
|
||||
- **Workflow directory**: `.mokogitea/` (not `.gitea/` or `.github/`)
|
||||
- **Wiki**: documentation lives in the Gitea wiki, not `docs/` files
|
||||
- **New CLI tools**: extend `CliFramework`, not `CLIApp` (legacy)
|
||||
- **Standards**: [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/mokocli/wiki/Home)
|
||||
- **Standards**: [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)
|
||||
|
||||
@@ -7,8 +7,8 @@ contact_links:
|
||||
- name: 💬 Ask a Question
|
||||
url: https://mokoconsulting.tech/
|
||||
about: Get help or ask questions through our website
|
||||
- name: 📚 MokoCLI Documentation
|
||||
url: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
- name: 📚 moko-platform Documentation
|
||||
url: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
about: View our coding standards and best practices
|
||||
- name: 🔒 Report a Security Vulnerability
|
||||
url: https://git.mokoconsulting.tech/mokoconsulting-tech/.github-private/security/advisories/new
|
||||
|
||||
@@ -42,7 +42,7 @@ Suggested text here
|
||||
<!-- Add any other context, screenshots, or references -->
|
||||
|
||||
## Standards Alignment
|
||||
- [ ] Follows MokoCLI documentation guidelines
|
||||
- [ ] Follows moko-platform documentation guidelines
|
||||
- [ ] Uses en_US/en_GB localization
|
||||
- [ ] Includes proper SPDX headers where applicable
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ If you have ideas about how this could be implemented, share them here:
|
||||
Add any other context, mockups, or screenshots about the feature request here.
|
||||
|
||||
## Relevant Standards
|
||||
Does this relate to any standards in [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli)?
|
||||
Does this relate to any standards in [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)?
|
||||
- [ ] Accessibility (WCAG 2.1 AA)
|
||||
- [ ] Localization (en_US/en_GB)
|
||||
- [ ] Security best practices
|
||||
|
||||
@@ -35,7 +35,7 @@ Use this template only for:
|
||||
<!-- Describe how this could be addressed -->
|
||||
|
||||
## Standards Reference
|
||||
Does this relate to security standards in [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli)?
|
||||
Does this relate to security standards in [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)?
|
||||
- [ ] SPDX license identifiers
|
||||
- [ ] Secret management
|
||||
- [ ] Dependency security
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoCLI.Automation
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# INGROUP: moko-platform.Automation
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /.gitea/workflows/branch-protection.yml
|
||||
# BRIEF: Apply standardised branch protection rules to all governed repositories
|
||||
#
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
API="${GITEA_URL}/api/v1"
|
||||
|
||||
# Platform/standards/infra repos to exclude
|
||||
EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private mokocli mokoplatform MokoTesting"
|
||||
EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private moko-platform MokoTesting"
|
||||
EXCLUDE="$EXCLUDE MokoStandards-Template-Client MokoStandards-Template-Dolibarr MokoStandards-Template-Generic MokoStandards-Template-Joomla MokoDoliProjTemplate"
|
||||
|
||||
if [ -n "${{ inputs.repos }}" ]; then
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoCLI.Automation
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# INGROUP: moko-platform.Automation
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /.gitea/workflows/bulk-repo-sync.yml
|
||||
# BRIEF: Bulk repo sync — runs from API repo, syncs standards to all governed repos
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: MokoCLI.CI
|
||||
# INGROUP: MokoCLI
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# DEFGROUP: moko-platform.CI
|
||||
# INGROUP: moko-platform
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /.gitea/workflows/pr-branch-check.yml
|
||||
# BRIEF: PR branch merge policy enforcement
|
||||
#
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoCLI.Automation
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# INGROUP: moko-platform.Automation
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /.gitea/workflows/renovate.yml
|
||||
# BRIEF: Run Renovate Bot across all governed repos for dependency updates
|
||||
#
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
run: |
|
||||
API="${GITEA_URL}/api/v1"
|
||||
|
||||
EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private mokocli mokoplatform MokoTesting"
|
||||
EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private moko-platform MokoTesting"
|
||||
EXCLUDE="$EXCLUDE MokoStandards-Template-Client MokoStandards-Template-Dolibarr MokoStandards-Template-Generic MokoStandards-Template-Joomla MokoDoliProjTemplate"
|
||||
|
||||
if [ -n "${{ inputs.repos }}" ]; then
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoCLI.Maintenance
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# INGROUP: moko-platform.Maintenance
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /.gitea/workflows/sync-wikis.yml
|
||||
# BRIEF: Daily sync of all Gitea wikis to consolidated GitHub wiki repo
|
||||
|
||||
|
||||
@@ -1,72 +1,68 @@
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoCLI.Release
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# PATH: /.mokogitea/workflows/auto-bump.yml
|
||||
# VERSION: 09.23.00
|
||||
# BRIEF: Auto patch-bump version on every push to dev (skips merge commits)
|
||||
|
||||
name: "Universal: Auto Version Bump"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- rc
|
||||
- 'feature/**'
|
||||
- 'patch/**'
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
bump:
|
||||
name: Version Bump
|
||||
runs-on: release
|
||||
if: >-
|
||||
!contains(github.event.head_commit.message, '[skip ci]') &&
|
||||
!contains(github.event.head_commit.message, '[skip bump]') &&
|
||||
!startsWith(github.event.head_commit.message, 'Merge pull request')
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Setup MokoCLI tools
|
||||
run: |
|
||||
# Check both new (mokocli) and legacy (mokoplatform) install paths
|
||||
if [ -f "/opt/mokocli/cli/version_bump.php" ] && [ -f "/opt/mokocli/vendor/autoload.php" ]; then
|
||||
echo "Using pre-installed /opt/mokocli"
|
||||
echo "MOKO_CLI=/opt/mokocli/cli" >> "$GITHUB_ENV"
|
||||
elif [ -f "/opt/mokoplatform/cli/version_bump.php" ] && [ -f "/opt/mokoplatform/vendor/autoload.php" ]; then
|
||||
echo "Using pre-installed /opt/mokoplatform (legacy path)"
|
||||
echo "MOKO_CLI=/opt/mokoplatform/cli" >> "$GITHUB_ENV"
|
||||
else
|
||||
if ! command -v composer &> /dev/null; then
|
||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
||||
fi
|
||||
rm -rf /tmp/mokocli
|
||||
git clone --depth 1 --branch main --quiet \
|
||||
"https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/MokoConsulting/mokocli.git" \
|
||||
/tmp/mokocli
|
||||
cd /tmp/mokocli && composer install --no-dev --no-interaction --quiet
|
||||
echo "MOKO_CLI=/tmp/mokocli/cli" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
- name: Bump version
|
||||
run: |
|
||||
php ${MOKO_CLI}/version_auto_bump.php \
|
||||
--path . --branch "${GITHUB_REF_NAME}" \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||
--repo-url "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: moko-platform.Release
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /.mokogitea/workflows/auto-bump.yml
|
||||
# VERSION: 09.23.00
|
||||
# BRIEF: Auto patch-bump version on every push to dev (skips merge commits)
|
||||
|
||||
name: "Universal: Auto Version Bump"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- rc
|
||||
- 'feature/**'
|
||||
- 'patch/**'
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
bump:
|
||||
name: Version Bump
|
||||
runs-on: release
|
||||
if: >-
|
||||
!contains(github.event.head_commit.message, '[skip ci]') &&
|
||||
!contains(github.event.head_commit.message, '[skip bump]') &&
|
||||
!startsWith(github.event.head_commit.message, 'Merge pull request')
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Setup moko-platform tools
|
||||
run: |
|
||||
if [ -f "/opt/moko-platform/cli/version_bump.php" ] && [ -f "/opt/moko-platform/vendor/autoload.php" ]; then
|
||||
echo "Using pre-installed /opt/moko-platform"
|
||||
echo "MOKO_CLI=/opt/moko-platform/cli" >> "$GITHUB_ENV"
|
||||
else
|
||||
if ! command -v composer &> /dev/null; then
|
||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
||||
fi
|
||||
rm -rf /tmp/moko-platform-api
|
||||
git clone --depth 1 --branch main --quiet \
|
||||
"https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/MokoConsulting/moko-platform.git" \
|
||||
/tmp/moko-platform-api
|
||||
cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet
|
||||
echo "MOKO_CLI=/tmp/moko-platform-api/cli" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
- name: Bump version
|
||||
run: |
|
||||
php ${MOKO_CLI}/version_auto_bump.php \
|
||||
--path . --branch "${GITHUB_REF_NAME}" \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||
--repo-url "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||
|
||||
@@ -1,332 +1,324 @@
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoCLI.Release
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# PATH: /templates/workflows/universal/auto-release.yml.template
|
||||
# VERSION: 05.00.00
|
||||
# BRIEF: Universal build & release � detects platform from manifest.xml
|
||||
#
|
||||
# +========================================================================+
|
||||
# | UNIVERSAL BUILD & RELEASE PIPELINE |
|
||||
# +========================================================================+
|
||||
# | |
|
||||
# | Reads manifest.xml (joomla|dolibarr|generic) to branch logic. |
|
||||
# | |
|
||||
# | Platform-specific: |
|
||||
# | joomla: XML manifest, type-prefixed packages |
|
||||
# | dolibarr: mod*.class.php, update.txt, dev version reset |
|
||||
# | generic: README-only, no update stream |
|
||||
# | |
|
||||
# +========================================================================+
|
||||
|
||||
name: "Universal: Build & Release"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, closed]
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
action:
|
||||
description: 'Action to perform'
|
||||
required: false
|
||||
type: choice
|
||||
default: release
|
||||
options:
|
||||
- release
|
||||
- promote-rc
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||
GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }}
|
||||
GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
# ── PR Opened → Rename branch to RC and build RC release ─────────────────────
|
||||
promote-rc:
|
||||
name: Promote to RC
|
||||
runs-on: release
|
||||
if: >-
|
||||
(github.event.action == 'opened' && github.event.pull_request.merged != true) ||
|
||||
(github.event_name == 'workflow_dispatch' && inputs.action == 'promote-rc')
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Setup MokoCLI tools
|
||||
env:
|
||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||
run: |
|
||||
# Check both new (mokocli) and legacy (mokoplatform) install paths
|
||||
if [ -f /opt/mokocli/cli/version_bump.php ] && [ -f /opt/mokocli/vendor/autoload.php ]; then
|
||||
echo "Using pre-installed /opt/mokocli"
|
||||
echo MOKO_CLI=/opt/mokocli/cli >> $GITHUB_ENV
|
||||
elif [ -f /opt/mokoplatform/cli/version_bump.php ] && [ -f /opt/mokoplatform/vendor/autoload.php ]; then
|
||||
echo "Using pre-installed /opt/mokoplatform (legacy path)"
|
||||
echo MOKO_CLI=/opt/mokoplatform/cli >> $GITHUB_ENV
|
||||
else
|
||||
echo "Falling back to fresh clone"
|
||||
if ! command -v composer > /dev/null 2>&1; then
|
||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1
|
||||
fi
|
||||
rm -rf /tmp/mokocli
|
||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokocli.git
|
||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
||||
cd /tmp/mokocli
|
||||
composer install --no-dev --no-interaction --quiet
|
||||
echo MOKO_CLI=/tmp/mokocli/cli >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Rename branch to rc
|
||||
run: |
|
||||
php ${MOKO_CLI}/branch_rename.php \
|
||||
--from "${{ github.event.pull_request.head.ref || 'dev' }}" --to rc \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||
--api-base "${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" \
|
||||
--pr "${{ github.event.pull_request.number }}"
|
||||
|
||||
- name: Checkout rc and configure git
|
||||
run: |
|
||||
git fetch origin rc
|
||||
git checkout rc
|
||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||
git config --local user.name "gitea-actions[bot]"
|
||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||
|
||||
- name: Publish RC release
|
||||
run: |
|
||||
php ${MOKO_CLI}/release_publish.php \
|
||||
--path . --stability rc --bump minor --branch rc \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}"
|
||||
|
||||
- name: Summary
|
||||
if: always()
|
||||
run: |
|
||||
echo "## Promoted to Release Candidate" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Branch renamed to rc, minor bump, RC release built" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# ── Merged PR → Build & Release (or promote RC to stable) ────────────────────
|
||||
release:
|
||||
name: Build & Release Pipeline
|
||||
runs-on: release
|
||||
if: >-
|
||||
github.event.pull_request.merged == true ||
|
||||
(github.event_name == 'workflow_dispatch' && inputs.action != 'promote-rc')
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure git for bot pushes
|
||||
run: |
|
||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||
git config --local user.name "gitea-actions[bot]"
|
||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||
|
||||
- name: Check for merge conflict markers
|
||||
run: |
|
||||
CONFLICTS=$(grep -rn '<<<<<<< \|>>>>>>> \|^=======$' --include='*.php' --include='*.xml' --include='*.css' --include='*.js' --include='*.json' --include='*.md' --include='*.yml' --include='*.yaml' --include='*.ini' --include='*.txt' . 2>/dev/null | grep -v '.git/' || true)
|
||||
if [ -n "$CONFLICTS" ]; then
|
||||
echo "::error::Merge conflict markers found — aborting release"
|
||||
echo "## Release Blocked: Conflict Markers" >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
echo "$CONFLICTS" >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
fi
|
||||
echo "No conflict markers found"
|
||||
|
||||
- name: Setup MokoCLI tools
|
||||
env:
|
||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_MIRROR_TOKEN }}"}}'
|
||||
run: |
|
||||
# Check both new (mokocli) and legacy (mokoplatform) install paths
|
||||
if [ -f /opt/mokocli/cli/version_bump.php ] && [ -f /opt/mokocli/vendor/autoload.php ]; then
|
||||
echo "Using pre-installed /opt/mokocli"
|
||||
echo MOKO_CLI=/opt/mokocli/cli >> $GITHUB_ENV
|
||||
elif [ -f /opt/mokoplatform/cli/version_bump.php ] && [ -f /opt/mokoplatform/vendor/autoload.php ]; then
|
||||
echo "Using pre-installed /opt/mokoplatform (legacy path)"
|
||||
echo MOKO_CLI=/opt/mokoplatform/cli >> $GITHUB_ENV
|
||||
else
|
||||
echo "Falling back to fresh clone"
|
||||
if ! command -v composer > /dev/null 2>&1; then
|
||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1
|
||||
fi
|
||||
rm -rf /tmp/mokocli
|
||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokocli.git
|
||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
||||
cd /tmp/mokocli
|
||||
composer install --no-dev --no-interaction --quiet
|
||||
echo MOKO_CLI=/tmp/mokocli/cli >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: "Publish stable release"
|
||||
run: |
|
||||
php ${MOKO_CLI}/release_publish.php \
|
||||
--path . --stability stable --bump minor --branch main \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}"
|
||||
|
||||
- name: Update release notes from CHANGELOG.md
|
||||
run: |
|
||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||
|
||||
# Extract [Unreleased] section from changelog
|
||||
if [ -f "CHANGELOG.md" ]; then
|
||||
NOTES=$(awk '/^## \[Unreleased\]/{found=1; next} /^## \[/{if(found) exit} found{print}' CHANGELOG.md)
|
||||
[ -z "$NOTES" ] && NOTES="Stable release"
|
||||
else
|
||||
NOTES="Stable release"
|
||||
fi
|
||||
|
||||
# Update release body via API
|
||||
RELEASE_ID=$(curl -sf -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||
"${API_BASE}/releases/tags/stable" | python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true)
|
||||
|
||||
if [ -n "$RELEASE_ID" ]; then
|
||||
python3 -c "
|
||||
import json, urllib.request
|
||||
body = open('/dev/stdin').read()
|
||||
payload = json.dumps({'body': body}).encode()
|
||||
req = urllib.request.Request(
|
||||
'${API_BASE}/releases/${RELEASE_ID}',
|
||||
data=payload, method='PATCH',
|
||||
headers={
|
||||
'Authorization': 'token ${{ secrets.MOKOGITEA_TOKEN }}',
|
||||
'Content-Type': 'application/json'
|
||||
})
|
||||
urllib.request.urlopen(req)
|
||||
" <<< "$NOTES"
|
||||
echo "Release notes updated from CHANGELOG.md"
|
||||
fi
|
||||
|
||||
# -- STEP 9: Mirror to GitHub (stable only) --------------------------------
|
||||
- name: "Step 9: Mirror release to GitHub"
|
||||
if: >-
|
||||
steps.version.outputs.skip != 'true' &&
|
||||
secrets.GH_MIRROR_TOKEN != ''
|
||||
continue-on-error: true
|
||||
run: |
|
||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
||||
GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}"
|
||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||
php ${MOKO_CLI}/release_mirror.php \
|
||||
--version "$VERSION" --tag "$RELEASE_TAG" \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
||||
--gh-token "${{ secrets.GH_MIRROR_TOKEN }}" --gh-repo "$GH_REPO" \
|
||||
--branch main 2>&1 || true
|
||||
echo "GitHub mirror updated" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# -- STEP 10: Sync main branch to GitHub mirror ----------------------------
|
||||
- name: "Step 10: Push main to GitHub mirror"
|
||||
if: >-
|
||||
steps.version.outputs.skip != 'true' &&
|
||||
secrets.GH_MIRROR_TOKEN != ''
|
||||
continue-on-error: true
|
||||
run: |
|
||||
GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}"
|
||||
GH_ORG=$(echo "$GH_REPO" | cut -d/ -f1)
|
||||
GH_NAME=$(echo "$GH_REPO" | cut -d/ -f2)
|
||||
git remote add github "https://x-access-token:${{ secrets.GH_MIRROR_TOKEN }}@github.com/${GH_ORG}/${GH_NAME}.git" 2>/dev/null || \
|
||||
git remote set-url github "https://x-access-token:${{ secrets.GH_MIRROR_TOKEN }}@github.com/${GH_ORG}/${GH_NAME}.git"
|
||||
git fetch origin main --depth=1
|
||||
git push github origin/main:refs/heads/main --force 2>/dev/null \
|
||||
&& echo "main branch pushed to GitHub mirror" \
|
||||
|| echo "WARNING: GitHub mirror push failed"
|
||||
|
||||
- name: "Step 11: Delete rc branch and recreate dev from main"
|
||||
if: steps.version.outputs.skip != 'true'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
||||
|
||||
# Delete rc branch (ephemeral — created by promote-rc)
|
||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \
|
||||
"${API_BASE}/branches/rc" 2>/dev/null \
|
||||
&& echo "Deleted rc branch" || echo "rc branch not found"
|
||||
|
||||
# Delete dev branch
|
||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \
|
||||
"${API_BASE}/branches/dev" 2>/dev/null && echo "Deleted dev branch"
|
||||
|
||||
# Recreate dev from main (now includes version bump + changelog promotion)
|
||||
curl -sf -X POST -H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${API_BASE}/branches" \
|
||||
-d '{"new_branch_name":"dev","old_branch_name":"main"}' 2>/dev/null && echo "Recreated dev from main"
|
||||
|
||||
echo "Pre-release branches cleaned, dev reset from main" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
- name: "Step 12: Create version branch from main"
|
||||
if: steps.version.outputs.skip != 'true'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||
BRANCH_NAME="version/${VERSION}"
|
||||
MAIN_SHA=$(git rev-parse HEAD)
|
||||
|
||||
# Delete old version branch if it exists (same version re-release)
|
||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" "${API_BASE}/branches/${BRANCH_NAME}" 2>/dev/null && echo "Deleted old ${BRANCH_NAME}"
|
||||
|
||||
# Create version/XX.YY.ZZ from main
|
||||
curl -sf -X POST -H "Authorization: token ${TOKEN}" -H "Content-Type: application/json" "${API_BASE}/branches" -d "{\"new_branch_name\":\"${BRANCH_NAME}\",\"old_branch_name\":\"main\"}" 2>/dev/null && echo "Created ${BRANCH_NAME} from main (${MAIN_SHA})" || echo "WARNING: ${BRANCH_NAME} creation failed"
|
||||
|
||||
echo "Version branch created: ${BRANCH_NAME} (${MAIN_SHA})" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
|
||||
|
||||
# -- Dolibarr post-release: Reset dev version -----------------------------
|
||||
- name: "Post-release: Reset dev version"
|
||||
if: steps.version.outputs.skip != 'true'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||
php ${MOKO_CLI}/version_reset_dev.php \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "${API_BASE}" \
|
||||
--branch dev --path . 2>&1 || true
|
||||
|
||||
# -- Summary --------------------------------------------------------------
|
||||
- name: Pipeline Summary
|
||||
if: always()
|
||||
run: |
|
||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||
PLATFORM="${{ steps.platform.outputs.platform }}"
|
||||
if [ "${{ steps.version.outputs.skip }}" = "true" ]; then
|
||||
echo "## Release Skipped" >> $GITHUB_STEP_SUMMARY
|
||||
echo "No VERSION in README.md" >> $GITHUB_STEP_SUMMARY
|
||||
elif [ "${{ steps.check.outputs.already_released }}" = "true" ]; then
|
||||
echo "## Already Released — ${VERSION}" >> $GITHUB_STEP_SUMMARY
|
||||
else
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "## Build & Release Complete (${PLATFORM})" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Step | Result |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "|------|--------|" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Platform | \`${PLATFORM}\` |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Version | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Branch | \`${{ steps.version.outputs.branch }}\` |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Tag | \`${{ steps.version.outputs.tag }}\` |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Release | [View](${GITEA_URL}/${GITEA_ORG}/${GITEA_REPO}/releases/tag/${{ steps.version.outputs.tag }}) |" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: moko-platform.Release
|
||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
|
||||
# PATH: /templates/workflows/universal/auto-release.yml.template
|
||||
# VERSION: 05.00.00
|
||||
# BRIEF: Universal build & release � detects platform from manifest.xml
|
||||
#
|
||||
# +========================================================================+
|
||||
# | UNIVERSAL BUILD & RELEASE PIPELINE |
|
||||
# +========================================================================+
|
||||
# | |
|
||||
# | Reads manifest.xml (joomla|dolibarr|generic) to branch logic. |
|
||||
# | |
|
||||
# | Platform-specific: |
|
||||
# | joomla: XML manifest, type-prefixed packages |
|
||||
# | dolibarr: mod*.class.php, update.txt, dev version reset |
|
||||
# | generic: README-only, no update stream |
|
||||
# | |
|
||||
# +========================================================================+
|
||||
|
||||
name: "Universal: Build & Release"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, closed]
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
action:
|
||||
description: 'Action to perform'
|
||||
required: false
|
||||
type: choice
|
||||
default: release
|
||||
options:
|
||||
- release
|
||||
- promote-rc
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||
GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }}
|
||||
GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
# ── PR Opened → Rename branch to RC and build RC release ─────────────────────
|
||||
promote-rc:
|
||||
name: Promote to RC
|
||||
runs-on: release
|
||||
if: >-
|
||||
(github.event.action == 'opened' && github.event.pull_request.merged != true) ||
|
||||
(github.event_name == 'workflow_dispatch' && inputs.action == 'promote-rc')
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Setup moko-platform tools
|
||||
env:
|
||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||
run: |
|
||||
if [ -f /opt/moko-platform/cli/version_bump.php ] && [ -f /opt/moko-platform/vendor/autoload.php ]; then
|
||||
echo Using pre-installed /opt/moko-platform
|
||||
echo MOKO_CLI=/opt/moko-platform/cli >> $GITHUB_ENV
|
||||
else
|
||||
echo Falling back to fresh clone
|
||||
if ! command -v composer > /dev/null 2>&1; then
|
||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1
|
||||
fi
|
||||
rm -rf /tmp/moko-platform-api
|
||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git
|
||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/moko-platform-api
|
||||
cd /tmp/moko-platform-api
|
||||
composer install --no-dev --no-interaction --quiet
|
||||
echo MOKO_CLI=/tmp/moko-platform-api/cli >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Rename branch to rc
|
||||
run: |
|
||||
php ${MOKO_CLI}/branch_rename.php \
|
||||
--from "${{ github.event.pull_request.head.ref || 'dev' }}" --to rc \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||
--api-base "${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" \
|
||||
--pr "${{ github.event.pull_request.number }}"
|
||||
|
||||
- name: Checkout rc and configure git
|
||||
run: |
|
||||
git fetch origin rc
|
||||
git checkout rc
|
||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||
git config --local user.name "gitea-actions[bot]"
|
||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||
|
||||
- name: Publish RC release
|
||||
run: |
|
||||
php ${MOKO_CLI}/release_publish.php \
|
||||
--path . --stability rc --bump minor --branch rc \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}"
|
||||
|
||||
- name: Summary
|
||||
if: always()
|
||||
run: |
|
||||
echo "## Promoted to Release Candidate" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Branch renamed to rc, minor bump, RC release built" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# ── Merged PR → Build & Release (or promote RC to stable) ────────────────────
|
||||
release:
|
||||
name: Build & Release Pipeline
|
||||
runs-on: release
|
||||
if: >-
|
||||
github.event.pull_request.merged == true ||
|
||||
(github.event_name == 'workflow_dispatch' && inputs.action != 'promote-rc')
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure git for bot pushes
|
||||
run: |
|
||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||
git config --local user.name "gitea-actions[bot]"
|
||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||
|
||||
- name: Check for merge conflict markers
|
||||
run: |
|
||||
CONFLICTS=$(grep -rn '<<<<<<< \|>>>>>>> \|^=======$' --include='*.php' --include='*.xml' --include='*.css' --include='*.js' --include='*.json' --include='*.md' --include='*.yml' --include='*.yaml' --include='*.ini' --include='*.txt' . 2>/dev/null | grep -v '.git/' || true)
|
||||
if [ -n "$CONFLICTS" ]; then
|
||||
echo "::error::Merge conflict markers found — aborting release"
|
||||
echo "## Release Blocked: Conflict Markers" >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
echo "$CONFLICTS" >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
fi
|
||||
echo "No conflict markers found"
|
||||
|
||||
- name: Setup moko-platform tools
|
||||
env:
|
||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_MIRROR_TOKEN }}"}}'
|
||||
run: |
|
||||
if [ -f /opt/moko-platform/cli/version_bump.php ] && [ -f /opt/moko-platform/vendor/autoload.php ]; then
|
||||
echo Using pre-installed /opt/moko-platform
|
||||
echo MOKO_CLI=/opt/moko-platform/cli >> $GITHUB_ENV
|
||||
else
|
||||
echo Falling back to fresh clone
|
||||
if ! command -v composer > /dev/null 2>&1; then
|
||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1
|
||||
fi
|
||||
rm -rf /tmp/moko-platform-api
|
||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git
|
||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/moko-platform-api
|
||||
cd /tmp/moko-platform-api
|
||||
composer install --no-dev --no-interaction --quiet
|
||||
echo MOKO_CLI=/tmp/moko-platform-api/cli >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: "Publish stable release"
|
||||
run: |
|
||||
php ${MOKO_CLI}/release_publish.php \
|
||||
--path . --stability stable --bump minor --branch main \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}"
|
||||
|
||||
- name: Update release notes from CHANGELOG.md
|
||||
run: |
|
||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||
|
||||
# Extract [Unreleased] section from changelog
|
||||
if [ -f "CHANGELOG.md" ]; then
|
||||
NOTES=$(awk '/^## \[Unreleased\]/{found=1; next} /^## \[/{if(found) exit} found{print}' CHANGELOG.md)
|
||||
[ -z "$NOTES" ] && NOTES="Stable release"
|
||||
else
|
||||
NOTES="Stable release"
|
||||
fi
|
||||
|
||||
# Update release body via API
|
||||
RELEASE_ID=$(curl -sf -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||
"${API_BASE}/releases/tags/stable" | python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true)
|
||||
|
||||
if [ -n "$RELEASE_ID" ]; then
|
||||
python3 -c "
|
||||
import json, urllib.request
|
||||
body = open('/dev/stdin').read()
|
||||
payload = json.dumps({'body': body}).encode()
|
||||
req = urllib.request.Request(
|
||||
'${API_BASE}/releases/${RELEASE_ID}',
|
||||
data=payload, method='PATCH',
|
||||
headers={
|
||||
'Authorization': 'token ${{ secrets.MOKOGITEA_TOKEN }}',
|
||||
'Content-Type': 'application/json'
|
||||
})
|
||||
urllib.request.urlopen(req)
|
||||
" <<< "$NOTES"
|
||||
echo "Release notes updated from CHANGELOG.md"
|
||||
fi
|
||||
|
||||
# -- STEP 9: Mirror to GitHub (stable only) --------------------------------
|
||||
- name: "Step 9: Mirror release to GitHub"
|
||||
if: >-
|
||||
steps.version.outputs.skip != 'true' &&
|
||||
secrets.GH_MIRROR_TOKEN != ''
|
||||
continue-on-error: true
|
||||
run: |
|
||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
||||
GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}"
|
||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||
php ${MOKO_CLI}/release_mirror.php \
|
||||
--version "$VERSION" --tag "$RELEASE_TAG" \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
||||
--gh-token "${{ secrets.GH_MIRROR_TOKEN }}" --gh-repo "$GH_REPO" \
|
||||
--branch main 2>&1 || true
|
||||
echo "GitHub mirror updated" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# -- STEP 10: Sync main branch to GitHub mirror ----------------------------
|
||||
- name: "Step 10: Push main to GitHub mirror"
|
||||
if: >-
|
||||
steps.version.outputs.skip != 'true' &&
|
||||
secrets.GH_MIRROR_TOKEN != ''
|
||||
continue-on-error: true
|
||||
run: |
|
||||
GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}"
|
||||
GH_ORG=$(echo "$GH_REPO" | cut -d/ -f1)
|
||||
GH_NAME=$(echo "$GH_REPO" | cut -d/ -f2)
|
||||
git remote add github "https://x-access-token:${{ secrets.GH_MIRROR_TOKEN }}@github.com/${GH_ORG}/${GH_NAME}.git" 2>/dev/null || \
|
||||
git remote set-url github "https://x-access-token:${{ secrets.GH_MIRROR_TOKEN }}@github.com/${GH_ORG}/${GH_NAME}.git"
|
||||
git fetch origin main --depth=1
|
||||
git push github origin/main:refs/heads/main --force 2>/dev/null \
|
||||
&& echo "main branch pushed to GitHub mirror" \
|
||||
|| echo "WARNING: GitHub mirror push failed"
|
||||
|
||||
- name: "Step 11: Delete rc branch and recreate dev from main"
|
||||
if: steps.version.outputs.skip != 'true'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
||||
|
||||
# Delete rc branch (ephemeral — created by promote-rc)
|
||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \
|
||||
"${API_BASE}/branches/rc" 2>/dev/null \
|
||||
&& echo "Deleted rc branch" || echo "rc branch not found"
|
||||
|
||||
# Delete dev branch
|
||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \
|
||||
"${API_BASE}/branches/dev" 2>/dev/null && echo "Deleted dev branch"
|
||||
|
||||
# Recreate dev from main (now includes version bump + changelog promotion)
|
||||
curl -sf -X POST -H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${API_BASE}/branches" \
|
||||
-d '{"new_branch_name":"dev","old_branch_name":"main"}' 2>/dev/null && echo "Recreated dev from main"
|
||||
|
||||
echo "Pre-release branches cleaned, dev reset from main" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
- name: "Step 12: Create version branch from main"
|
||||
if: steps.version.outputs.skip != 'true'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||
BRANCH_NAME="version/${VERSION}"
|
||||
MAIN_SHA=$(git rev-parse HEAD)
|
||||
|
||||
# Delete old version branch if it exists (same version re-release)
|
||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" "${API_BASE}/branches/${BRANCH_NAME}" 2>/dev/null && echo "Deleted old ${BRANCH_NAME}"
|
||||
|
||||
# Create version/XX.YY.ZZ from main
|
||||
curl -sf -X POST -H "Authorization: token ${TOKEN}" -H "Content-Type: application/json" "${API_BASE}/branches" -d "{\"new_branch_name\":\"${BRANCH_NAME}\",\"old_branch_name\":\"main\"}" 2>/dev/null && echo "Created ${BRANCH_NAME} from main (${MAIN_SHA})" || echo "WARNING: ${BRANCH_NAME} creation failed"
|
||||
|
||||
echo "Version branch created: ${BRANCH_NAME} (${MAIN_SHA})" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
|
||||
|
||||
# -- Dolibarr post-release: Reset dev version -----------------------------
|
||||
- name: "Post-release: Reset dev version"
|
||||
if: steps.version.outputs.skip != 'true'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||
php ${MOKO_CLI}/version_reset_dev.php \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "${API_BASE}" \
|
||||
--branch dev --path . 2>&1 || true
|
||||
|
||||
# -- Summary --------------------------------------------------------------
|
||||
- name: Pipeline Summary
|
||||
if: always()
|
||||
run: |
|
||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||
PLATFORM="${{ steps.platform.outputs.platform }}"
|
||||
if [ "${{ steps.version.outputs.skip }}" = "true" ]; then
|
||||
echo "## Release Skipped" >> $GITHUB_STEP_SUMMARY
|
||||
echo "No VERSION in README.md" >> $GITHUB_STEP_SUMMARY
|
||||
elif [ "${{ steps.check.outputs.already_released }}" = "true" ]; then
|
||||
echo "## Already Released — ${VERSION}" >> $GITHUB_STEP_SUMMARY
|
||||
else
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "## Build & Release Complete (${PLATFORM})" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Step | Result |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "|------|--------|" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Platform | \`${PLATFORM}\` |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Version | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Branch | \`${{ steps.version.outputs.branch }}\` |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Tag | \`${{ steps.version.outputs.tag }}\` |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Release | [View](${GITEA_URL}/${GITEA_ORG}/${GITEA_REPO}/releases/tag/${{ steps.version.outputs.tag }}) |" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoStandards.Universal
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# INGROUP: MokoPlatform.Universal
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /.mokogitea/workflows/branch-cleanup.yml
|
||||
# VERSION: 01.00.00
|
||||
# VERSION: 09.23.00
|
||||
# BRIEF: Delete feature branches after PR merge
|
||||
|
||||
name: "Branch Cleanup"
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoCLI.CI
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# INGROUP: moko-platform.CI
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /.mokogitea/workflows/ci-platform.yml
|
||||
# VERSION: 09.23.00
|
||||
# BRIEF: MokoCLI CI — the standards engine validates itself
|
||||
# BRIEF: moko-platform CI — the standards engine validates itself
|
||||
#
|
||||
# +========================================================================+
|
||||
# | MOKOCLI CI |
|
||||
# | MOKO-PLATFORM CI |
|
||||
# +========================================================================+
|
||||
# | |
|
||||
# | This is NOT a generic CI workflow. This is the self-validation |
|
||||
# | pipeline for the central MokoCLI enterprise engine. |
|
||||
# | pipeline for the central moko-platform enterprise engine. |
|
||||
# | |
|
||||
# | It dogfoods every tool the platform ships to governed repos: |
|
||||
# | |
|
||||
@@ -29,7 +29,7 @@
|
||||
# | |
|
||||
# +========================================================================+
|
||||
|
||||
name: "Platform: MokoCLI CI"
|
||||
name: "Platform: moko-platform CI"
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -421,7 +421,7 @@ jobs:
|
||||
- name: Check gate results
|
||||
run: |
|
||||
{
|
||||
echo "# MokoCLI CI"
|
||||
echo "# moko-platform CI"
|
||||
echo ""
|
||||
echo "| Gate | Job | Status |"
|
||||
echo "|---|---|---|"
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoCLI.Maintenance
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# INGROUP: moko-platform.Maintenance
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /.mokogitea/workflows/cleanup.yml
|
||||
# VERSION: 09.23.00
|
||||
# BRIEF: Scheduled cleanup — delete merged branches and old workflow runs
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoCLI.Security
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# INGROUP: moko-platform.Security
|
||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
|
||||
# PATH: /templates/workflows/gitleaks.yml.template
|
||||
# VERSION: 09.23.00
|
||||
# BRIEF: Secret scanning — detect leaked credentials, API keys, and tokens
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoCLI.Automation
|
||||
# VERSION: 09.25.05
|
||||
# INGROUP: moko-platform.Automation
|
||||
# VERSION: 09.25.01
|
||||
# BRIEF: Auto-create feature branch when an issue is opened
|
||||
|
||||
name: "Universal: Issue Branch"
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoCLI.Notifications
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# INGROUP: moko-platform.Notifications
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /.mokogitea/workflows/notify.yml
|
||||
# VERSION: 09.23.00
|
||||
# BRIEF: Push notifications via ntfy on release success or workflow failure
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoCLI.CI
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# INGROUP: moko-platform.CI
|
||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
|
||||
# PATH: /templates/workflows/universal/pr-check.yml.template
|
||||
# VERSION: 09.23.00
|
||||
# BRIEF: PR gate — branch policy + code validation before merge
|
||||
|
||||
@@ -4,26 +4,23 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoCLI.Release
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# INGROUP: moko-platform.Release
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /templates/workflows/universal/pre-release.yml.template
|
||||
# VERSION: 05.01.00
|
||||
# BRIEF: Auto pre-release on push to dev/alpha/beta/rc branches
|
||||
# BRIEF: Manual pre-release -- builds dev/alpha/beta/rc packages from any branch
|
||||
|
||||
name: "Universal: Pre-Release"
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
branches:
|
||||
- dev
|
||||
- 'fix/**'
|
||||
- 'patch/**'
|
||||
- 'hotfix/**'
|
||||
- 'bugfix/**'
|
||||
- 'chore/**'
|
||||
- alpha
|
||||
- beta
|
||||
- rc
|
||||
pull_request_target:
|
||||
types: [synchronize, opened, reopened]
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
stability:
|
||||
@@ -46,11 +43,12 @@ env:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: "Build Pre-Release (${{ inputs.stability || github.ref_name }})"
|
||||
name: "Build Pre-Release (${{ inputs.stability || 'development' }})"
|
||||
runs-on: release
|
||||
if: >-
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
github.event_name == 'push'
|
||||
(github.event_name == 'pull_request' && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'dev') ||
|
||||
(github.event_name == 'pull_request_target' && github.event.pull_request.base.ref == 'main')
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -58,50 +56,40 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
ref: ${{ github.ref_name }}
|
||||
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || '' }}
|
||||
|
||||
- name: Setup MokoCLI tools
|
||||
- name: Setup moko-platform tools
|
||||
env:
|
||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||
run: |
|
||||
# Check both new (mokocli) and legacy (mokoplatform) install paths
|
||||
if [ -f /opt/mokocli/cli/version_bump.php ] && [ -f /opt/mokocli/cli/manifest_element.php ] && [ -f /opt/mokocli/vendor/autoload.php ]; then
|
||||
echo "Using pre-installed /opt/mokocli"
|
||||
echo MOKO_CLI=/opt/mokocli/cli >> $GITHUB_ENV
|
||||
elif [ -f /opt/mokoplatform/cli/version_bump.php ] && [ -f /opt/mokoplatform/vendor/autoload.php ]; then
|
||||
echo "Using pre-installed /opt/mokoplatform (legacy path)"
|
||||
echo MOKO_CLI=/opt/mokoplatform/cli >> $GITHUB_ENV
|
||||
# Use pre-installed /opt/moko-platform if available (updated by cron every 6h)
|
||||
if [ -f /opt/moko-platform/cli/version_bump.php ] && [ -f /opt/moko-platform/cli/manifest_element.php ] && [ -f /opt/moko-platform/vendor/autoload.php ]; then
|
||||
echo Using pre-installed /opt/moko-platform
|
||||
echo MOKO_CLI=/opt/moko-platform/cli >> $GITHUB_ENV
|
||||
else
|
||||
echo "Falling back to fresh clone"
|
||||
echo Falling back to fresh clone
|
||||
if ! command -v composer > /dev/null 2>&1; then
|
||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1
|
||||
fi
|
||||
rm -rf /tmp/mokocli
|
||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokocli.git
|
||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
||||
cd /tmp/mokocli && composer install --no-dev --no-interaction --quiet
|
||||
echo MOKO_CLI=/tmp/mokocli/cli >> $GITHUB_ENV
|
||||
rm -rf /tmp/moko-platform-api
|
||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git
|
||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/moko-platform-api
|
||||
cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet
|
||||
echo MOKO_CLI=/tmp/moko-platform-api/cli >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Detect platform
|
||||
id: platform
|
||||
run: |
|
||||
# Auto-detect and update platform if not set in manifest
|
||||
php ${MOKO_CLI}/platform_detect.php --path . --github-output 2>/dev/null || true
|
||||
php ${MOKO_CLI}/manifest_read.php --path . --github-output
|
||||
|
||||
- name: Resolve metadata and bump version
|
||||
id: meta
|
||||
run: |
|
||||
# Auto-detect stability from branch name on push, or use input on dispatch
|
||||
if [ "${{ github.event_name }}" = "push" ]; then
|
||||
case "${{ github.ref_name }}" in
|
||||
rc) STABILITY="release-candidate" ;;
|
||||
alpha) STABILITY="alpha" ;;
|
||||
beta) STABILITY="beta" ;;
|
||||
*) STABILITY="development" ;;
|
||||
esac
|
||||
# Auto-detect stability: RC for PRs targeting main, else use input or default to development
|
||||
if [ "${{ github.event_name }}" = "pull_request_target" ] && [ "${{ github.event.pull_request.base.ref }}" = "main" ]; then
|
||||
STABILITY="release-candidate"
|
||||
else
|
||||
STABILITY="${{ inputs.stability || 'development' }}"
|
||||
fi
|
||||
@@ -176,7 +164,7 @@ jobs:
|
||||
php ${MOKO_CLI}/release_create.php \
|
||||
--path . --version "$VERSION" --tag "$TAG" \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
||||
--repo "${GITEA_REPO}" --branch "${{ github.ref_name }}" --prerelease
|
||||
--repo "${GITEA_REPO}" --branch dev --prerelease
|
||||
|
||||
- name: Update release notes from CHANGELOG.md
|
||||
run: |
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,8 +4,8 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoCLI.Security
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# INGROUP: moko-platform.Security
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /.mokogitea/workflows/security-audit.yml
|
||||
# VERSION: 09.23.00
|
||||
# BRIEF: Dependency vulnerability scanning for composer and npm packages
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"metadata": {
|
||||
"generated_at": "2026-03-10T19:51:42.238134Z",
|
||||
"repository": "MokoConsulting/mokocli",
|
||||
"repository": "MokoConsulting/moko-platform",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"scripts": [
|
||||
|
||||
+1
-12
@@ -4,7 +4,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
FILE INFORMATION
|
||||
DEFGROUP: MokoStandards.Root
|
||||
INGROUP: MokoStandards
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
PATH: /CHANGELOG.md
|
||||
BRIEF: Release changelog
|
||||
-->
|
||||
@@ -12,17 +12,6 @@ BRIEF: Release changelog
|
||||
# Changelog
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- `workflow_sync.php` — cascading workflow sync from Generic → platform templates → live repos based on manifest.platform
|
||||
- `platform_detect.php` — auto-detect repo platform type (joomla/dolibarr/go/mcp/platform/generic) from file structure, optionally update manifest
|
||||
- Version prefix support in `version_read.php` and `version_bump.php` — repos with `<version_prefix>` in manifest (e.g. MokoGitea: `1.26.1+moko.`) get prefix-aware version scanning and bumping
|
||||
- Platform types: joomla, dolibarr, go, mcp, platform, generic
|
||||
- Template-Go and Template-MCP repos created
|
||||
|
||||
### Changed
|
||||
- `auto-release.yml` — patch branches (fix/*, patch/*, hotfix/*, bugfix/*) use `--bump none` (pre-release already bumped); feature/dev branches bump minor
|
||||
- `pre-release.yml` — triggers on push to dev, fix/**, patch/**, hotfix/**, bugfix/**, alpha, beta, rc branches
|
||||
- Version format standardized: `[prefix]XX.YY.ZZ` in source files, suffix (`-dev`, `-rc`) added by release system only
|
||||
|
||||
## [09.25.00] --- 2026-06-04
|
||||
|
||||
|
||||
+161
-161
@@ -1,161 +1,161 @@
|
||||
# Contributing to Moko Consulting Projects
|
||||
|
||||
Thank you for your interest in contributing. All Moko Consulting repositories follow this universal workflow and version policy.
|
||||
|
||||
## Branching Workflow
|
||||
|
||||
```
|
||||
feature/* ──PR──> dev ──draft PR──> (renamed to rc) ──merge──> main
|
||||
```
|
||||
|
||||
### Step by step
|
||||
|
||||
1. **Create a feature branch** from `dev`:
|
||||
```bash
|
||||
git checkout dev && git pull
|
||||
git checkout -b feature/my-change
|
||||
```
|
||||
|
||||
2. **Work and commit** on your feature branch. Push to origin.
|
||||
|
||||
3. **Open a PR**: `feature/my-change` → `dev`. After review and checks, merge it.
|
||||
|
||||
4. **When ready for release**, open a **draft PR**: `dev` → `main`.
|
||||
- This automatically renames the source branch to `rc` (release candidate)
|
||||
- An RC pre-release is built and uploaded
|
||||
|
||||
5. **Alpha and beta branches** are created by manually renaming the branch before the RC stage:
|
||||
- Rename `dev` to `alpha` for early testing → alpha pre-release is built
|
||||
- Rename `alpha` to `beta` for feature-complete testing → beta pre-release is built
|
||||
- When the draft PR is created, the branch is renamed to `rc`
|
||||
|
||||
6. **Once PR checks pass** on the `rc` branch, mark the PR as ready and merge to `main`.
|
||||
|
||||
7. **Merging to main** triggers the stable release pipeline:
|
||||
- Minor version bump (e.g., `02.09.xx` → `02.10.00`)
|
||||
- Stability suffix stripped (clean version)
|
||||
- Gitea release created with ZIP/tar.gz packages
|
||||
- `updates.xml` updated (Joomla extensions)
|
||||
- `dev` branch recreated from `main`
|
||||
|
||||
### Branch summary
|
||||
|
||||
| Branch | Purpose | Created by |
|
||||
|--------|---------|-----------|
|
||||
| `feature/*` | New features and fixes | Developer |
|
||||
| `dev` | Integration branch | Auto-recreated after release |
|
||||
| `alpha` | Alpha pre-release testing | Manual rename from `dev` |
|
||||
| `beta` | Beta pre-release testing | Manual rename from `alpha` |
|
||||
| `rc` | Release candidate | Auto-renamed on draft PR to main |
|
||||
| `main` | Stable releases | Protected, merge only |
|
||||
| `version/XX.YY.ZZ` | Archived release snapshots | Auto-created by CI |
|
||||
|
||||
### Protected branches
|
||||
|
||||
| Branch | Direct push | Merge via |
|
||||
|--------|------------|-----------|
|
||||
| `main` | Blocked (CI bot whitelisted) | PR merge only |
|
||||
| `dev` | Blocked (CI bot whitelisted) | PR merge from feature/* |
|
||||
| `rc` | Blocked (CI bot whitelisted) | Auto-created on draft PR |
|
||||
| `alpha` | Blocked (CI bot whitelisted) | Manual rename |
|
||||
| `beta` | Blocked (CI bot whitelisted) | Manual rename |
|
||||
| `feature/*` | Open | N/A (source branch) |
|
||||
|
||||
## Version Policy
|
||||
|
||||
### Format
|
||||
|
||||
All versions use `XX.YY.ZZ` — three two-digit segments, zero-padded:
|
||||
|
||||
- **XX** — Major version (breaking changes)
|
||||
- **YY** — Minor version (new features, bumped on release to main)
|
||||
- **ZZ** — Patch version (auto-incremented on every push to dev/feature branches)
|
||||
|
||||
Rollover: patch `99` → `00` increments minor; minor `99` → `00` increments major.
|
||||
|
||||
### Stability suffixes
|
||||
|
||||
Each branch appends a suffix to indicate stability:
|
||||
|
||||
| Branch | Suffix | Example |
|
||||
|--------|--------|---------|
|
||||
| `main` | (none) | `02.09.00` |
|
||||
| `dev` | `-dev` | `02.09.01-dev` |
|
||||
| `feature/*` | `-dev` | `02.09.01-dev` |
|
||||
| `alpha` | `-alpha` | `02.09.01-alpha` |
|
||||
| `beta` | `-beta` | `02.09.01-beta` |
|
||||
| `rc` | `-rc` | `02.09.01-rc` |
|
||||
|
||||
### Auto version bump
|
||||
|
||||
On every push to `dev`, `feature/*`, or `patch/*`:
|
||||
|
||||
1. Patch version incremented
|
||||
2. Stability suffix `-dev` applied
|
||||
3. All version-bearing files updated (manifests, CHANGELOG, PHP headers, etc.)
|
||||
4. Commit created with `[skip ci]` to avoid loops
|
||||
|
||||
### Release version flow
|
||||
|
||||
Version bumps happen at specific release events:
|
||||
|
||||
| Event | Bump | Example |
|
||||
|-------|------|---------|
|
||||
| Feature merged to dev | Patch bump after dev release | `02.09.01-dev` → release → `02.09.02-dev` |
|
||||
| Dev promoted to RC | Minor bump | `02.09.02-dev` → `02.10.00-rc` |
|
||||
| RC merged to main | Minor bump | `02.10.00-rc` → `02.11.00` (stable) |
|
||||
| Dev recreated from main | Patch bump | `02.11.00` → `02.11.01-dev` |
|
||||
|
||||
### Release stream copies
|
||||
|
||||
When a higher-stability release is published, copies are created for all lesser streams with the same base version:
|
||||
|
||||
- **RC `02.10.00-rc`** also creates: `02.10.00-dev`, `02.10.00-alpha`, `02.10.00-beta`
|
||||
- **Stable `02.11.00`** also creates: `02.11.00-dev`, `02.11.00-alpha`, `02.11.00-beta`, `02.11.00-rc`
|
||||
|
||||
This ensures Joomla sites on ANY stability channel see the update (Joomla only shows versions higher than what's installed).
|
||||
|
||||
### Version files
|
||||
|
||||
The version tools update all files containing version stamps:
|
||||
|
||||
- `.mokogitea/manifest.xml` (canonical source)
|
||||
- Joomla XML manifests (`<version>` tag)
|
||||
- `README.md`, `CHANGELOG.md` (`VERSION:` pattern)
|
||||
- `package.json`, `pyproject.toml`
|
||||
- Any text file with a `VERSION: XX.YY.ZZ` label
|
||||
|
||||
Files synced from other repos (with a `# REPO:` header) are not touched.
|
||||
|
||||
## Code Standards
|
||||
|
||||
- **PHP**: PSR-12, tabs for indentation
|
||||
- **Copyright**: all files must include the Moko Consulting copyright header
|
||||
- **License**: SPDX identifier `GPL-3.0-or-later` (or as specified per repo)
|
||||
- **Attribution**: use `Authored-by: Moko Consulting` in commits, not individual names
|
||||
|
||||
## Commit Messages
|
||||
|
||||
Use conventional commit format:
|
||||
|
||||
```
|
||||
type(scope): short description
|
||||
|
||||
Optional body with context.
|
||||
|
||||
Authored-by: Moko Consulting
|
||||
```
|
||||
|
||||
Types: `feat`, `fix`, `chore`, `docs`, `style`, `refactor`, `test`, `ci`
|
||||
|
||||
Special flags in commit messages:
|
||||
- `[skip ci]` — skip all CI workflows
|
||||
- `[skip bump]` — skip auto version bump only
|
||||
|
||||
## Reporting Issues
|
||||
|
||||
Use the repository's issue tracker with the appropriate template.
|
||||
|
||||
---
|
||||
|
||||
*Moko Consulting <hello@mokoconsulting.tech>*
|
||||
# Contributing to Moko Consulting Projects
|
||||
|
||||
Thank you for your interest in contributing. All Moko Consulting repositories follow this universal workflow and version policy.
|
||||
|
||||
## Branching Workflow
|
||||
|
||||
```
|
||||
feature/* ──PR──> dev ──draft PR──> (renamed to rc) ──merge──> main
|
||||
```
|
||||
|
||||
### Step by step
|
||||
|
||||
1. **Create a feature branch** from `dev`:
|
||||
```bash
|
||||
git checkout dev && git pull
|
||||
git checkout -b feature/my-change
|
||||
```
|
||||
|
||||
2. **Work and commit** on your feature branch. Push to origin.
|
||||
|
||||
3. **Open a PR**: `feature/my-change` → `dev`. After review and checks, merge it.
|
||||
|
||||
4. **When ready for release**, open a **draft PR**: `dev` → `main`.
|
||||
- This automatically renames the source branch to `rc` (release candidate)
|
||||
- An RC pre-release is built and uploaded
|
||||
|
||||
5. **Alpha and beta branches** are created by manually renaming the branch before the RC stage:
|
||||
- Rename `dev` to `alpha` for early testing → alpha pre-release is built
|
||||
- Rename `alpha` to `beta` for feature-complete testing → beta pre-release is built
|
||||
- When the draft PR is created, the branch is renamed to `rc`
|
||||
|
||||
6. **Once PR checks pass** on the `rc` branch, mark the PR as ready and merge to `main`.
|
||||
|
||||
7. **Merging to main** triggers the stable release pipeline:
|
||||
- Minor version bump (e.g., `02.09.xx` → `02.10.00`)
|
||||
- Stability suffix stripped (clean version)
|
||||
- Gitea release created with ZIP/tar.gz packages
|
||||
- `updates.xml` updated (Joomla extensions)
|
||||
- `dev` branch recreated from `main`
|
||||
|
||||
### Branch summary
|
||||
|
||||
| Branch | Purpose | Created by |
|
||||
|--------|---------|-----------|
|
||||
| `feature/*` | New features and fixes | Developer |
|
||||
| `dev` | Integration branch | Auto-recreated after release |
|
||||
| `alpha` | Alpha pre-release testing | Manual rename from `dev` |
|
||||
| `beta` | Beta pre-release testing | Manual rename from `alpha` |
|
||||
| `rc` | Release candidate | Auto-renamed on draft PR to main |
|
||||
| `main` | Stable releases | Protected, merge only |
|
||||
| `version/XX.YY.ZZ` | Archived release snapshots | Auto-created by CI |
|
||||
|
||||
### Protected branches
|
||||
|
||||
| Branch | Direct push | Merge via |
|
||||
|--------|------------|-----------|
|
||||
| `main` | Blocked (CI bot whitelisted) | PR merge only |
|
||||
| `dev` | Blocked (CI bot whitelisted) | PR merge from feature/* |
|
||||
| `rc` | Blocked (CI bot whitelisted) | Auto-created on draft PR |
|
||||
| `alpha` | Blocked (CI bot whitelisted) | Manual rename |
|
||||
| `beta` | Blocked (CI bot whitelisted) | Manual rename |
|
||||
| `feature/*` | Open | N/A (source branch) |
|
||||
|
||||
## Version Policy
|
||||
|
||||
### Format
|
||||
|
||||
All versions use `XX.YY.ZZ` — three two-digit segments, zero-padded:
|
||||
|
||||
- **XX** — Major version (breaking changes)
|
||||
- **YY** — Minor version (new features, bumped on release to main)
|
||||
- **ZZ** — Patch version (auto-incremented on every push to dev/feature branches)
|
||||
|
||||
Rollover: patch `99` → `00` increments minor; minor `99` → `00` increments major.
|
||||
|
||||
### Stability suffixes
|
||||
|
||||
Each branch appends a suffix to indicate stability:
|
||||
|
||||
| Branch | Suffix | Example |
|
||||
|--------|--------|---------|
|
||||
| `main` | (none) | `02.09.00` |
|
||||
| `dev` | `-dev` | `02.09.01-dev` |
|
||||
| `feature/*` | `-dev` | `02.09.01-dev` |
|
||||
| `alpha` | `-alpha` | `02.09.01-alpha` |
|
||||
| `beta` | `-beta` | `02.09.01-beta` |
|
||||
| `rc` | `-rc` | `02.09.01-rc` |
|
||||
|
||||
### Auto version bump
|
||||
|
||||
On every push to `dev`, `feature/*`, or `patch/*`:
|
||||
|
||||
1. Patch version incremented
|
||||
2. Stability suffix `-dev` applied
|
||||
3. All version-bearing files updated (manifests, CHANGELOG, PHP headers, etc.)
|
||||
4. Commit created with `[skip ci]` to avoid loops
|
||||
|
||||
### Release version flow
|
||||
|
||||
Version bumps happen at specific release events:
|
||||
|
||||
| Event | Bump | Example |
|
||||
|-------|------|---------|
|
||||
| Feature merged to dev | Patch bump after dev release | `02.09.01-dev` → release → `02.09.02-dev` |
|
||||
| Dev promoted to RC | Minor bump | `02.09.02-dev` → `02.10.00-rc` |
|
||||
| RC merged to main | Minor bump | `02.10.00-rc` → `02.11.00` (stable) |
|
||||
| Dev recreated from main | Patch bump | `02.11.00` → `02.11.01-dev` |
|
||||
|
||||
### Release stream copies
|
||||
|
||||
When a higher-stability release is published, copies are created for all lesser streams with the same base version:
|
||||
|
||||
- **RC `02.10.00-rc`** also creates: `02.10.00-dev`, `02.10.00-alpha`, `02.10.00-beta`
|
||||
- **Stable `02.11.00`** also creates: `02.11.00-dev`, `02.11.00-alpha`, `02.11.00-beta`, `02.11.00-rc`
|
||||
|
||||
This ensures Joomla sites on ANY stability channel see the update (Joomla only shows versions higher than what's installed).
|
||||
|
||||
### Version files
|
||||
|
||||
The version tools update all files containing version stamps:
|
||||
|
||||
- `.mokogitea/manifest.xml` (canonical source)
|
||||
- Joomla XML manifests (`<version>` tag)
|
||||
- `README.md`, `CHANGELOG.md` (`VERSION:` pattern)
|
||||
- `package.json`, `pyproject.toml`
|
||||
- Any text file with a `VERSION: XX.YY.ZZ` label
|
||||
|
||||
Files synced from other repos (with a `# REPO:` header) are not touched.
|
||||
|
||||
## Code Standards
|
||||
|
||||
- **PHP**: PSR-12, tabs for indentation
|
||||
- **Copyright**: all files must include the Moko Consulting copyright header
|
||||
- **License**: SPDX identifier `GPL-3.0-or-later` (or as specified per repo)
|
||||
- **Attribution**: use `Authored-by: Moko Consulting` in commits, not individual names
|
||||
|
||||
## Commit Messages
|
||||
|
||||
Use conventional commit format:
|
||||
|
||||
```
|
||||
type(scope): short description
|
||||
|
||||
Optional body with context.
|
||||
|
||||
Authored-by: Moko Consulting
|
||||
```
|
||||
|
||||
Types: `feat`, `fix`, `chore`, `docs`, `style`, `refactor`, `test`, `ci`
|
||||
|
||||
Special flags in commit messages:
|
||||
- `[skip ci]` — skip all CI workflows
|
||||
- `[skip bump]` — skip auto version bump only
|
||||
|
||||
## Reporting Issues
|
||||
|
||||
Use the repository's issue tracker with the appropriate template.
|
||||
|
||||
---
|
||||
|
||||
*Moko Consulting <hello@mokoconsulting.tech>*
|
||||
|
||||
+4
-4
@@ -2,16 +2,16 @@
|
||||
Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
FILE INFORMATION
|
||||
DEFGROUP: MokoCLI.Root
|
||||
INGROUP: MokoCLI
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
DEFGROUP: MokoPlatform.Root
|
||||
INGROUP: MokoPlatform
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
PATH: /PLUGIN_SCRIPTS.md
|
||||
BRIEF: Plugin system CLI documentation
|
||||
-->
|
||||
|
||||
# Plugin System CLI Scripts
|
||||
|
||||
Command-line scripts for validating, health checking, and managing projects using the MokoCLI plugin system.
|
||||
Command-line scripts for validating, health checking, and managing projects using the moko-platform plugin system.
|
||||
|
||||
## Available Scripts
|
||||
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
FILE INFORMATION
|
||||
DEFGROUP: MokoCLI.Root
|
||||
INGROUP: MokoCLI
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
DEFGROUP: MokoPlatform.Root
|
||||
INGROUP: MokoPlatform
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
PATH: /README.md
|
||||
VERSION: 09.25.05
|
||||
VERSION: 09.25.01
|
||||
BRIEF: Project overview and documentation
|
||||
-->
|
||||
|
||||
# MokoCLI Enterprise API
|
||||
# moko-platform Enterprise API
|
||||
|
||||
  
|
||||
|
||||
PHP implementation of MokoCLI — enterprise standards, automation framework, workflow templates, and bulk sync tooling.
|
||||
PHP implementation of moko-platform — enterprise standards, automation framework, workflow templates, and bulk sync tooling.
|
||||
|
||||
> **Primary platform**: [Gitea — git.mokoconsulting.tech](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API)
|
||||
> **Backup mirror**: [GitHub](https://github.com/MokoConsulting/MokoStandards-API) *(read-only mirror)*
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
FILE INFORMATION
|
||||
DEFGROUP: MokoCLI.Index
|
||||
INGROUP: MokoCLI.Analysis
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
DEFGROUP: MokoPlatform.Index
|
||||
INGROUP: MokoPlatform.Analysis
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
PATH: /analysis/index.md
|
||||
BRIEF: Analysis directory index
|
||||
-->
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.Automation
|
||||
* INGROUP: MokoCLI.Scripts
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoPlatform.Automation
|
||||
* INGROUP: MokoPlatform.Scripts
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /automation/bulk_joomla_template.php
|
||||
* BRIEF: Bulk scaffold and sync Joomla template repositories
|
||||
*
|
||||
@@ -42,7 +42,7 @@ use MokoEnterprise\{
|
||||
*
|
||||
* Provides three operations for Joomla template projects:
|
||||
* --scaffold: Create a new template repository with the full directory structure
|
||||
* --sync: Push MokoCLI files to existing template repositories
|
||||
* --sync: Push moko-platform files to existing template repositories
|
||||
* --list: List all repositories tagged as joomla-template
|
||||
*
|
||||
* Works with both GitHub and Gitea via the PlatformAdapterFactory.
|
||||
@@ -318,7 +318,7 @@ class BulkJoomlaTemplate extends CliFramework
|
||||
$name,
|
||||
$path,
|
||||
$content,
|
||||
"chore: update {$path} from MokoCLI",
|
||||
"chore: update {$path} from moko-platform",
|
||||
$existingSha,
|
||||
$branch
|
||||
);
|
||||
|
||||
+42
-42
@@ -9,9 +9,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.Automation
|
||||
* INGROUP: MokoCLI.Scripts
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoPlatform.Automation
|
||||
* INGROUP: MokoPlatform.Scripts
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /automation/bulk_sync.php
|
||||
* BRIEF: Enterprise-grade bulk repository synchronization
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ use MokoEnterprise\{
|
||||
/**
|
||||
* Bulk Repository Synchronization Tool
|
||||
*
|
||||
* Synchronizes MokoCLI files across multiple repositories using
|
||||
* Synchronizes moko-platform files across multiple repositories using
|
||||
* the Enterprise library for robust, audited operations.
|
||||
*/
|
||||
class BulkSync extends CliFramework
|
||||
@@ -95,7 +95,7 @@ class BulkSync extends CliFramework
|
||||
*/
|
||||
protected function run(): int
|
||||
{
|
||||
$this->log("🚀 MokoCLI Bulk Synchronization v" . self::VERSION, 'INFO');
|
||||
$this->log("🚀 moko-platform Bulk Synchronization v" . self::VERSION, 'INFO');
|
||||
|
||||
// Initialize enterprise components
|
||||
if (!$this->initializeComponents()) {
|
||||
@@ -180,7 +180,7 @@ class BulkSync extends CliFramework
|
||||
$results['health'] = $this->runHealthChecksAll($org, $repositories);
|
||||
}
|
||||
|
||||
// Create/update tracking issue in MokoCLI
|
||||
// Create/update tracking issue in moko-platform
|
||||
$this->createSyncIssue($org, $results);
|
||||
|
||||
// Create/update a failure issue when any repos failed
|
||||
@@ -244,7 +244,7 @@ class BulkSync extends CliFramework
|
||||
* Filter repositories based on include/exclude lists
|
||||
*/
|
||||
/** Repositories that are permanently excluded from bulk sync. */
|
||||
private const ALWAYS_EXCLUDE = ['MokoCLI', '.github-private'];
|
||||
private const ALWAYS_EXCLUDE = ['moko-platform', '.github-private'];
|
||||
|
||||
private function filterRepositories(array $repositories, array $include, array $exclude): array
|
||||
{
|
||||
@@ -426,7 +426,7 @@ class BulkSync extends CliFramework
|
||||
$this->log("", 'ERROR');
|
||||
$this->log("Required Implementation:", 'ERROR');
|
||||
$this->log(" 1. Clone/fetch target repository", 'ERROR');
|
||||
$this->log(" 2. Apply file updates based on MokoCLI configuration", 'ERROR');
|
||||
$this->log(" 2. Apply file updates based on moko-platform configuration", 'ERROR');
|
||||
$this->log(" 3. Create pull request with changes", 'ERROR');
|
||||
$this->log(" 4. Handle merge conflicts and validation", 'ERROR');
|
||||
$this->log("", 'ERROR');
|
||||
@@ -837,7 +837,7 @@ class BulkSync extends CliFramework
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure all standard MokoCLI labels exist on a target repository.
|
||||
* Ensure all standard moko-platform labels exist on a target repository.
|
||||
*
|
||||
* Fetches existing labels first (GET) and only POSTs the ones that are
|
||||
* missing. This avoids the 422 "already exists" responses that would
|
||||
@@ -872,7 +872,7 @@ class BulkSync extends CliFramework
|
||||
|
||||
// Workflow / Process
|
||||
['automation', '8B4513', 'Automated processes or scripts'],
|
||||
['MokoCLI', 'B60205', 'MokoCLI compliance'],
|
||||
['moko-platform', 'B60205', 'moko-platform compliance'],
|
||||
['needs-review', 'FBCA04', 'Awaiting code review'],
|
||||
['work-in-progress', 'D93F0B', 'Work in progress, not ready for merge'],
|
||||
['breaking-change', 'D73A4A', 'Breaking API or functionality change'],
|
||||
@@ -912,8 +912,8 @@ class BulkSync extends CliFramework
|
||||
['health: poor', 'FF6B6B', 'Health score below 50'],
|
||||
|
||||
// Sync / Automation (used by bulk_sync, scan_drift, check_repo_health)
|
||||
['standards-update', 'B60205', 'MokoCLI sync update'],
|
||||
['standards-drift', 'FBCA04', 'Repository drifted from MokoCLI'],
|
||||
['standards-update', 'B60205', 'moko-platform sync update'],
|
||||
['standards-drift', 'FBCA04', 'Repository drifted from moko-platform'],
|
||||
['sync-report', '0075CA', 'Bulk sync run report'],
|
||||
['sync-failure', 'D73A4A', 'Bulk sync failure requiring attention'],
|
||||
['push-failure', 'D73A4A', 'File push failure requiring attention'],
|
||||
@@ -925,10 +925,10 @@ class BulkSync extends CliFramework
|
||||
['type: version', '0E8A16', 'Version-related change'],
|
||||
];
|
||||
|
||||
// Quick check: if the repo already has the 'MokoCLI' label, it was
|
||||
// Quick check: if the repo already has the 'moko-platform' label, it was
|
||||
// provisioned previously — skip the expensive full label provisioning.
|
||||
try {
|
||||
$probe = $this->api->get("/repos/{$org}/{$repo}/labels/MokoCLI");
|
||||
$probe = $this->api->get("/repos/{$org}/{$repo}/labels/moko-platform");
|
||||
if (!empty($probe['name'])) {
|
||||
return; // already provisioned
|
||||
}
|
||||
@@ -1024,7 +1024,7 @@ class BulkSync extends CliFramework
|
||||
*/
|
||||
private function updateOpenBranches(string $org, string $repo): void
|
||||
{
|
||||
$syncBranchPrefix = 'chore/sync-MokoCLI-';
|
||||
$syncBranchPrefix = 'chore/sync-moko-platform-';
|
||||
|
||||
try {
|
||||
$defaultBranch = 'main';
|
||||
@@ -1055,7 +1055,7 @@ class BulkSync extends CliFramework
|
||||
$this->api->post("/repos/{$org}/{$repo}/merges", [
|
||||
'base' => $branch,
|
||||
'head' => $defaultBranch,
|
||||
'commit_message' => "chore: merge {$defaultBranch} into {$branch} (MokoCLI sync)",
|
||||
'commit_message' => "chore: merge {$defaultBranch} into {$branch} (moko-platform sync)",
|
||||
]);
|
||||
$this->log(" 🔀 Merged {$defaultBranch} → {$branch} (PR #{$prNum})", 'INFO');
|
||||
} catch (\Exception $e) {
|
||||
@@ -1076,7 +1076,7 @@ class BulkSync extends CliFramework
|
||||
|
||||
/**
|
||||
* Records which sync run touched the repo, the PR number, and the
|
||||
* MokoCLI version that was applied — giving each repo a clear audit
|
||||
* moko-platform version that was applied — giving each repo a clear audit
|
||||
* trail of what was changed and why.
|
||||
*/
|
||||
/**
|
||||
@@ -1119,16 +1119,16 @@ class BulkSync extends CliFramework
|
||||
$minor = self::VERSION_MINOR;
|
||||
$force = isset($this->options['force']) ? ' *(--force)*' : '';
|
||||
$prLink = $this->adapter->getPullRequestWebUrl($org, $repo, $prNumber);
|
||||
$source = $this->adapter->getRepoWebUrl($org, 'MokoCLI');
|
||||
$branchName = 'chore/sync-MokoCLI-v' . $minor;
|
||||
$source = $this->adapter->getRepoWebUrl($org, 'moko-platform');
|
||||
$branchName = 'chore/sync-moko-platform-v' . $minor;
|
||||
$branchLink = $this->adapter->getBranchWebUrl($org, $repo, $branchName);
|
||||
|
||||
$title = "chore: MokoCLI v{$minor} sync tracking";
|
||||
$title = "chore: moko-platform v{$minor} sync tracking";
|
||||
|
||||
$body = <<<MD
|
||||
## MokoCLI Sync Applied
|
||||
## moko-platform Sync Applied
|
||||
|
||||
A MokoCLI bulk sync run has updated files in this repository.
|
||||
A moko-platform bulk sync run has updated files in this repository.
|
||||
|
||||
| Field | Value |
|
||||
|-------|-------|
|
||||
@@ -1144,13 +1144,13 @@ class BulkSync extends CliFramework
|
||||
Protected files (README, CHANGELOG, GOVERNANCE, etc.) were not overwritten.
|
||||
|
||||
---
|
||||
*Updated automatically by [MokoCLI]({$source}) `bulk_sync.php`*
|
||||
*Updated automatically by [moko-platform]({$source}) `bulk_sync.php`*
|
||||
MD;
|
||||
|
||||
// Dedent heredoc
|
||||
$body = preg_replace('/^ /m', '', $body);
|
||||
|
||||
$labelNames = ['standards-update', 'MokoCLI', 'type: chore', 'automation'];
|
||||
$labelNames = ['standards-update', 'moko-platform', 'type: chore', 'automation'];
|
||||
$labels = $this->resolveLabelIds($org, $repo, $labelNames);
|
||||
|
||||
try {
|
||||
@@ -1213,7 +1213,7 @@ class BulkSync extends CliFramework
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a tracking issue in MokoCLI for this sync run.
|
||||
* Create a tracking issue in moko-platform for this sync run.
|
||||
*/
|
||||
private function createSyncIssue(string $org, array $results): void
|
||||
{
|
||||
@@ -1232,7 +1232,7 @@ class BulkSync extends CliFramework
|
||||
$issues = $results['issues'] ?? [];
|
||||
|
||||
// Stable title — no timestamp so repeated runs update a single issue
|
||||
$title = "sync: MokoCLI v" . self::VERSION_MINOR . " bulk sync report";
|
||||
$title = "sync: moko-platform v" . self::VERSION_MINOR . " bulk sync report";
|
||||
|
||||
$protection = $results['protection'] ?? [];
|
||||
$hasProtect = !empty($protection);
|
||||
@@ -1281,7 +1281,7 @@ class BulkSync extends CliFramework
|
||||
: "|---|---|---|---|";
|
||||
|
||||
$body = <<<MD
|
||||
## MokoCLI Bulk Sync Report
|
||||
## moko-platform Bulk Sync Report
|
||||
|
||||
**Organisation:** `{$org}`
|
||||
**Triggered:** {$now}{$force}
|
||||
@@ -1301,7 +1301,7 @@ class BulkSync extends CliFramework
|
||||
|
||||
try {
|
||||
// Search for existing issue by label — any state so we can reopen closed ones
|
||||
$existing = $this->api->get("/repos/{$org}/MokoCLI/issues", [
|
||||
$existing = $this->api->get("/repos/{$org}/moko-platform/issues", [
|
||||
'labels' => 'sync-report',
|
||||
'state' => 'all',
|
||||
'per_page' => 1,
|
||||
@@ -1309,8 +1309,8 @@ class BulkSync extends CliFramework
|
||||
'direction' => 'desc',
|
||||
]);
|
||||
|
||||
$labelNames = ['sync-report', 'MokoCLI', 'type: chore', 'automation'];
|
||||
$labels = $this->resolveLabelIds($org, 'MokoCLI', $labelNames);
|
||||
$labelNames = ['sync-report', 'moko-platform', 'type: chore', 'automation'];
|
||||
$labels = $this->resolveLabelIds($org, 'moko-platform', $labelNames);
|
||||
$existing = array_values($existing);
|
||||
|
||||
if (!empty($existing) && isset($existing[0]['number'])) {
|
||||
@@ -1319,22 +1319,22 @@ class BulkSync extends CliFramework
|
||||
if (($existing[0]['state'] ?? 'open') === 'closed') {
|
||||
$patch['state'] = 'open';
|
||||
}
|
||||
$this->api->patch("/repos/{$org}/MokoCLI/issues/{$issueNumber}", $patch);
|
||||
$this->api->patch("/repos/{$org}/moko-platform/issues/{$issueNumber}", $patch);
|
||||
try {
|
||||
$this->api->post("/repos/{$org}/MokoCLI/issues/{$issueNumber}/labels", ['labels' => $labels]);
|
||||
$this->api->post("/repos/{$org}/moko-platform/issues/{$issueNumber}/labels", ['labels' => $labels]);
|
||||
} catch (\Exception $le) {
|
||||
/* non-fatal */
|
||||
}
|
||||
$this->log("📋 Sync report issue updated: {$org}/MokoCLI#{$issueNumber}", 'INFO');
|
||||
$this->log("📋 Sync report issue updated: {$org}/moko-platform#{$issueNumber}", 'INFO');
|
||||
} else {
|
||||
$issue = $this->api->post("/repos/{$org}/MokoCLI/issues", [
|
||||
$issue = $this->api->post("/repos/{$org}/moko-platform/issues", [
|
||||
'title' => $title,
|
||||
'body' => $body,
|
||||
'labels' => $labels,
|
||||
'assignees' => ['jmiller'],
|
||||
]);
|
||||
$issueNumber = $issue['number'] ?? '?';
|
||||
$this->log("📋 Sync report issue created: {$org}/MokoCLI#{$issueNumber}", 'INFO');
|
||||
$this->log("📋 Sync report issue created: {$org}/moko-platform#{$issueNumber}", 'INFO');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$this->log("⚠️ Failed to create/update sync report issue: " . $e->getMessage(), 'WARN');
|
||||
@@ -1342,7 +1342,7 @@ class BulkSync extends CliFramework
|
||||
}
|
||||
|
||||
/**
|
||||
* Create or update a failure issue in MokoCLI when repos fail to sync.
|
||||
* Create or update a failure issue in moko-platform when repos fail to sync.
|
||||
* Uses the 'sync-failure' label so it is distinct from the run-report issue.
|
||||
* Reopens a closed issue rather than creating a duplicate.
|
||||
*/
|
||||
@@ -1388,7 +1388,7 @@ class BulkSync extends CliFramework
|
||||
$body = preg_replace('/^ /m', '', $body);
|
||||
|
||||
try {
|
||||
$existing = $this->api->get("/repos/{$org}/MokoCLI/issues", [
|
||||
$existing = $this->api->get("/repos/{$org}/moko-platform/issues", [
|
||||
'labels' => 'sync-failure',
|
||||
'state' => 'all',
|
||||
'per_page' => 1,
|
||||
@@ -1403,17 +1403,17 @@ class BulkSync extends CliFramework
|
||||
if (($existing[0]['state'] ?? 'open') === 'closed') {
|
||||
$patch['state'] = 'open';
|
||||
}
|
||||
$this->api->patch("/repos/{$org}/MokoCLI/issues/{$num}", $patch);
|
||||
$this->log("🚨 Failure issue #{$num} updated: {$org}/MokoCLI#{$num}", 'WARN');
|
||||
$this->api->patch("/repos/{$org}/moko-platform/issues/{$num}", $patch);
|
||||
$this->log("🚨 Failure issue #{$num} updated: {$org}/moko-platform#{$num}", 'WARN');
|
||||
} else {
|
||||
$issue = $this->api->post("/repos/{$org}/MokoCLI/issues", [
|
||||
$issue = $this->api->post("/repos/{$org}/moko-platform/issues", [
|
||||
'title' => $title,
|
||||
'body' => $body,
|
||||
'labels' => $this->resolveLabelIds($org, 'MokoCLI', ['sync-failure']),
|
||||
'labels' => $this->resolveLabelIds($org, 'moko-platform', ['sync-failure']),
|
||||
'assignees' => ['jmiller'],
|
||||
]);
|
||||
$num = $issue['number'] ?? '?';
|
||||
$this->log("🚨 Failure issue created: {$org}/MokoCLI#{$num}", 'WARN');
|
||||
$this->log("🚨 Failure issue created: {$org}/moko-platform#{$num}", 'WARN');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$this->log("⚠️ Could not create/update failure issue: " . $e->getMessage(), 'WARN');
|
||||
|
||||
+123
-123
@@ -1,123 +1,123 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# BRIEF: Trigger a workflow across all client-waas repos in a Gitea org
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Usage
|
||||
# ---------------------------------------------------------------------------
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $(basename "$0") GITEA_URL TOKEN ORG WORKFLOW [REF] [INPUTS]
|
||||
|
||||
Arguments:
|
||||
GITEA_URL Base URL of the Gitea instance (e.g. https://git.mokoconsulting.tech)
|
||||
TOKEN Gitea API token with repo/action permissions
|
||||
ORG Organisation or user that owns the repos
|
||||
WORKFLOW Workflow filename to trigger (e.g. dependency-audit.yml)
|
||||
REF Branch ref to run against (default: main)
|
||||
INPUTS Optional JSON object of workflow inputs (e.g. '{"dry_run":"true"}')
|
||||
|
||||
Example:
|
||||
$(basename "$0") https://git.mokoconsulting.tech abc123 MokoConsulting dependency-audit.yml main '{"notify":"true"}'
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Argument parsing
|
||||
# ---------------------------------------------------------------------------
|
||||
if [ $# -lt 4 ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
GITEA_URL="${1%/}"
|
||||
TOKEN="$2"
|
||||
ORG="$3"
|
||||
WORKFLOW="$4"
|
||||
REF="${5:-main}"
|
||||
INPUTS="${6:-{\}}"
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Fetch all repos in the org, paginated
|
||||
# ---------------------------------------------------------------------------
|
||||
echo "Fetching repos for org '${ORG}' on ${GITEA_URL} ..."
|
||||
|
||||
PAGE=1
|
||||
LIMIT=50
|
||||
ALL_REPOS=""
|
||||
|
||||
while true; do
|
||||
RESPONSE=$(curl -s \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Accept: application/json" \
|
||||
"${GITEA_URL}/api/v1/orgs/${ORG}/repos?page=${PAGE}&limit=${LIMIT}")
|
||||
|
||||
# Break if empty array
|
||||
COUNT=$(echo "$RESPONSE" | jq -r 'length')
|
||||
if [ "$COUNT" -eq 0 ]; then
|
||||
break
|
||||
fi
|
||||
|
||||
NAMES=$(echo "$RESPONSE" | jq -r '.[].name')
|
||||
ALL_REPOS="${ALL_REPOS}${NAMES}"$'\n'
|
||||
|
||||
if [ "$COUNT" -lt "$LIMIT" ]; then
|
||||
break
|
||||
fi
|
||||
|
||||
PAGE=$((PAGE + 1))
|
||||
done
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Filter for client-waas repos
|
||||
# ---------------------------------------------------------------------------
|
||||
CLIENT_REPOS=$(echo "$ALL_REPOS" | grep 'client-waas' | sort || true)
|
||||
|
||||
if [ -z "$CLIENT_REPOS" ]; then
|
||||
echo "No client-waas repos found in org '${ORG}'."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TOTAL=$(echo "$CLIENT_REPOS" | wc -l | tr -d ' ')
|
||||
echo "Found ${TOTAL} client-waas repo(s). Triggering workflow '${WORKFLOW}' (ref: ${REF}) ..."
|
||||
echo ""
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Trigger workflow for each repo
|
||||
# ---------------------------------------------------------------------------
|
||||
SUCCESS=0
|
||||
FAIL=0
|
||||
|
||||
while IFS= read -r REPO; do
|
||||
[ -z "$REPO" ] && continue
|
||||
|
||||
PAYLOAD=$(jq -n --arg ref "$REF" --argjson inputs "$INPUTS" '{ref: $ref, inputs: $inputs}')
|
||||
|
||||
HTTP_CODE=$(curl -s -o /dev/null -w '%{http_code}' \
|
||||
-X POST \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$PAYLOAD" \
|
||||
"${GITEA_URL}/api/v1/repos/${ORG}/${REPO}/actions/workflows/${WORKFLOW}/dispatches")
|
||||
|
||||
if [ "$HTTP_CODE" -eq 204 ] || [ "$HTTP_CODE" -eq 201 ]; then
|
||||
echo " [OK] ${ORG}/${REPO} (HTTP ${HTTP_CODE})"
|
||||
SUCCESS=$((SUCCESS + 1))
|
||||
else
|
||||
echo " [FAIL] ${ORG}/${REPO} (HTTP ${HTTP_CODE})"
|
||||
FAIL=$((FAIL + 1))
|
||||
fi
|
||||
done <<< "$CLIENT_REPOS"
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Summary
|
||||
# ---------------------------------------------------------------------------
|
||||
echo ""
|
||||
echo "Done. Success: ${SUCCESS} | Failed: ${FAIL} | Total: ${TOTAL}"
|
||||
|
||||
if [ "$FAIL" -gt 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# BRIEF: Trigger a workflow across all client-waas repos in a Gitea org
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Usage
|
||||
# ---------------------------------------------------------------------------
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $(basename "$0") GITEA_URL TOKEN ORG WORKFLOW [REF] [INPUTS]
|
||||
|
||||
Arguments:
|
||||
GITEA_URL Base URL of the Gitea instance (e.g. https://git.mokoconsulting.tech)
|
||||
TOKEN Gitea API token with repo/action permissions
|
||||
ORG Organisation or user that owns the repos
|
||||
WORKFLOW Workflow filename to trigger (e.g. dependency-audit.yml)
|
||||
REF Branch ref to run against (default: main)
|
||||
INPUTS Optional JSON object of workflow inputs (e.g. '{"dry_run":"true"}')
|
||||
|
||||
Example:
|
||||
$(basename "$0") https://git.mokoconsulting.tech abc123 MokoConsulting dependency-audit.yml main '{"notify":"true"}'
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Argument parsing
|
||||
# ---------------------------------------------------------------------------
|
||||
if [ $# -lt 4 ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
GITEA_URL="${1%/}"
|
||||
TOKEN="$2"
|
||||
ORG="$3"
|
||||
WORKFLOW="$4"
|
||||
REF="${5:-main}"
|
||||
INPUTS="${6:-{\}}"
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Fetch all repos in the org, paginated
|
||||
# ---------------------------------------------------------------------------
|
||||
echo "Fetching repos for org '${ORG}' on ${GITEA_URL} ..."
|
||||
|
||||
PAGE=1
|
||||
LIMIT=50
|
||||
ALL_REPOS=""
|
||||
|
||||
while true; do
|
||||
RESPONSE=$(curl -s \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Accept: application/json" \
|
||||
"${GITEA_URL}/api/v1/orgs/${ORG}/repos?page=${PAGE}&limit=${LIMIT}")
|
||||
|
||||
# Break if empty array
|
||||
COUNT=$(echo "$RESPONSE" | jq -r 'length')
|
||||
if [ "$COUNT" -eq 0 ]; then
|
||||
break
|
||||
fi
|
||||
|
||||
NAMES=$(echo "$RESPONSE" | jq -r '.[].name')
|
||||
ALL_REPOS="${ALL_REPOS}${NAMES}"$'\n'
|
||||
|
||||
if [ "$COUNT" -lt "$LIMIT" ]; then
|
||||
break
|
||||
fi
|
||||
|
||||
PAGE=$((PAGE + 1))
|
||||
done
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Filter for client-waas repos
|
||||
# ---------------------------------------------------------------------------
|
||||
CLIENT_REPOS=$(echo "$ALL_REPOS" | grep 'client-waas' | sort || true)
|
||||
|
||||
if [ -z "$CLIENT_REPOS" ]; then
|
||||
echo "No client-waas repos found in org '${ORG}'."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TOTAL=$(echo "$CLIENT_REPOS" | wc -l | tr -d ' ')
|
||||
echo "Found ${TOTAL} client-waas repo(s). Triggering workflow '${WORKFLOW}' (ref: ${REF}) ..."
|
||||
echo ""
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Trigger workflow for each repo
|
||||
# ---------------------------------------------------------------------------
|
||||
SUCCESS=0
|
||||
FAIL=0
|
||||
|
||||
while IFS= read -r REPO; do
|
||||
[ -z "$REPO" ] && continue
|
||||
|
||||
PAYLOAD=$(jq -n --arg ref "$REF" --argjson inputs "$INPUTS" '{ref: $ref, inputs: $inputs}')
|
||||
|
||||
HTTP_CODE=$(curl -s -o /dev/null -w '%{http_code}' \
|
||||
-X POST \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$PAYLOAD" \
|
||||
"${GITEA_URL}/api/v1/repos/${ORG}/${REPO}/actions/workflows/${WORKFLOW}/dispatches")
|
||||
|
||||
if [ "$HTTP_CODE" -eq 204 ] || [ "$HTTP_CODE" -eq 201 ]; then
|
||||
echo " [OK] ${ORG}/${REPO} (HTTP ${HTTP_CODE})"
|
||||
SUCCESS=$((SUCCESS + 1))
|
||||
else
|
||||
echo " [FAIL] ${ORG}/${REPO} (HTTP ${HTTP_CODE})"
|
||||
FAIL=$((FAIL + 1))
|
||||
fi
|
||||
done <<< "$CLIENT_REPOS"
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Summary
|
||||
# ---------------------------------------------------------------------------
|
||||
echo ""
|
||||
echo "Done. Success: ${SUCCESS} | Failed: ${FAIL} | Total: ${TOTAL}"
|
||||
|
||||
if [ "$FAIL" -gt 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Automation.CI
|
||||
# INGROUP: MokoCLI.Automation
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# INGROUP: moko-platform.Automation
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /automation/ci-issue-reporter.sh
|
||||
# VERSION: 09.23.00
|
||||
# BRIEF: Creates or updates a Gitea issue when a CI gate fails.
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.Automation
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoPlatform.Automation
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /automation/enrich_manifest_xml.php
|
||||
* BRIEF: Enrich XML manifests with repo-specific build and deploy details
|
||||
*
|
||||
@@ -46,7 +46,7 @@ class EnrichManifestXmlCli extends CliFramework
|
||||
$parser = new MokoStandardsParser();
|
||||
$tmpBase = sys_get_temp_dir() . '/moko-enrich-' . getmypid();
|
||||
|
||||
echo "=== MokoCLI XML Manifest Enrichment ===\n";
|
||||
echo "=== moko-platform XML Manifest Enrichment ===\n";
|
||||
echo "Mode: " . ($this->dryRun ? "DRY RUN" : "LIVE") . "\n";
|
||||
if (!empty($skipRepos)) {
|
||||
echo "Skipping: " . implode(', ', $skipRepos) . "\n";
|
||||
@@ -97,7 +97,7 @@ class EnrichManifestXmlCli extends CliFramework
|
||||
}
|
||||
|
||||
$manifestPath = "{$workDir}/.mokogitea/manifest.xml";
|
||||
if (!file_exists($manifestPath) || !str_contains(file_get_contents($manifestPath), '<MokoCLI')) {
|
||||
if (!file_exists($manifestPath) || !str_contains(file_get_contents($manifestPath), '<moko-platform')) {
|
||||
echo "SKIP (no XML manifest)\n";
|
||||
$stats['skipped']++;
|
||||
$this->rmTree($workDir);
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.Automation
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoPlatform.Automation
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /automation/enrich_mokostandards_xml.php
|
||||
* BRIEF: Enrich XML manifests with repo-specific build and deploy details
|
||||
*
|
||||
@@ -46,7 +46,7 @@ class EnrichMokostandardsXmlCli extends CliFramework
|
||||
$parser = new MokoStandardsParser();
|
||||
$tmpBase = sys_get_temp_dir() . '/moko-enrich-' . getmypid();
|
||||
|
||||
echo "=== MokoCLI XML Manifest Enrichment ===\n";
|
||||
echo "=== moko-platform XML Manifest Enrichment ===\n";
|
||||
echo "Mode: " . ($this->dryRun ? "DRY RUN" : "LIVE") . "\n";
|
||||
if (!empty($skipRepos)) {
|
||||
echo "Skipping: " . implode(', ', $skipRepos) . "\n";
|
||||
@@ -97,7 +97,7 @@ class EnrichMokostandardsXmlCli extends CliFramework
|
||||
}
|
||||
|
||||
$manifestPath = "{$workDir}/.mokogitea/manifest.xml";
|
||||
if (!file_exists($manifestPath) || !str_contains(file_get_contents($manifestPath), '<MokoCLI')) {
|
||||
if (!file_exists($manifestPath) || !str_contains(file_get_contents($manifestPath), '<moko-platform')) {
|
||||
echo "SKIP (no XML manifest)\n";
|
||||
$stats['skipped']++;
|
||||
$this->rmTree($workDir);
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
FILE INFORMATION
|
||||
DEFGROUP: MokoCLI.Index
|
||||
INGROUP: MokoCLI.Automation
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
DEFGROUP: MokoPlatform.Index
|
||||
INGROUP: MokoPlatform.Automation
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
PATH: /automation/index.md
|
||||
BRIEF: Automation directory index
|
||||
-->
|
||||
|
||||
@@ -8,16 +8,16 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.Automation
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoPlatform.Automation
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /automation/migrate_to_gitea.php
|
||||
* BRIEF: Migrate repositories from GitHub to self-hosted Gitea instance
|
||||
*
|
||||
* USAGE
|
||||
* php automation/migrate_to_gitea.php --dry-run
|
||||
* php automation/migrate_to_gitea.php --repos MokoCRM MokoDoliMods
|
||||
* php automation/migrate_to_gitea.php --exclude MokoCLI --skip-archived
|
||||
* php automation/migrate_to_gitea.php --exclude moko-platform --skip-archived
|
||||
* php automation/migrate_to_gitea.php --resume
|
||||
*/
|
||||
|
||||
@@ -278,7 +278,7 @@ class MigrateToGitea extends CliFramework
|
||||
try {
|
||||
$this->gitea->createIssue(
|
||||
$giteaOrg,
|
||||
'MokoCLI',
|
||||
'moko-platform',
|
||||
'chore: GitHub → Gitea migration report — ' . count($results['migrated']) . ' repos migrated',
|
||||
$report,
|
||||
['labels' => ['automation', 'type: chore']]
|
||||
|
||||
+22
-22
@@ -9,9 +9,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.Automation
|
||||
* INGROUP: MokoCLI.Scripts
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoPlatform.Automation
|
||||
* INGROUP: MokoPlatform.Scripts
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /automation/push_files.php
|
||||
* BRIEF: Push one or more specific files to one or more remote repositories
|
||||
*/
|
||||
@@ -35,7 +35,7 @@ use MokoEnterprise\{
|
||||
/**
|
||||
* Targeted File Push Tool
|
||||
*
|
||||
* Pushes one or more specific files from MokoCLI templates to one or
|
||||
* Pushes one or more specific files from moko-platform templates to one or
|
||||
* more remote repositories — without running a full sync.
|
||||
*
|
||||
* Files are specified by their destination path as they appear in the target
|
||||
@@ -81,7 +81,7 @@ class PushFiles extends CliFramework
|
||||
*/
|
||||
protected function run(): int
|
||||
{
|
||||
$this->log('📦 MokoCLI File Push v' . self::VERSION, 'INFO');
|
||||
$this->log('📦 moko-platform File Push v' . self::VERSION, 'INFO');
|
||||
|
||||
if (!$this->initializeComponents()) {
|
||||
return 1;
|
||||
@@ -337,7 +337,7 @@ class PushFiles extends CliFramework
|
||||
|
||||
$prNumber = null;
|
||||
if (!$direct) {
|
||||
$prTitle = "chore: push " . count($entries) . " file(s) from MokoCLI";
|
||||
$prTitle = "chore: push " . count($entries) . " file(s) from moko-platform";
|
||||
$prBody = $this->buildPRBody($entries);
|
||||
$pr = $this->adapter->createPullRequest(
|
||||
$org,
|
||||
@@ -414,7 +414,7 @@ class PushFiles extends CliFramework
|
||||
|
||||
$message = !empty($customMessage)
|
||||
? $customMessage
|
||||
: "chore: update {$destPath} from MokoCLI";
|
||||
: "chore: update {$destPath} from moko-platform";
|
||||
|
||||
// Fetch existing file SHA (needed for updates)
|
||||
$existingSha = null;
|
||||
@@ -457,9 +457,9 @@ class PushFiles extends CliFramework
|
||||
): void {
|
||||
$now = gmdate('Y-m-d H:i:s') . ' UTC';
|
||||
$version = self::VERSION;
|
||||
$source = $this->adapter->getRepoWebUrl($org, 'MokoCLI');
|
||||
$source = $this->adapter->getRepoWebUrl($org, 'moko-platform');
|
||||
|
||||
$title = "chore: MokoCLI file push tracking";
|
||||
$title = "chore: moko-platform file push tracking";
|
||||
|
||||
$deliveryLine = $prNumber !== null
|
||||
? "| **Pull request** | [#{$prNumber}](" . $this->adapter->getPullRequestWebUrl($org, $repo, $prNumber) . ") |"
|
||||
@@ -471,9 +471,9 @@ class PushFiles extends CliFramework
|
||||
));
|
||||
|
||||
$body = <<<MD
|
||||
## MokoCLI File Push
|
||||
## moko-platform File Push
|
||||
|
||||
One or more files were pushed to this repository from MokoCLI.
|
||||
One or more files were pushed to this repository from moko-platform.
|
||||
|
||||
| Field | Value |
|
||||
|-------|-------|
|
||||
@@ -487,12 +487,12 @@ class PushFiles extends CliFramework
|
||||
{$fileRows}
|
||||
|
||||
---
|
||||
*Generated automatically by [MokoCLI]({$source}) `push_files.php`*
|
||||
*Generated automatically by [moko-platform]({$source}) `push_files.php`*
|
||||
MD;
|
||||
|
||||
$body = preg_replace('/^ /m', '', $body);
|
||||
|
||||
$labels = ['standards-update', 'MokoCLI', 'type: chore', 'automation'];
|
||||
$labels = ['standards-update', 'moko-platform', 'type: chore', 'automation'];
|
||||
|
||||
try {
|
||||
$existing = $this->api->get("/repos/{$org}/{$repo}/issues", [
|
||||
@@ -550,7 +550,7 @@ class PushFiles extends CliFramework
|
||||
}
|
||||
|
||||
/**
|
||||
* Create or update a failure issue in MokoCLI when repos fail to receive files.
|
||||
* Create or update a failure issue in moko-platform when repos fail to receive files.
|
||||
* Uses the 'push-failure' label. Reopens a closed issue rather than creating a duplicate.
|
||||
*/
|
||||
private function createFailureIssue(string $org, array $results): void
|
||||
@@ -598,7 +598,7 @@ class PushFiles extends CliFramework
|
||||
$body = preg_replace('/^ /m', '', $body);
|
||||
|
||||
try {
|
||||
$existing = $this->api->get("/repos/{$org}/MokoCLI/issues", [
|
||||
$existing = $this->api->get("/repos/{$org}/moko-platform/issues", [
|
||||
'labels' => 'push-failure',
|
||||
'state' => 'all',
|
||||
'per_page' => 1,
|
||||
@@ -613,17 +613,17 @@ class PushFiles extends CliFramework
|
||||
if (($existing[0]['state'] ?? 'open') === 'closed') {
|
||||
$patch['state'] = 'open';
|
||||
}
|
||||
$this->api->patch("/repos/{$org}/MokoCLI/issues/{$num}", $patch);
|
||||
$this->log("🚨 Failure issue #{$num} updated: {$org}/MokoCLI#{$num}", 'WARN');
|
||||
$this->api->patch("/repos/{$org}/moko-platform/issues/{$num}", $patch);
|
||||
$this->log("🚨 Failure issue #{$num} updated: {$org}/moko-platform#{$num}", 'WARN');
|
||||
} else {
|
||||
$issue = $this->api->post("/repos/{$org}/MokoCLI/issues", [
|
||||
$issue = $this->api->post("/repos/{$org}/moko-platform/issues", [
|
||||
'title' => $title,
|
||||
'body' => $body,
|
||||
'labels' => ['push-failure'],
|
||||
'assignees' => ['jmiller'],
|
||||
]);
|
||||
$num = $issue['number'] ?? '?';
|
||||
$this->log("🚨 Failure issue created: {$org}/MokoCLI#{$num}", 'WARN');
|
||||
$this->log("🚨 Failure issue created: {$org}/moko-platform#{$num}", 'WARN');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$this->log("⚠️ Could not create/update failure issue: " . $e->getMessage(), 'WARN');
|
||||
@@ -638,14 +638,14 @@ class PushFiles extends CliFramework
|
||||
private function buildPRBody(array $entries): string
|
||||
{
|
||||
$now = gmdate('Y-m-d H:i:s') . ' UTC';
|
||||
$lines = ["## MokoCLI File Push\n", "**Pushed:** {$now}\n", '### Files\n'];
|
||||
$lines = ["## moko-platform File Push\n", "**Pushed:** {$now}\n", '### Files\n'];
|
||||
|
||||
foreach ($entries as $entry) {
|
||||
$lines[] = "- `{$entry['destination']}`";
|
||||
}
|
||||
|
||||
$sourceUrl = $this->adapter->getRepoWebUrl(self::DEFAULT_ORG, 'MokoCLI');
|
||||
$lines[] = "\n---\n*Generated by [MokoCLI]({$sourceUrl}) `push_files.php`*";
|
||||
$sourceUrl = $this->adapter->getRepoWebUrl(self::DEFAULT_ORG, 'moko-platform');
|
||||
$lines[] = "\n---\n*Generated by [moko-platform]({$sourceUrl}) `push_files.php`*";
|
||||
|
||||
return implode("\n", $lines);
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.Automation
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoPlatform.Automation
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /automation/push_manifest_xml.php
|
||||
* BRIEF: Push XML manifests to all governed repositories
|
||||
*/
|
||||
@@ -47,7 +47,7 @@ class PushManifestXmlCli extends CliFramework
|
||||
$parser = new MokoStandardsParser();
|
||||
$tmpBase = sys_get_temp_dir() . '/moko-manifest-push-' . getmypid();
|
||||
|
||||
echo "=== MokoCLI XML Manifest Push ===\n";
|
||||
echo "=== moko-platform XML Manifest Push ===\n";
|
||||
echo "Org: {$giteaOrg}\n";
|
||||
echo "Mode: " . ($this->dryRun ? "DRY RUN" : "LIVE") . "\n";
|
||||
if ($repoFilter) {
|
||||
@@ -125,7 +125,7 @@ class PushManifestXmlCli extends CliFramework
|
||||
|
||||
// Check if already XML and up-to-date
|
||||
$manifestPath = "{$workDir}/.mokogitea/manifest.xml";
|
||||
$existingIsXml = file_exists($manifestPath) && str_contains(file_get_contents($manifestPath), '<MokoCLI');
|
||||
$existingIsXml = file_exists($manifestPath) && str_contains(file_get_contents($manifestPath), '<moko-platform');
|
||||
if ($existingIsXml && !$force) {
|
||||
$existingPlatform = $parser->extractPlatform(file_get_contents($manifestPath));
|
||||
if ($existingPlatform === $platform) {
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.Automation
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoPlatform.Automation
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /automation/push_mokostandards_xml.php
|
||||
* BRIEF: Push XML manifests to all governed repositories
|
||||
*/
|
||||
@@ -47,7 +47,7 @@ class PushMokostandardsXmlCli extends CliFramework
|
||||
$parser = new MokoStandardsParser();
|
||||
$tmpBase = sys_get_temp_dir() . '/moko-manifest-push-' . getmypid();
|
||||
|
||||
echo "=== MokoCLI XML Manifest Push ===\n";
|
||||
echo "=== moko-platform XML Manifest Push ===\n";
|
||||
echo "Org: {$giteaOrg}\n";
|
||||
echo "Mode: " . ($this->dryRun ? "DRY RUN" : "LIVE") . "\n";
|
||||
if ($repoFilter) {
|
||||
@@ -125,7 +125,7 @@ class PushMokostandardsXmlCli extends CliFramework
|
||||
|
||||
// Check if already XML and up-to-date
|
||||
$manifestPath = "{$workDir}/.mokogitea/manifest.xml";
|
||||
$existingIsXml = file_exists($manifestPath) && str_contains(file_get_contents($manifestPath), '<MokoCLI');
|
||||
$existingIsXml = file_exists($manifestPath) && str_contains(file_get_contents($manifestPath), '<moko-platform');
|
||||
if ($existingIsXml && !$force) {
|
||||
$existingPlatform = $parser->extractPlatform(file_get_contents($manifestPath));
|
||||
if ($existingPlatform === $platform) {
|
||||
|
||||
+11
-11
@@ -9,9 +9,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.Automation
|
||||
* INGROUP: MokoCLI.Scripts
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoPlatform.Automation
|
||||
* INGROUP: MokoPlatform.Scripts
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /automation/repo_cleanup.php
|
||||
* BRIEF: Enterprise repository cleanup — branches, PRs, issues, workflows, labels, logs
|
||||
*/
|
||||
@@ -39,14 +39,14 @@ use MokoEnterprise\{ApiClient, AuditLogger, CliFramework, Config, GitPlatformAda
|
||||
class RepoCleanup extends CliFramework
|
||||
{
|
||||
private const VERSION = '09.23.00';
|
||||
private const SYNC_PREFIX = 'chore/sync-MokoCLI-';
|
||||
private const CURRENT_BRANCH = 'chore/sync-MokoCLI-v04.02.00';
|
||||
private const SYNC_PREFIX = 'chore/sync-moko-platform-';
|
||||
private const CURRENT_BRANCH = 'chore/sync-moko-platform-v04.02.00';
|
||||
|
||||
/** Workflow files that have been retired and should be deleted from governed repos. */
|
||||
private const RETIRED_WORKFLOWS = [
|
||||
'build.yml', 'code-quality.yml', 'release-cycle.yml', 'release-pipeline.yml',
|
||||
'branch-cleanup.yml', 'auto-update-changelog.yml', 'enterprise-issue-manager.yml',
|
||||
'flush-actions-cache.yml', 'MokoCLI-script-runner.yml', 'unified-ci.yml',
|
||||
'flush-actions-cache.yml', 'moko-platform-script-runner.yml', 'unified-ci.yml',
|
||||
'unified-platform-testing.yml', 'reusable-build.yml', 'reusable-ci-validation.yml',
|
||||
'reusable-deploy.yml', 'reusable-php-quality.yml', 'reusable-platform-testing.yml',
|
||||
'reusable-project-detector.yml', 'reusable-release.yml', 'reusable-script-executor.yml',
|
||||
@@ -98,7 +98,7 @@ class RepoCleanup extends CliFramework
|
||||
}
|
||||
|
||||
|
||||
$this->logMsg("🧹 MokoCLI Repository Cleanup v" . self::VERSION);
|
||||
$this->logMsg("🧹 moko-platform Repository Cleanup v" . self::VERSION);
|
||||
$this->logMsg("Organization: {$org}");
|
||||
$this->logMsg("Current sync branch: " . self::CURRENT_BRANCH);
|
||||
if ($this->dryRun) {
|
||||
@@ -225,7 +225,7 @@ class RepoCleanup extends CliFramework
|
||||
}
|
||||
|
||||
$allRepos = $this->adapter->listOrgRepos($org, $skipArchived);
|
||||
return array_filter($allRepos, fn($r) => !in_array($r['name'], ['MokoCLI', '.github-private'], true));
|
||||
return array_filter($allRepos, fn($r) => !in_array($r['name'], ['moko-platform', '.github-private'], true));
|
||||
}
|
||||
|
||||
// ─── Cleanup operations ──────────────────────────────────────────────
|
||||
@@ -463,9 +463,9 @@ class RepoCleanup extends CliFramework
|
||||
private function checkLabels(string $org, string $repo, array &$results): void
|
||||
{
|
||||
try {
|
||||
$this->api->get("/repos/{$org}/{$repo}/labels/MokoCLI");
|
||||
$this->api->get("/repos/{$org}/{$repo}/labels/moko-platform");
|
||||
} catch (\Exception $e) {
|
||||
$this->logMsg(" ⚠️ Missing 'MokoCLI' label");
|
||||
$this->logMsg(" ⚠️ Missing 'moko-platform' label");
|
||||
$results['labels_missing']++;
|
||||
$this->api->resetCircuitBreaker();
|
||||
}
|
||||
@@ -479,7 +479,7 @@ class RepoCleanup extends CliFramework
|
||||
if (preg_match('/^\s*VERSION:\s*(\d{2}\.\d{2}\.\d{2})/m', $content, $m)) {
|
||||
$version = $m[1];
|
||||
|
||||
// Check manifest.xml for the tracked MokoCLI version
|
||||
// Check manifest.xml for the tracked moko-platform version
|
||||
try {
|
||||
$mokoFile = $this->api->get("/repos/{$org}/{$repo}/contents/.mokogitea/manifest.xml");
|
||||
$mokoContent = base64_decode($mokoFile['content'] ?? '');
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# DEFGROUP: MokoCLI.Automation.ServerAutoheal
|
||||
# INGROUP: MokoCLI.Automation
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
# DEFGROUP: MokoPlatform.Automation.ServerAutoheal
|
||||
# INGROUP: MokoPlatform.Automation
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /automation/server-autoheal.sh
|
||||
# BRIEF: Server auto-heal on unclean restart + split system/content backups
|
||||
#
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoStandards.CLI
|
||||
* INGROUP: MokoStandards
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /bin/moko
|
||||
* BRIEF: Unified CLI dispatcher — run any MokoCLI script without needing GitHub Actions
|
||||
* BRIEF: Unified CLI dispatcher — run any MokoStandards script without needing GitHub Actions
|
||||
*
|
||||
* USAGE
|
||||
* php bin/moko <command> [options] (all platforms)
|
||||
@@ -292,10 +292,10 @@ function printHelp(): void
|
||||
{
|
||||
echo <<<'HELP'
|
||||
╔══════════════════════════════════════════════════════════╗
|
||||
║ MokoCLI (bin/moko) ║
|
||||
║ MokoStandards CLI (bin/moko) ║
|
||||
╚══════════════════════════════════════════════════════════╝
|
||||
|
||||
Run any MokoCLI script locally without GitHub Actions.
|
||||
Run any MokoStandards script locally without GitHub Actions.
|
||||
|
||||
USAGE
|
||||
php bin/moko <command> [options] (all platforms)
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/archive_repo.php
|
||||
* BRIEF: Gracefully retire a governed repository — archive, close issues/PRs, remove sync def
|
||||
*/
|
||||
@@ -135,7 +135,7 @@ class ArchiveRepoCli extends CliFramework
|
||||
try {
|
||||
$issue = $adapter->createIssue(
|
||||
$org,
|
||||
'MokoCLI',
|
||||
'moko-platform',
|
||||
"chore: archived repository {$repoName}",
|
||||
"## Repository Archived\n\n"
|
||||
. "**Repository:** `{$org}/{$repoName}`\n"
|
||||
@@ -150,7 +150,7 @@ class ArchiveRepoCli extends CliFramework
|
||||
]
|
||||
);
|
||||
if (isset($issue['number'])) {
|
||||
echo " Archival record: MokoCLI#{$issue['number']}\n";
|
||||
echo " Archival record: moko-platform#{$issue['number']}\n";
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
echo " Warning: could not create archival record: " . $e->getMessage() . "\n";
|
||||
|
||||
+3
-3
@@ -14,9 +14,9 @@
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.Enterprise.CLI
|
||||
* INGROUP: MokoCLI.Enterprise
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoPlatform.Enterprise.CLI
|
||||
* INGROUP: MokoPlatform.Enterprise
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/audit_query.php
|
||||
* BRIEF: Search, filter, and export audit logs
|
||||
*/
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/badge_update.php
|
||||
* BRIEF: Update [VERSION: XX.XX.XX] badges in all markdown files
|
||||
*/
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/branch_rename.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Rename a git branch via Gitea API (create new, update PR, delete old)
|
||||
*/
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/bulk_workflow_push.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Push a workflow file to all governed repos via the Gitea Contents API
|
||||
*/
|
||||
|
||||
@@ -154,7 +154,7 @@ class BulkWorkflowPushCli extends CliFramework
|
||||
'content' => $encodedContent,
|
||||
'sha' => $remoteSha,
|
||||
'message' => "chore: sync {$destPath} "
|
||||
. "from MokoCLI [skip ci]",
|
||||
. "from moko-platform [skip ci]",
|
||||
'branch' => $branch,
|
||||
]);
|
||||
|
||||
@@ -184,7 +184,7 @@ class BulkWorkflowPushCli extends CliFramework
|
||||
$payload = json_encode([
|
||||
'content' => $encodedContent,
|
||||
'message' => "chore: add {$destPath} "
|
||||
. "from MokoCLI [skip ci]",
|
||||
. "from moko-platform [skip ci]",
|
||||
'branch' => $branch,
|
||||
]);
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/bulk_workflow_trigger.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Trigger a workflow across multiple repos at once
|
||||
*/
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/changelog_promote.php
|
||||
* BRIEF: Promote [Unreleased] section in CHANGELOG.md to a versioned entry
|
||||
*/
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/changelog_prune.php
|
||||
* BRIEF: Prune old CHANGELOG.md entries — keeps [Unreleased] + last N releases
|
||||
*/
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/client_dashboard.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Generate unified client dashboard HTML
|
||||
*/
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/client_health_check.php
|
||||
* BRIEF: Verify a client site's update server, installed version, and release availability
|
||||
*/
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/client_inventory.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Discover and list all client-waas repos with their server configuration status
|
||||
*/
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/client_provision.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Provision a new client environment end-to-end
|
||||
*/
|
||||
|
||||
|
||||
+3
-3
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/completion.php
|
||||
* BRIEF: Generate bash/zsh tab completion scripts for bin/moko
|
||||
*/
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/create_project.php
|
||||
* BRIEF: Create baseline GitHub Projects for repositories with standard fields and views
|
||||
*/
|
||||
@@ -24,7 +24,7 @@ use MokoEnterprise\CliFramework;
|
||||
class CreateProjectCli extends CliFramework
|
||||
{
|
||||
/** @var string[] */
|
||||
private array $ALWAYS_EXCLUDE = ['MokoCLI', '.github-private'];
|
||||
private array $ALWAYS_EXCLUDE = ['moko-platform', '.github-private'];
|
||||
|
||||
/** @var array<string, string> */
|
||||
private array $PLATFORM_TO_TYPE = [
|
||||
@@ -183,7 +183,7 @@ class CreateProjectCli extends CliFramework
|
||||
CURLOPT_HTTPHEADER => [
|
||||
'Authorization: bearer ' . $token,
|
||||
'Content-Type: application/json',
|
||||
'User-Agent: MokoCLI-CreateProject',
|
||||
'User-Agent: moko-platform-CreateProject',
|
||||
],
|
||||
]);
|
||||
$body = (string) curl_exec($ch);
|
||||
@@ -422,14 +422,14 @@ class CreateProjectCli extends CliFramework
|
||||
updateProjectV2(input: {
|
||||
projectId: $projectId,
|
||||
shortDescription: $shortDescription,
|
||||
readme: "Managed by MokoCLI. Run `php cli/create_project.php` to regenerate."
|
||||
readme: "Managed by moko-platform. Run `php cli/create_project.php` to regenerate."
|
||||
}) {
|
||||
projectV2 { id }
|
||||
}
|
||||
}',
|
||||
[
|
||||
'projectId' => $projectId,
|
||||
'shortDescription' => "Standard project board for {$repo}. Auto-created by MokoCLI.",
|
||||
'shortDescription' => "Standard project board for {$repo}. Auto-created by moko-platform.",
|
||||
],
|
||||
$token
|
||||
);
|
||||
|
||||
+17
-17
@@ -8,11 +8,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/create_repo.php
|
||||
* BRIEF: Scaffold a new governed repository with full MokoCLI baseline
|
||||
* BRIEF: Scaffold a new governed repository with full moko-platform baseline
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
@@ -28,7 +28,7 @@ class CreateRepoCli extends CliFramework
|
||||
{
|
||||
protected function configure(): void
|
||||
{
|
||||
$this->setDescription('Scaffold a new governed repository with full MokoCLI baseline');
|
||||
$this->setDescription('Scaffold a new governed repository with full moko-platform baseline');
|
||||
$this->addArgument('--name', 'Repository name', null);
|
||||
$this->addArgument('--type', 'Project type', null);
|
||||
$this->addArgument('--description', 'Repository description', '');
|
||||
@@ -60,16 +60,16 @@ class CreateRepoCli extends CliFramework
|
||||
'generic' => 'generic',
|
||||
];
|
||||
$TYPE_TO_TOPICS = [
|
||||
'dolibarr' => ['dolibarr', 'erp', 'crm', 'php', 'MokoCLI'],
|
||||
'joomla' => ['joomla', 'cms', 'php', 'MokoCLI'],
|
||||
'nodejs' => ['nodejs', 'javascript', 'typescript', 'MokoCLI'],
|
||||
'terraform' => ['terraform', 'infrastructure', 'iac', 'MokoCLI'],
|
||||
'python' => ['python', 'MokoCLI'],
|
||||
'wordpress' => ['wordpress', 'php', 'cms', 'MokoCLI'],
|
||||
'generic' => ['MokoCLI'],
|
||||
'dolibarr' => ['dolibarr', 'erp', 'crm', 'php', 'moko-platform'],
|
||||
'joomla' => ['joomla', 'cms', 'php', 'moko-platform'],
|
||||
'nodejs' => ['nodejs', 'javascript', 'typescript', 'moko-platform'],
|
||||
'terraform' => ['terraform', 'infrastructure', 'iac', 'moko-platform'],
|
||||
'python' => ['python', 'moko-platform'],
|
||||
'wordpress' => ['wordpress', 'php', 'cms', 'moko-platform'],
|
||||
'generic' => ['moko-platform'],
|
||||
];
|
||||
$platform = $TYPE_TO_PLATFORM[$type] ?? 'generic';
|
||||
$topics = $TYPE_TO_TOPICS[$type] ?? ['MokoCLI'];
|
||||
$topics = $TYPE_TO_TOPICS[$type] ?? ['moko-platform'];
|
||||
$platformName = $adapter->getPlatformName();
|
||||
$vis = $private ? 'private' : 'public';
|
||||
echo "Scaffolding new repository: {$org}/{$name}"
|
||||
@@ -84,7 +84,7 @@ class CreateRepoCli extends CliFramework
|
||||
if (!$this->dryRun) {
|
||||
try {
|
||||
$data = $adapter->createOrgRepo($org, $name, [
|
||||
'description' => $description ?: "Managed by MokoCLI ({$type})",
|
||||
'description' => $description ?: "Managed by moko-platform ({$type})",
|
||||
'private' => $private,
|
||||
'has_issues' => true,
|
||||
'has_projects' => true,
|
||||
@@ -143,7 +143,7 @@ class CreateRepoCli extends CliFramework
|
||||
. "Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>\n"
|
||||
. "SPDX-License-Identifier: GPL-3.0-or-later\n"
|
||||
. "DEFGROUP: {$name}\n"
|
||||
. "INGROUP: MokoCLI\n"
|
||||
. "INGROUP: moko-platform\n"
|
||||
. "REPO: {$repoUrl}\n"
|
||||
. "PATH: /README.md\n"
|
||||
. "BRIEF: {$description}\n"
|
||||
@@ -152,7 +152,7 @@ class CreateRepoCli extends CliFramework
|
||||
. "{$description}\n\n"
|
||||
. "## Getting Started\n\n"
|
||||
. "This repository is governed by"
|
||||
. " [MokoCLI]({$standardsUrl}).\n\n"
|
||||
. " [moko-platform]({$standardsUrl}).\n\n"
|
||||
. "## License\n\n"
|
||||
. "GPL-3.0-or-later. See [LICENSE](LICENSE)"
|
||||
. " for details.\n";
|
||||
@@ -169,7 +169,7 @@ class CreateRepoCli extends CliFramework
|
||||
$name,
|
||||
'README.md',
|
||||
$readmeContent,
|
||||
'docs: initialize README with MokoCLI header [skip ci]',
|
||||
'docs: initialize README with moko-platform header [skip ci]',
|
||||
$sha
|
||||
);
|
||||
echo " README.md created\n";
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoPlatform.CLI
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/deploy_joomla.php
|
||||
* BRIEF: Smart Joomla deploy — routes files to correct server directories by extension type
|
||||
*
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/dev_branch_reset.php
|
||||
* BRIEF: Delete and recreate dev branch from main via Gitea API
|
||||
*/
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/grafana_dashboard.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Manage Grafana dashboards via API
|
||||
*/
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/joomla_build.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Build a Joomla extension ZIP from manifest — all types supported
|
||||
* NOTE: Called by pre-release and auto-release workflows.
|
||||
*/
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/joomla_compat_check.php
|
||||
* BRIEF: Check if extension targetplatform regex matches the latest Joomla version
|
||||
*/
|
||||
|
||||
@@ -1,472 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/* Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* PATH: /cli/joomla_metadata_validate.php
|
||||
* VERSION: 09.25.05
|
||||
* BRIEF: Validate MokoGitea repo metadata against Joomla extension manifest XML
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/../lib/Enterprise/CliFramework.php';
|
||||
|
||||
use MokoEnterprise\CliFramework;
|
||||
|
||||
class JoomlaMetadataValidateCli extends CliFramework
|
||||
{
|
||||
/** Joomla element prefix map — must match MokoGitea's cleanJoomlaElement() */
|
||||
private const JOOMLA_PREFIX = [
|
||||
'package' => 'pkg_',
|
||||
'component' => 'com_',
|
||||
'module' => 'mod_',
|
||||
'template' => 'tpl_',
|
||||
'library' => 'lib_',
|
||||
'file' => 'file_',
|
||||
];
|
||||
|
||||
protected function configure(): void
|
||||
{
|
||||
$this->setDescription('Validate MokoGitea repo metadata against Joomla extension manifest XML');
|
||||
$this->addArgument('--path', 'Repo root path (default: current directory)', '.');
|
||||
$this->addArgument('--token', 'Gitea API token (or GITEA_TOKEN env)', '');
|
||||
$this->addArgument('--org', 'Gitea org', 'MokoConsulting');
|
||||
$this->addArgument('--repo', 'Repo name (auto-detected from git if empty)', '');
|
||||
$this->addArgument('--api-base', 'Gitea API base URL', 'https://git.mokoconsulting.tech/api/v1');
|
||||
$this->addArgument('--ci', 'CI mode: exit 1 on any error', false);
|
||||
$this->addArgument('--json', 'Output as JSON', false);
|
||||
}
|
||||
|
||||
protected function run(): int
|
||||
{
|
||||
$path = realpath($this->getArgument('--path')) ?: $this->getArgument('--path');
|
||||
$token = $this->getArgument('--token') ?: getenv('GITEA_TOKEN') ?: '';
|
||||
$org = $this->getArgument('--org');
|
||||
$repoName = $this->getArgument('--repo');
|
||||
$apiBase = rtrim($this->getArgument('--api-base'), '/');
|
||||
$ciMode = (bool) $this->getArgument('--ci');
|
||||
$jsonMode = (bool) $this->getArgument('--json');
|
||||
|
||||
if (!is_dir($path)) {
|
||||
$this->log('ERROR', "Path does not exist: {$path}");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ($repoName === '') {
|
||||
$repoName = $this->detectRepoName($path);
|
||||
}
|
||||
|
||||
// ── Step 1: Find the Joomla extension manifest XML ──────────
|
||||
$joomlaXml = $this->findJoomlaManifest($path);
|
||||
|
||||
if ($joomlaXml === null) {
|
||||
$this->log('ERROR', 'No Joomla extension manifest XML found');
|
||||
return 1;
|
||||
}
|
||||
|
||||
$this->log('INFO', "Joomla manifest: {$joomlaXml['path']}");
|
||||
|
||||
// ── Step 2: Load MokoGitea metadata ─────────────────────────
|
||||
$metadata = $this->loadMetadata($path, $org, $repoName, $token, $apiBase);
|
||||
|
||||
if ($metadata === null) {
|
||||
$this->log('ERROR', 'Could not load MokoGitea metadata');
|
||||
return 1;
|
||||
}
|
||||
|
||||
// ── Step 3: Compare ─────────────────────────────────────────
|
||||
$results = $this->compare($metadata, $joomlaXml, $path);
|
||||
|
||||
// ── Step 4: Output ──────────────────────────────────────────
|
||||
if ($jsonMode) {
|
||||
echo json_encode([
|
||||
'repo' => $repoName,
|
||||
'results' => $results,
|
||||
], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";
|
||||
} else {
|
||||
$this->printResults($repoName, $results);
|
||||
}
|
||||
|
||||
$errors = count(array_filter($results, fn($r) => $r['status'] === 'error'));
|
||||
|
||||
return ($ciMode && $errors > 0) ? 1 : 0;
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
// Find Joomla manifest XML
|
||||
// =================================================================
|
||||
|
||||
private function findJoomlaManifest(string $root): ?array
|
||||
{
|
||||
// Search common locations for a Joomla extension manifest
|
||||
$candidates = [];
|
||||
|
||||
// Package manifest: source/pkg_*.xml
|
||||
foreach (glob("{$root}/source/pkg_*.xml") as $file) {
|
||||
$candidates[] = $file;
|
||||
}
|
||||
|
||||
// Component manifest: source/packages/com_*/[name].xml
|
||||
foreach (glob("{$root}/source/packages/com_*/*.xml") as $file) {
|
||||
$basename = basename($file);
|
||||
// Skip access.xml, config.xml, etc.
|
||||
if (in_array($basename, ['access.xml', 'config.xml'], true)) {
|
||||
continue;
|
||||
}
|
||||
$candidates[] = $file;
|
||||
}
|
||||
|
||||
// Direct source/*.xml
|
||||
foreach (glob("{$root}/source/*.xml") as $file) {
|
||||
if (basename($file) !== 'pkg_mokosuitebackup.xml') {
|
||||
// Already caught above
|
||||
}
|
||||
$candidates[] = $file;
|
||||
}
|
||||
|
||||
// src/ fallback
|
||||
foreach (glob("{$root}/src/pkg_*.xml") as $file) {
|
||||
$candidates[] = $file;
|
||||
}
|
||||
|
||||
// Find the first one that has <extension type="...">
|
||||
foreach (array_unique($candidates) as $file) {
|
||||
$content = file_get_contents($file);
|
||||
if ($content === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (preg_match('/<extension\s[^>]*type=["\']([^"\']+)["\']/', $content, $typeMatch)) {
|
||||
$xml = @simplexml_load_string($content);
|
||||
if ($xml === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$type = strtolower($typeMatch[1]);
|
||||
$relPath = str_replace($root . '/', '', $file);
|
||||
$relPath = str_replace($root . '\\', '', $relPath);
|
||||
|
||||
return [
|
||||
'path' => $relPath,
|
||||
'type' => $type,
|
||||
'xml' => $xml,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
// Load metadata (from API)
|
||||
// =================================================================
|
||||
|
||||
private function loadMetadata(string $root, string $org, string $repoName, string $token, string $apiBase): ?array
|
||||
{
|
||||
if ($token !== '') {
|
||||
$url = "{$apiBase}/repos/{$org}/{$repoName}/metadata";
|
||||
$ctx = stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Authorization: token {$token}\r\nAccept: application/json\r\n",
|
||||
'timeout' => 10,
|
||||
],
|
||||
]);
|
||||
|
||||
$body = @file_get_contents($url, false, $ctx);
|
||||
|
||||
if ($body !== false) {
|
||||
$data = json_decode($body, true);
|
||||
if (is_array($data)) {
|
||||
$data['source'] = 'api';
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
// Compare metadata against Joomla manifest
|
||||
// =================================================================
|
||||
|
||||
private function compare(array $metadata, array $joomlaXml, string $root): array
|
||||
{
|
||||
$results = [];
|
||||
$xml = $joomlaXml['xml'];
|
||||
$type = $joomlaXml['type'];
|
||||
|
||||
// 1. Extension type
|
||||
$metaType = $this->normalizeExtensionType($metadata['extension_type'] ?? '');
|
||||
$results[] = [
|
||||
'field' => 'extension_type',
|
||||
'metadata' => $metaType,
|
||||
'joomla' => $type,
|
||||
'status' => ($metaType === $type) ? 'ok' : 'error',
|
||||
'message' => ($metaType === $type)
|
||||
? "matches <extension type=\"{$type}\">"
|
||||
: "metadata has \"{$metaType}\" but Joomla manifest has \"{$type}\"",
|
||||
];
|
||||
|
||||
// 2. Element name
|
||||
$metaName = strtolower($metadata['name'] ?? '');
|
||||
$metaElement = $this->deriveElement($metaType, $metaName);
|
||||
$joomlaElement = $this->extractJoomlaElement($xml, $type);
|
||||
|
||||
$elementMatch = ($metaElement === $joomlaElement);
|
||||
$results[] = [
|
||||
'field' => 'element',
|
||||
'metadata' => $metaElement,
|
||||
'joomla' => $joomlaElement,
|
||||
'status' => $elementMatch ? 'ok' : 'error',
|
||||
'message' => $elementMatch
|
||||
? "derived correctly"
|
||||
: "metadata derives \"{$metaElement}\" but Joomla uses \"{$joomlaElement}\"",
|
||||
];
|
||||
|
||||
// 3. Version
|
||||
$metaVersion = $metadata['version'] ?? '';
|
||||
$joomlaVersion = (string) ($xml->version ?? '');
|
||||
|
||||
if ($metaVersion !== '' && $joomlaVersion !== '') {
|
||||
// Strip dev/rc suffixes for comparison (CI bumps these)
|
||||
$metaBase = preg_replace('/-(dev|rc|alpha|beta)\d*$/', '', $metaVersion);
|
||||
$joomlaBase = preg_replace('/-(dev|rc|alpha|beta)\d*$/', '', $joomlaVersion);
|
||||
$versionMatch = ($metaBase === $joomlaBase);
|
||||
|
||||
$results[] = [
|
||||
'field' => 'version',
|
||||
'metadata' => $metaVersion,
|
||||
'joomla' => $joomlaVersion,
|
||||
'status' => $versionMatch ? 'ok' : 'warn',
|
||||
'message' => $versionMatch
|
||||
? 'matches (base version)'
|
||||
: "metadata has \"{$metaVersion}\" but Joomla has \"{$joomlaVersion}\"",
|
||||
];
|
||||
}
|
||||
|
||||
// 4. PHP minimum (from composer.json)
|
||||
$composerPhp = $this->readComposerPhpRequirement($root);
|
||||
$metaPhp = $metadata['php_minimum'] ?? '';
|
||||
|
||||
if ($composerPhp !== '' && $metaPhp !== '') {
|
||||
$phpMatch = ($metaPhp === $composerPhp);
|
||||
$results[] = [
|
||||
'field' => 'php_minimum',
|
||||
'metadata' => $metaPhp,
|
||||
'joomla' => $composerPhp . ' (composer.json)',
|
||||
'status' => $phpMatch ? 'ok' : 'warn',
|
||||
'message' => $phpMatch
|
||||
? 'matches composer.json'
|
||||
: "metadata has \"{$metaPhp}\" but composer.json requires \"{$composerPhp}\"",
|
||||
];
|
||||
}
|
||||
|
||||
// 5. Description
|
||||
$metaDesc = $metadata['description'] ?? '';
|
||||
$joomlaDesc = (string) ($xml->description ?? '');
|
||||
|
||||
// Joomla descriptions are often language keys, skip those
|
||||
if ($metaDesc !== '' && $joomlaDesc !== '' && !str_starts_with($joomlaDesc, 'COM_') && !str_starts_with($joomlaDesc, 'PKG_')) {
|
||||
$descMatch = ($metaDesc === $joomlaDesc);
|
||||
$results[] = [
|
||||
'field' => 'description',
|
||||
'metadata' => substr($metaDesc, 0, 60) . (strlen($metaDesc) > 60 ? '...' : ''),
|
||||
'joomla' => substr($joomlaDesc, 0, 60) . (strlen($joomlaDesc) > 60 ? '...' : ''),
|
||||
'status' => $descMatch ? 'ok' : 'info',
|
||||
'message' => $descMatch ? 'matches' : 'descriptions differ (informational)',
|
||||
];
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
// Helpers
|
||||
// =================================================================
|
||||
|
||||
/**
|
||||
* Normalize extension_type — map MokoGitea types to Joomla types.
|
||||
*/
|
||||
private function normalizeExtensionType(string $type): string
|
||||
{
|
||||
return match (strtolower($type)) {
|
||||
'joomla-extension' => 'package', // legacy mapping
|
||||
default => strtolower($type),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Derive the Joomla element name from type + name.
|
||||
* Replicates MokoGitea's cleanJoomlaElement() + prefix logic.
|
||||
*/
|
||||
private function deriveElement(string $type, string $name): string
|
||||
{
|
||||
// Clean: lowercase, strip non-alphanumeric except . _ -
|
||||
$clean = strtolower($name);
|
||||
$clean = preg_replace('/[^a-z0-9._-]/', '', $clean);
|
||||
|
||||
$prefix = self::JOOMLA_PREFIX[$type] ?? '';
|
||||
|
||||
return $prefix . $clean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract the element name from a Joomla manifest XML.
|
||||
* Follows the same logic as Joomla's InstallerAdapter::getElement().
|
||||
*/
|
||||
private function extractJoomlaElement(\SimpleXMLElement $xml, string $type): string
|
||||
{
|
||||
switch ($type) {
|
||||
case 'package':
|
||||
$packagename = (string) ($xml->packagename ?? '');
|
||||
if ($packagename !== '') {
|
||||
return 'pkg_' . strtolower(preg_replace('/[^a-zA-Z0-9._-]/', '', $packagename));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'component':
|
||||
$element = (string) ($xml->element ?? '');
|
||||
if ($element !== '') {
|
||||
$element = strtolower($element);
|
||||
return str_starts_with($element, 'com_') ? $element : 'com_' . $element;
|
||||
}
|
||||
$name = (string) ($xml->name ?? '');
|
||||
$name = strtolower(preg_replace('/[^a-zA-Z0-9._-]/', '', $name));
|
||||
return str_starts_with($name, 'com_') ? $name : 'com_' . $name;
|
||||
|
||||
case 'module':
|
||||
$element = (string) ($xml->element ?? '');
|
||||
if ($element !== '') {
|
||||
return strtolower($element);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'plugin':
|
||||
// Plugins derive element from the file attribute
|
||||
if (isset($xml->files)) {
|
||||
foreach ($xml->files->children() as $file) {
|
||||
$plugin = (string) ($file->attributes()->plugin ?? '');
|
||||
if ($plugin !== '') {
|
||||
return strtolower($plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'library':
|
||||
$libname = (string) ($xml->libraryname ?? '');
|
||||
if ($libname !== '') {
|
||||
return strtolower($libname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Fallback: use <name> tag
|
||||
$name = (string) ($xml->name ?? '');
|
||||
return strtolower(preg_replace('/[^a-zA-Z0-9._-]/', '', $name));
|
||||
}
|
||||
|
||||
/**
|
||||
* Read PHP version requirement from composer.json.
|
||||
*/
|
||||
private function readComposerPhpRequirement(string $root): string
|
||||
{
|
||||
$composerFile = "{$root}/composer.json";
|
||||
|
||||
if (!is_file($composerFile)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$data = json_decode(file_get_contents($composerFile), true);
|
||||
|
||||
if (!is_array($data)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$phpReq = $data['require']['php'] ?? '';
|
||||
|
||||
// Extract version number from constraint like ">=8.1"
|
||||
if (preg_match('/(\d+\.\d+)/', $phpReq, $m)) {
|
||||
return $m[1];
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
private function detectRepoName(string $root): string
|
||||
{
|
||||
$gitConfig = "{$root}/.git/config";
|
||||
|
||||
if (!file_exists($gitConfig)) {
|
||||
return basename($root);
|
||||
}
|
||||
|
||||
$content = file_get_contents($gitConfig);
|
||||
|
||||
if (preg_match('/url\s*=\s*.*\/([^\/\s]+?)(?:\.git)?\s*$/m', $content, $m)) {
|
||||
return $m[1];
|
||||
}
|
||||
|
||||
return basename($root);
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
// Output
|
||||
// =================================================================
|
||||
|
||||
private function printResults(string $repoName, array $results): void
|
||||
{
|
||||
$errors = count(array_filter($results, fn($r) => $r['status'] === 'error'));
|
||||
$warns = count(array_filter($results, fn($r) => $r['status'] === 'warn'));
|
||||
$oks = count(array_filter($results, fn($r) => $r['status'] === 'ok'));
|
||||
|
||||
$this->log('INFO', "Validating {$repoName} Joomla metadata...\n");
|
||||
|
||||
foreach ($results as $r) {
|
||||
$icon = match ($r['status']) {
|
||||
'ok' => "\xE2\x9C\x93", // ✓
|
||||
'error' => "\xE2\x9C\x97", // ✗
|
||||
'warn' => "\xE2\x9A\xA0", // ⚠
|
||||
default => "\xE2\x84\xB9", // ℹ
|
||||
};
|
||||
|
||||
$line = sprintf(
|
||||
" %s %-16s %s",
|
||||
$icon,
|
||||
$r['field'],
|
||||
$r['message']
|
||||
);
|
||||
|
||||
$this->log(
|
||||
match ($r['status']) {
|
||||
'error' => 'ERROR',
|
||||
'warn' => 'WARN',
|
||||
'ok' => 'OK',
|
||||
default => 'INFO',
|
||||
},
|
||||
$line
|
||||
);
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
|
||||
if ($errors > 0) {
|
||||
$this->log('ERROR', "{$errors} error(s) — update delivery will fail");
|
||||
} elseif ($warns > 0) {
|
||||
$this->log('WARN', "All critical checks passed, {$warns} warning(s)");
|
||||
} else {
|
||||
$this->log('OK', "All {$oks} checks passed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$app = new JoomlaMetadataValidateCli();
|
||||
exit($app->execute());
|
||||
@@ -8,9 +8,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/joomla_release.php
|
||||
* BRIEF: Joomla release pipeline — build ZIP+tar.gz, upload to GitHub Release, update updates.xml
|
||||
*
|
||||
@@ -407,7 +407,7 @@ class JoomlaRelease extends CliFramework
|
||||
$this->api->post("/repos/{$repo}/releases", [
|
||||
'tag_name' => $tag,
|
||||
'name' => $releaseName,
|
||||
'body' => "## {$version}\n\nCreated by MokoCLI release pipeline.",
|
||||
'body' => "## {$version}\n\nCreated by moko-platform release pipeline.",
|
||||
'prerelease' => ($stability !== 'stable'),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/license_manage.php
|
||||
* BRIEF: Manage license packages and keys via MokoGitea licensing API
|
||||
*
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/manifest_element.php
|
||||
* BRIEF: Extract element name, type, type prefix, and ZIP name from manifest
|
||||
*/
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/manifest_licensing.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Ensure licensing tags (updateservers, dlid) in Joomla extension manifests
|
||||
*/
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/manifest_read.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Parse .manifest.xml and output requested field(s) for CI consumption
|
||||
*/
|
||||
|
||||
@@ -59,7 +59,7 @@ class ManifestReadCli extends CliFramework
|
||||
$candidates = [
|
||||
"{$root}/.mokogitea/manifest.xml",
|
||||
"{$root}/.mokogitea/.manifest.xml", // legacy (dot-prefixed)
|
||||
"{$root}/.mokogitea/.MokoCLI", // legacy v4
|
||||
"{$root}/.mokogitea/.moko-platform", // legacy v4
|
||||
];
|
||||
|
||||
foreach ($candidates as $candidate) {
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/package_build.php
|
||||
* BRIEF: Build ZIP and tar.gz install packages for Joomla/Dolibarr/generic projects
|
||||
*
|
||||
|
||||
+19
-162
@@ -6,12 +6,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/platform_detect.php
|
||||
* VERSION: 09.25.05
|
||||
* BRIEF: Auto-detect repository platform type and optionally update manifest
|
||||
* BRIEF: Detect platform from manifest.xml file — outputs platform string
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
@@ -24,14 +23,8 @@ class PlatformDetectCli extends CliFramework
|
||||
{
|
||||
protected function configure(): void
|
||||
{
|
||||
$this->setDescription('Auto-detect repository platform type and optionally update manifest');
|
||||
$this->addArgument('--path', 'Local repo path to scan (default: .)', '.');
|
||||
$this->addArgument('--token', 'Gitea API token for updating manifest', '');
|
||||
$this->addArgument('--gitea-url', 'Gitea URL (default: https://git.mokoconsulting.tech)', 'https://git.mokoconsulting.tech');
|
||||
$this->addArgument('--owner', 'Repo owner for API update', '');
|
||||
$this->addArgument('--repo', 'Repo name for API update', '');
|
||||
$this->addArgument('--update', 'Update manifest.platform via API (flag)', 'false');
|
||||
$this->addArgument('--github-output', 'Append platform=xxx to $GITHUB_OUTPUT (flag)', 'false');
|
||||
$this->setDescription('Detect platform from manifest.xml file');
|
||||
$this->addArgument('--path', 'Repository root path', '.');
|
||||
}
|
||||
|
||||
protected function run(): int
|
||||
@@ -39,161 +32,25 @@ class PlatformDetectCli extends CliFramework
|
||||
$path = $this->getArgument('--path');
|
||||
$root = realpath($path) ?: $path;
|
||||
|
||||
$token = $this->getArgument('--token');
|
||||
$giteaUrl = rtrim($this->getArgument('--gitea-url'), '/');
|
||||
$owner = $this->getArgument('--owner');
|
||||
$repo = $this->getArgument('--repo');
|
||||
$doUpdate = $this->isFlagSet('--update');
|
||||
$githubOutput = $this->isFlagSet('--github-output');
|
||||
|
||||
$platform = $this->detectPlatform($root);
|
||||
|
||||
$this->log('INFO', "Detected platform: {$platform}");
|
||||
echo $platform . "\n";
|
||||
|
||||
// Append to $GITHUB_OUTPUT if requested
|
||||
if ($githubOutput) {
|
||||
$outputFile = getenv('GITHUB_OUTPUT');
|
||||
|
||||
if ($outputFile !== false && $outputFile !== '') {
|
||||
file_put_contents($outputFile, "platform={$platform}\n", FILE_APPEND);
|
||||
$this->log('INFO', "Appended platform={$platform} to \$GITHUB_OUTPUT");
|
||||
} else {
|
||||
$this->log('WARN', '$GITHUB_OUTPUT is not set; skipping output append.');
|
||||
}
|
||||
// Check .mokogitea/manifest.xml first, fallback to root
|
||||
$file = "{$root}/.mokogitea/manifest.xml";
|
||||
if (!file_exists($file)) {
|
||||
$file = "{$root}/.mokostandards";
|
||||
}
|
||||
if (!file_exists($file)) {
|
||||
echo "unknown\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Update manifest via API if requested
|
||||
if ($doUpdate) {
|
||||
if ($token === '' || $owner === '' || $repo === '') {
|
||||
$this->log('ERROR', '--update requires --token, --owner, and --repo.');
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ($this->dryRun) {
|
||||
$this->log('INFO', "[DRY RUN] Would update manifest.platform to \"{$platform}\" "
|
||||
. "for {$owner}/{$repo}.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
$this->log('INFO', "Updating manifest.platform for {$owner}/{$repo} to \"{$platform}\"...");
|
||||
|
||||
$response = $this->apiRequest(
|
||||
$giteaUrl,
|
||||
$token,
|
||||
'PATCH',
|
||||
"/api/v1/repos/{$owner}/{$repo}/manifest",
|
||||
json_encode(['platform' => $platform])
|
||||
);
|
||||
|
||||
if ($response['code'] >= 200 && $response['code'] < 300) {
|
||||
$this->log('INFO', "Manifest updated successfully (HTTP {$response['code']}).");
|
||||
} else {
|
||||
$this->log('ERROR', "Failed to update manifest (HTTP {$response['code']}): "
|
||||
. $response['body']);
|
||||
return 1;
|
||||
}
|
||||
$content = file_get_contents($file);
|
||||
if (preg_match('/^platform:\s*(.+)/m', $content, $m)) {
|
||||
echo trim($m[1], " \t\n\r\"'") . "\n";
|
||||
} else {
|
||||
echo "unknown\n";
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private function detectPlatform(string $root): string
|
||||
{
|
||||
// 1. Joomla — has pkg_*.xml or Joomla-style extension manifest
|
||||
$joomlaIndicators = array_merge(
|
||||
glob("{$root}/source/pkg_*.xml") ?: [],
|
||||
glob("{$root}/pkg_*.xml") ?: [],
|
||||
glob("{$root}/source/packages/*/services/provider.php") ?: [],
|
||||
glob("{$root}/**/templateDetails.xml") ?: [],
|
||||
);
|
||||
if (!empty($joomlaIndicators)) {
|
||||
return 'joomla';
|
||||
}
|
||||
|
||||
// 2. Dolibarr — has mod*.class.php or dolibarr module descriptor
|
||||
$doliIndicators = array_merge(
|
||||
glob("{$root}/core/modules/mod*.class.php") ?: [],
|
||||
glob("{$root}/class/*.class.php") ?: [],
|
||||
);
|
||||
if (!empty($doliIndicators) && file_exists("{$root}/langs")) {
|
||||
return 'dolibarr';
|
||||
}
|
||||
|
||||
// 3. Go — has go.mod
|
||||
if (file_exists("{$root}/go.mod")) {
|
||||
return 'go';
|
||||
}
|
||||
|
||||
// 4. MCP — has package.json with mcp-related content or dist/index.js pattern
|
||||
if (file_exists("{$root}/package.json")) {
|
||||
$pkg = json_decode(file_get_contents("{$root}/package.json"), true);
|
||||
$name = $pkg['name'] ?? '';
|
||||
if (str_contains($name, 'mcp') || isset($pkg['dependencies']['@modelcontextprotocol/sdk'])) {
|
||||
return 'mcp';
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Platform — is MokoCLI itself or org-config
|
||||
$repoName = basename($root);
|
||||
if (in_array($repoName, ['mokocli', 'mokoplatform', 'mokogitea-org-config'])) {
|
||||
return 'platform';
|
||||
}
|
||||
|
||||
// 6. Default
|
||||
return 'generic';
|
||||
}
|
||||
|
||||
private function isFlagSet(string $flag): bool
|
||||
{
|
||||
$value = $this->getArgument($flag);
|
||||
|
||||
return $value === 'true' || $value === '1' || $value === 'yes';
|
||||
}
|
||||
|
||||
private function apiRequest(
|
||||
string $giteaUrl,
|
||||
string $token,
|
||||
string $method,
|
||||
string $endpoint,
|
||||
?string $body = null
|
||||
): array {
|
||||
$url = $giteaUrl . $endpoint;
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
'Content-Type: application/json',
|
||||
'Accept: application/json',
|
||||
"Authorization: token {$token}",
|
||||
]);
|
||||
|
||||
if ($body !== null) {
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
|
||||
}
|
||||
|
||||
$responseBody = curl_exec($ch);
|
||||
$httpCode = (int) curl_getinfo(
|
||||
$ch,
|
||||
CURLINFO_HTTP_CODE
|
||||
);
|
||||
|
||||
if (curl_errno($ch)) {
|
||||
$error = curl_error($ch);
|
||||
curl_close($ch);
|
||||
|
||||
return [
|
||||
'code' => 0,
|
||||
'body' => "cURL error: {$error}",
|
||||
];
|
||||
}
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
return ['code' => $httpCode, 'body' => $responseBody];
|
||||
}
|
||||
}
|
||||
|
||||
$app = new PlatformDetectCli();
|
||||
|
||||
+5
-5
@@ -6,11 +6,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/release.php
|
||||
* BRIEF: Automate the MokoCLI version branch release flow
|
||||
* BRIEF: Automate the moko-platform version branch release flow
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
@@ -23,7 +23,7 @@ class ReleaseCli extends CliFramework
|
||||
{
|
||||
protected function configure(): void
|
||||
{
|
||||
$this->setDescription('Automate the MokoCLI version branch release flow');
|
||||
$this->setDescription('Automate the moko-platform version branch release flow');
|
||||
$this->addArgument('--bump', 'Bump type: patch, minor, or major', '');
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/release_body_update.php
|
||||
* BRIEF: Update Gitea release body with changelog extract and checksums
|
||||
*/
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/release_cascade.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: DEPRECATED — cascade behavior removed. Each release stream is independent.
|
||||
*/
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/release_create.php
|
||||
* BRIEF: Create or overwrite a Gitea release with proper naming
|
||||
*/
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/release_manage.php
|
||||
* BRIEF: Create/update Gitea releases, upload assets, update release body
|
||||
*/
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/release_mirror.php
|
||||
* BRIEF: Mirror a Gitea release (with assets) to a GitHub repository
|
||||
*/
|
||||
@@ -201,7 +201,7 @@ class ReleaseMirrorCli extends CliFramework
|
||||
CURLOPT_HTTPHEADER => [
|
||||
"Authorization: token {$token}",
|
||||
'Accept: application/vnd.github+json',
|
||||
'User-Agent: MokoCLI',
|
||||
'User-Agent: moko-platform',
|
||||
'Content-Type: application/json',
|
||||
],
|
||||
CURLOPT_TIMEOUT => 30,
|
||||
@@ -229,7 +229,7 @@ class ReleaseMirrorCli extends CliFramework
|
||||
CURLOPT_HTTPHEADER => [
|
||||
"Authorization: token {$token}",
|
||||
'Accept: application/vnd.github+json',
|
||||
'User-Agent: MokoCLI',
|
||||
'User-Agent: moko-platform',
|
||||
'Content-Type: application/octet-stream',
|
||||
],
|
||||
CURLOPT_POSTFIELDS => file_get_contents($filePath),
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/release_notes.php
|
||||
* BRIEF: Extract release notes from CHANGELOG.md for a given version
|
||||
*/
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/release_package.php
|
||||
* BRIEF: Build packages (ZIP + tar.gz) with SHA-256 and upload to Gitea release
|
||||
*/
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/release_promote.php
|
||||
* BRIEF: Promote a Gitea release from one channel to another (rename release, tag, assets)
|
||||
*/
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/release_publish.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Publish a release and create copies for all lesser stability streams.
|
||||
*/
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/release_validate.php
|
||||
* BRIEF: Pre-release validation -- version consistency, required files, manifest checks
|
||||
*/
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/release_verify.php
|
||||
* BRIEF: Verify a built release artifact — version, SHA256, disallowed files
|
||||
*/
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/scaffold_client.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Scaffold a new client-waas repo from Template-Client-WaaS with pre-configured settings
|
||||
*/
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/sync_rulesets.php
|
||||
* BRIEF: Apply branch protection rules to all repos via platform adapter
|
||||
*/
|
||||
@@ -46,7 +46,7 @@ class SyncRulesetsCli extends CliFramework
|
||||
);
|
||||
|
||||
$platformName = $adapter->getPlatformName();
|
||||
$ALWAYS_EXCLUDE = ['MokoCLI', '.github-private'];
|
||||
$ALWAYS_EXCLUDE = ['moko-platform', '.github-private'];
|
||||
|
||||
// -- Protection rules (platform-agnostic format) --
|
||||
$PROTECTIONS = [
|
||||
|
||||
+3
-3
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/theme_lint.php
|
||||
* BRIEF: Lint theme files -- CSS syntax, image sizes, hardcoded URLs
|
||||
*/
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/updates_xml_build.php
|
||||
* BRIEF: Generate Joomla updates.xml from extension manifest metadata
|
||||
*/
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/updates_xml_sync.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Sync updates.xml to target branches via Gitea API
|
||||
* NOTE: Called by pre-release and auto-release workflows after updates.xml
|
||||
* is modified on the current branch. Pushes the file to other branches
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/version_auto_bump.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Auto patch-bump, set stability suffix, and commit — single CLI replacing inline workflow bash
|
||||
*/
|
||||
|
||||
|
||||
+28
-102
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/version_bump.php
|
||||
* BRIEF: Auto-increment version -- manifest.xml is canonical, cascades to all XML and MD files
|
||||
*/
|
||||
@@ -42,7 +42,6 @@ class VersionBumpCli extends CliFramework
|
||||
$root = realpath($path) ?: $path;
|
||||
$mokoVersion = null;
|
||||
$existingSuffix = '';
|
||||
$versionPrefix = '';
|
||||
$mokoManifest = "{$root}/.mokogitea/manifest.xml";
|
||||
$mokoContent = '';
|
||||
if (file_exists($mokoManifest)) {
|
||||
@@ -51,29 +50,13 @@ class VersionBumpCli extends CliFramework
|
||||
$mokoVersion = $m[1];
|
||||
$existingSuffix = $m[2] ?? '';
|
||||
}
|
||||
// Read version_prefix from manifest.xml (supports nested and flat structure)
|
||||
$xml = @simplexml_load_file($mokoManifest);
|
||||
if ($xml !== false) {
|
||||
$prefix = (string)($xml->identity->version_prefix ?? '');
|
||||
if ($prefix === '') {
|
||||
$prefix = (string)($xml->version_prefix ?? '');
|
||||
}
|
||||
$versionPrefix = $prefix;
|
||||
}
|
||||
}
|
||||
$readmeVersion = null;
|
||||
$readme = "{$root}/README.md";
|
||||
$readmeContent = '';
|
||||
if (file_exists($readme)) {
|
||||
$readmeContent = file_get_contents($readme);
|
||||
if (!empty($versionPrefix)) {
|
||||
// Prefix-aware README scan
|
||||
$prefixPattern = preg_quote($versionPrefix, '/');
|
||||
if (preg_match('/' . $prefixPattern . '(\d{2}\.\d{2}\.\d{2})/m', $readmeContent, $m)) {
|
||||
$readmeVersion = $m[1];
|
||||
}
|
||||
}
|
||||
if ($readmeVersion === null && preg_match('/VERSION:\s*(\d{2}\.\d{2}\.\d{2})/m', $readmeContent, $m)) {
|
||||
if (preg_match('/VERSION:\s*(\d{2}\.\d{2}\.\d{2})/m', $readmeContent, $m)) {
|
||||
$readmeVersion = $m[1];
|
||||
}
|
||||
}
|
||||
@@ -90,19 +73,7 @@ class VersionBumpCli extends CliFramework
|
||||
$xmlContent = file_get_contents($xmlFile);
|
||||
if (strpos($xmlContent, '<extension') === false && strpos($xmlContent, '<version>') === false) {
|
||||
continue;
|
||||
}
|
||||
if (!empty($versionPrefix)) {
|
||||
// Prefix-aware: look for <version>prefix + XX.YY.ZZ</version>
|
||||
$prefixPattern = preg_quote($versionPrefix, '#');
|
||||
if (preg_match('#<version>' . $prefixPattern . '(\d{2}\.\d{2}\.\d{2})</version>#', $xmlContent, $xm)) {
|
||||
$candidate = $xm[1];
|
||||
if ($manifestVersion === null || version_compare($candidate, $manifestVersion, '>')) {
|
||||
$manifestVersion = $candidate;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (preg_match('#<version>(\d{2}\.\d{2}\.\d{2})((?:-(?:dev|alpha|beta|rc))+)?</version>#', $xmlContent, $xm)) {
|
||||
} if (preg_match('#<version>(\d{2}\.\d{2}\.\d{2})((?:-(?:dev|alpha|beta|rc))+)?</version>#', $xmlContent, $xm)) {
|
||||
$candidate = $xm[1];
|
||||
if ($manifestVersion === null || version_compare($candidate, $manifestVersion, '>')) {
|
||||
$manifestVersion = $candidate;
|
||||
@@ -165,13 +136,7 @@ class VersionBumpCli extends CliFramework
|
||||
}
|
||||
}
|
||||
if (file_exists($readme) && !empty($readmeContent)) {
|
||||
if (!empty($versionPrefix)) {
|
||||
// Prefix-aware README replacement: preserve prefix, replace only version part
|
||||
$prefixPattern = preg_quote($versionPrefix, '/');
|
||||
$updated = preg_replace('/(' . $prefixPattern . ')\d{2}\.\d{2}\.\d{2}/m', '${1}' . $newBase, $readmeContent, 1);
|
||||
} else {
|
||||
$updated = preg_replace('/(VERSION:\s*)\d{2}\.\d{2}\.\d{2}(?:(?:-(?:dev|alpha|beta|rc))+)?/m', '${1}' . $newBase, $readmeContent, 1);
|
||||
}
|
||||
$updated = preg_replace('/(VERSION:\s*)\d{2}\.\d{2}\.\d{2}(?:(?:-(?:dev|alpha|beta|rc))+)?/m', '${1}' . $newBase, $readmeContent, 1);
|
||||
if ($updated !== null) {
|
||||
file_put_contents($readme, $updated);
|
||||
}
|
||||
@@ -184,24 +149,13 @@ class VersionBumpCli extends CliFramework
|
||||
if (strpos($content, '<extension') === false) {
|
||||
continue;
|
||||
}
|
||||
if (!empty($versionPrefix)) {
|
||||
// Prefix-aware: preserve prefix, replace only the Moko version part
|
||||
$prefixPattern = preg_quote($versionPrefix, '#');
|
||||
$xmlPattern = '#(<version>' . $prefixPattern . ')\d{2}\.\d{2}\.\d{2}</version>#';
|
||||
$newContent = preg_replace(
|
||||
$xmlPattern,
|
||||
'${1}' . $newBase . '</version>',
|
||||
$content
|
||||
);
|
||||
} else {
|
||||
$xmlPattern = '#<version>\d{2}\.\d{2}\.\d{2}'
|
||||
. '(?:(?:-(?:dev|alpha|beta|rc))+)?</version>#';
|
||||
$newContent = preg_replace(
|
||||
$xmlPattern,
|
||||
"<version>{$newFull}</version>",
|
||||
$content
|
||||
);
|
||||
}
|
||||
$xmlPattern = '#<version>\d{2}\.\d{2}\.\d{2}'
|
||||
. '(?:(?:-(?:dev|alpha|beta|rc))+)?</version>#';
|
||||
$newContent = preg_replace(
|
||||
$xmlPattern,
|
||||
"<version>{$newFull}</version>",
|
||||
$content
|
||||
);
|
||||
if ($newContent !== null && $newContent !== $content) {
|
||||
file_put_contents($xmlFile, $newContent);
|
||||
$updatedFiles[] = substr($xmlFile, strlen($root) + 1);
|
||||
@@ -214,24 +168,13 @@ class VersionBumpCli extends CliFramework
|
||||
$packageJsonFile = "{$root}/package.json";
|
||||
if (file_exists($packageJsonFile)) {
|
||||
$pkgContent = file_get_contents($packageJsonFile);
|
||||
if (!empty($versionPrefix)) {
|
||||
// Prefix-aware package.json replacement
|
||||
$prefixPattern = preg_quote($versionPrefix, '/');
|
||||
$pkgPattern = '/("version"\s*:\s*")' . $prefixPattern . '\d{2}\.\d{2}\.\d{2}(")/m';
|
||||
$updatedPkg = preg_replace(
|
||||
$pkgPattern,
|
||||
'${1}' . $versionPrefix . $newBase . '${2}',
|
||||
$pkgContent
|
||||
);
|
||||
} else {
|
||||
$pkgPattern = '/("version"\s*:\s*")\d{2}\.\d{2}\.\d{2}'
|
||||
. '(?:(?:-(?:dev|alpha|beta|rc))+)?(")/m';
|
||||
$updatedPkg = preg_replace(
|
||||
$pkgPattern,
|
||||
'${1}' . $newFull . '${2}',
|
||||
$pkgContent
|
||||
);
|
||||
}
|
||||
$pkgPattern = '/("version"\s*:\s*")\d{2}\.\d{2}\.\d{2}'
|
||||
. '(?:(?:-(?:dev|alpha|beta|rc))+)?(")/m';
|
||||
$updatedPkg = preg_replace(
|
||||
$pkgPattern,
|
||||
'${1}' . $newFull . '${2}',
|
||||
$pkgContent
|
||||
);
|
||||
if ($updatedPkg !== $pkgContent) {
|
||||
file_put_contents($packageJsonFile, $updatedPkg);
|
||||
fwrite(STDERR, "Updated package.json\n");
|
||||
@@ -240,24 +183,13 @@ class VersionBumpCli extends CliFramework
|
||||
$pyprojectFile = "{$root}/pyproject.toml";
|
||||
if (file_exists($pyprojectFile)) {
|
||||
$pyContent = file_get_contents($pyprojectFile);
|
||||
if (!empty($versionPrefix)) {
|
||||
// Prefix-aware pyproject.toml replacement
|
||||
$prefixPattern = preg_quote($versionPrefix, '/');
|
||||
$pyPattern = '/^(version\s*=\s*")' . $prefixPattern . '\d{2}\.\d{2}\.\d{2}(")/m';
|
||||
$updatedPy = preg_replace(
|
||||
$pyPattern,
|
||||
'${1}' . $versionPrefix . $newBase . '${2}',
|
||||
$pyContent
|
||||
);
|
||||
} else {
|
||||
$pyPattern = '/^(version\s*=\s*")\d{2}\.\d{2}\.\d{2}'
|
||||
. '(?:(?:-(?:dev|alpha|beta|rc))+)?(")/m';
|
||||
$updatedPy = preg_replace(
|
||||
$pyPattern,
|
||||
'${1}' . $newFull . '${2}',
|
||||
$pyContent
|
||||
);
|
||||
}
|
||||
$pyPattern = '/^(version\s*=\s*")\d{2}\.\d{2}\.\d{2}'
|
||||
. '(?:(?:-(?:dev|alpha|beta|rc))+)?(")/m';
|
||||
$updatedPy = preg_replace(
|
||||
$pyPattern,
|
||||
'${1}' . $newFull . '${2}',
|
||||
$pyContent
|
||||
);
|
||||
if ($updatedPy !== $pyContent) {
|
||||
file_put_contents($pyprojectFile, $updatedPy);
|
||||
fwrite(STDERR, "Updated pyproject.toml\n");
|
||||
@@ -274,13 +206,7 @@ class VersionBumpCli extends CliFramework
|
||||
}
|
||||
$scanExtensions = ['php', 'yml', 'yaml', 'md', 'txt', 'xml', 'sh', 'toml', 'ini', 'css', 'js'];
|
||||
$excludeDirs = ['.git', 'vendor', 'node_modules', 'build', 'dist', '.claude'];
|
||||
// Build the generic VERSION: pattern — prefix-aware if configured
|
||||
if (!empty($versionPrefix)) {
|
||||
$prefixPatternGeneric = preg_quote($versionPrefix, '/');
|
||||
$versionPattern = '/(' . $prefixPatternGeneric . ')\d{2}\.\d{2}\.\d{2}/m';
|
||||
} else {
|
||||
$versionPattern = '/(VERSION:\s*)\d{2}\.\d{2}\.\d{2}/m';
|
||||
}
|
||||
$versionPattern = '/(VERSION:\s*)\d{2}\.\d{2}\.\d{2}/m';
|
||||
$directory = new RecursiveDirectoryIterator($root, RecursiveDirectoryIterator::SKIP_DOTS);
|
||||
$filter = new RecursiveCallbackFilterIterator($directory, function ($current, $key, $iterator) use ($excludeDirs) {
|
||||
if ($current->isDir() && in_array($current->getFilename(), $excludeDirs, true)) {
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/version_bump_remote.php
|
||||
* BRIEF: Bump version in manifest XML and CHANGELOG.md on a remote branch via Gitea API
|
||||
*/
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/version_check.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Validate version consistency across README, manifests, and sub-packages
|
||||
*/
|
||||
|
||||
|
||||
+6
-32
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/version_read.php
|
||||
* BRIEF: Read version — manifest.xml is canonical, falls back to README.md and Joomla XML
|
||||
*/
|
||||
@@ -34,7 +34,6 @@ class VersionReadCli extends CliFramework
|
||||
|
||||
// -- 1. Read from .mokogitea/manifest.xml (canonical source) --
|
||||
$mokoVersion = null;
|
||||
$versionPrefix = '';
|
||||
$mokoManifest = "{$root}/.mokogitea/manifest.xml";
|
||||
if (file_exists($mokoManifest)) {
|
||||
$xml = @simplexml_load_file($mokoManifest);
|
||||
@@ -43,12 +42,6 @@ class VersionReadCli extends CliFramework
|
||||
if (preg_match('/^\d{2}\.\d{2}\.\d{2}((?:-(?:dev|alpha|beta|rc))+)?$/', $v)) {
|
||||
$mokoVersion = $v;
|
||||
}
|
||||
// Read version_prefix (supports both nested and flat structure)
|
||||
$prefix = (string)($xml->identity->version_prefix ?? '');
|
||||
if ($prefix === '') {
|
||||
$prefix = (string)($xml->version_prefix ?? '');
|
||||
}
|
||||
$versionPrefix = $prefix;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,14 +56,7 @@ class VersionReadCli extends CliFramework
|
||||
$readme = "{$root}/README.md";
|
||||
if (file_exists($readme)) {
|
||||
$content = file_get_contents($readme);
|
||||
if (!empty($versionPrefix)) {
|
||||
// Prefix-aware: search for prefix followed by version
|
||||
$prefixPattern = preg_quote($versionPrefix, '/');
|
||||
if (preg_match('/' . $prefixPattern . '(\d{2}\.\d{2}\.\d{2})/m', $content, $m)) {
|
||||
$readmeVersion = $m[1];
|
||||
}
|
||||
}
|
||||
if ($readmeVersion === null && preg_match('/VERSION:\s*(\d{2}\.\d{2}\.\d{2})/m', $content, $m)) {
|
||||
if (preg_match('/VERSION:\s*(\d{2}\.\d{2}\.\d{2})/m', $content, $m)) {
|
||||
$readmeVersion = $m[1];
|
||||
}
|
||||
}
|
||||
@@ -89,22 +75,10 @@ class VersionReadCli extends CliFramework
|
||||
if (strpos($xmlContent, '<extension') === false && strpos($xmlContent, '<version>') === false) {
|
||||
continue;
|
||||
}
|
||||
if (!empty($versionPrefix)) {
|
||||
// Prefix-aware: look for <version>prefix + XX.YY.ZZ</version>
|
||||
$prefixPattern = preg_quote($versionPrefix, '#');
|
||||
if (preg_match('#<version>' . $prefixPattern . '(\d{2}\.\d{2}\.\d{2})</version>#', $xmlContent, $xm)) {
|
||||
$candidate = $xm[1];
|
||||
$currentBase = $manifestVersion ? preg_replace('/(-(?:dev|alpha|beta|rc))+$/', '', $manifestVersion) : null;
|
||||
if ($currentBase === null || version_compare($candidate, $currentBase, '>')) {
|
||||
$manifestVersion = $candidate;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (preg_match('#<version>(\d{2}\.\d{2}\.\d{2}(?:(?:-(?:dev|alpha|beta|rc))+)?)</version>#', $xmlContent, $xm)) {
|
||||
$candidate = $xm[1];
|
||||
$candidateBase = preg_replace('/(-(?:dev|alpha|beta|rc))+$/', '', $candidate);
|
||||
$currentBase = $manifestVersion ? preg_replace('/(-(?:dev|alpha|beta|rc))+$/', '', $manifestVersion) : null;
|
||||
$candidateBase = preg_replace('/(-(dev|alpha|beta|rc))+$/', '', $candidate);
|
||||
$currentBase = $manifestVersion ? preg_replace('/(-(dev|alpha|beta|rc))+$/', '', $manifestVersion) : null;
|
||||
if ($currentBase === null || version_compare($candidateBase, $currentBase, '>')) {
|
||||
$manifestVersion = $candidate;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/version_reset_dev.php
|
||||
* BRIEF: Reset platform version to 'development' on a branch via Gitea API
|
||||
*/
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/version_set_platform.php
|
||||
* BRIEF: Set version in platform-specific files (Dolibarr $this->version, Joomla <version>)
|
||||
*/
|
||||
|
||||
+8
-8
@@ -6,12 +6,12 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: moko-platform.CLI
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/wiki_sync.php
|
||||
* VERSION: 09.25.05
|
||||
* BRIEF: Sync select wiki pages from MokoCLI to all template repos
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Sync select wiki pages from moko-platform to all template repos
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
@@ -25,7 +25,7 @@ class WikiSyncCli extends CliFramework
|
||||
private string $giteaUrl = 'https://git.mokoconsulting.tech';
|
||||
private string $token = '';
|
||||
private string $org = 'MokoConsulting';
|
||||
private string $sourceRepo = 'MokoCLI';
|
||||
private string $sourceRepo = 'moko-platform';
|
||||
private array $targetRepos = [];
|
||||
private array $pages = [];
|
||||
private bool $allTemplates = false;
|
||||
@@ -38,10 +38,10 @@ class WikiSyncCli extends CliFramework
|
||||
|
||||
protected function configure(): void
|
||||
{
|
||||
$this->setDescription('Sync wiki pages from MokoCLI to template repos');
|
||||
$this->setDescription('Sync wiki pages from moko-platform to template repos');
|
||||
$this->addArgument('--token', 'Gitea API token (required)', '');
|
||||
$this->addArgument('--org', 'Organization (default: MokoConsulting)', 'MokoConsulting');
|
||||
$this->addArgument('--source', 'Source repo (default: MokoCLI)', 'MokoCLI');
|
||||
$this->addArgument('--source', 'Source repo (default: moko-platform)', 'moko-platform');
|
||||
$this->addArgument('--target', 'Target repo (can repeat)', '');
|
||||
$this->addArgument('--page', 'Page to sync (can repeat)', '');
|
||||
$this->addArgument('--all-standards', 'Sync all UPPERCASE standards pages', false);
|
||||
|
||||
@@ -1,646 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/* Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.CLI
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* PATH: /cli/workflow_sync.php
|
||||
* VERSION: 09.25.05
|
||||
* BRIEF: Sync workflows from Generic → platform templates → live repos based on manifest.platform
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/../lib/Enterprise/CliFramework.php';
|
||||
|
||||
use MokoEnterprise\CliFramework;
|
||||
|
||||
class WorkflowSyncCli extends CliFramework
|
||||
{
|
||||
private const PLATFORM_TEMPLATES = [
|
||||
'joomla' => 'Template-Joomla',
|
||||
'dolibarr' => 'Template-Dolibarr',
|
||||
'go' => 'Template-Go',
|
||||
'mcp' => 'Template-MCP',
|
||||
'platform' => 'Template-Generic',
|
||||
'generic' => 'Template-Generic',
|
||||
];
|
||||
|
||||
private const DEFAULT_TEMPLATE = 'Template-Generic';
|
||||
private const GENERIC_TEMPLATE = 'Template-Generic';
|
||||
|
||||
private int $updated = 0;
|
||||
private int $created = 0;
|
||||
private int $skipped = 0;
|
||||
private int $errors = 0;
|
||||
|
||||
protected function configure(): void
|
||||
{
|
||||
$this->setDescription('Sync workflows from Generic → platform templates → live repos based on manifest.platform');
|
||||
$this->addArgument('--gitea-url', 'Gitea URL (default: https://git.mokoconsulting.tech)', 'https://git.mokoconsulting.tech');
|
||||
$this->addArgument('--token', 'Gitea API token', '');
|
||||
$this->addArgument('--org', 'Target organization', '');
|
||||
$this->addArgument('--branch', 'Target branch (default: main)', 'main');
|
||||
$this->addArgument('--phase', 'Phase to run: all, templates, repos (default: all)', 'all');
|
||||
$this->addArgument('--platform-filter', 'Only sync repos matching this platform', '');
|
||||
}
|
||||
|
||||
protected function run(): int
|
||||
{
|
||||
$giteaUrl = rtrim($this->getArgument('--gitea-url'), '/');
|
||||
$token = $this->getArgument('--token');
|
||||
$org = $this->getArgument('--org');
|
||||
$branch = $this->getArgument('--branch');
|
||||
$phase = $this->getArgument('--phase');
|
||||
$platformFilter = $this->getArgument('--platform-filter');
|
||||
|
||||
if ($token === '') {
|
||||
$this->log('ERROR', '--token is required.');
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ($org === '') {
|
||||
$this->log('ERROR', '--org is required.');
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!in_array($phase, ['all', 'templates', 'repos'], true)) {
|
||||
$this->log('ERROR', "--phase must be one of: all, templates, repos (got: {$phase})");
|
||||
return 1;
|
||||
}
|
||||
|
||||
$this->log('INFO', "Workflow Sync — org: {$org}, branch: {$branch}, phase: {$phase}");
|
||||
|
||||
if ($platformFilter !== '') {
|
||||
$this->log('INFO', "Platform filter: {$platformFilter}");
|
||||
}
|
||||
|
||||
if ($this->dryRun) {
|
||||
$this->log('INFO', '[DRY RUN] No changes will be made.');
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
|
||||
// Phase 1: Sync Generic → Platform Templates
|
||||
if ($phase === 'all' || $phase === 'templates') {
|
||||
$result = $this->syncGenericToTemplates($giteaUrl, $token, $org, $branch, $platformFilter);
|
||||
|
||||
if ($result !== 0) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
// Phase 2: Sync Platform Templates → Live Repos
|
||||
if ($phase === 'all' || $phase === 'repos') {
|
||||
$result = $this->syncTemplatesToRepos($giteaUrl, $token, $org, $branch, $platformFilter);
|
||||
|
||||
if ($result !== 0) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
$this->log('INFO', "Done: {$this->created} created, {$this->updated} updated, "
|
||||
. "{$this->skipped} skipped, {$this->errors} error(s).");
|
||||
|
||||
return $this->errors > 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phase 1: Push all Generic workflows to each platform template repo.
|
||||
* Skips platform-specific overrides (files that exist in the platform template but NOT in Generic).
|
||||
*/
|
||||
private function syncGenericToTemplates(
|
||||
string $giteaUrl,
|
||||
string $token,
|
||||
string $org,
|
||||
string $branch,
|
||||
string $platformFilter
|
||||
): int {
|
||||
$this->log('INFO', '=== Phase 1: Sync Generic → Platform Templates ===');
|
||||
echo "\n";
|
||||
|
||||
// Get all workflow files from Template-Generic
|
||||
$genericWorkflows = $this->listWorkflows($giteaUrl, $token, $org, self::GENERIC_TEMPLATE, $branch);
|
||||
|
||||
if ($genericWorkflows === null) {
|
||||
$this->log('ERROR', 'Could not list workflows from ' . self::GENERIC_TEMPLATE);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (count($genericWorkflows) === 0) {
|
||||
$this->log('WARN', 'No workflows found in ' . self::GENERIC_TEMPLATE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
$this->log('INFO', 'Found ' . count($genericWorkflows) . ' workflow(s) in ' . self::GENERIC_TEMPLATE);
|
||||
echo "\n";
|
||||
|
||||
// Get unique platform templates (exclude Generic itself)
|
||||
$platformTemplates = array_unique(array_filter(
|
||||
array_values(self::PLATFORM_TEMPLATES),
|
||||
fn(string $t) => $t !== self::GENERIC_TEMPLATE
|
||||
));
|
||||
|
||||
// If platform-filter is set, only sync to the matching template
|
||||
if ($platformFilter !== '') {
|
||||
$targetTemplate = self::PLATFORM_TEMPLATES[$platformFilter] ?? null;
|
||||
|
||||
if ($targetTemplate === null || $targetTemplate === self::GENERIC_TEMPLATE) {
|
||||
$this->log('INFO', "Platform filter '{$platformFilter}' does not map to a non-generic template, skipping Phase 1.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
$platformTemplates = [$targetTemplate];
|
||||
}
|
||||
|
||||
fprintf(STDERR, "%-45s | %s\n", 'Template / File', 'Status');
|
||||
fprintf(STDERR, "%s\n", str_repeat('-', 70));
|
||||
|
||||
foreach ($platformTemplates as $templateRepo) {
|
||||
foreach ($genericWorkflows as $workflow) {
|
||||
$filename = $workflow['name'];
|
||||
$destPath = '.mokogitea/workflows/' . $filename;
|
||||
$label = "{$templateRepo}/{$filename}";
|
||||
|
||||
// Get file content from Generic
|
||||
$sourceContent = $this->getFileContent(
|
||||
$giteaUrl, $token, $org,
|
||||
self::GENERIC_TEMPLATE, $destPath, $branch
|
||||
);
|
||||
|
||||
if ($sourceContent === null) {
|
||||
fprintf(STDERR, "%-45s | %s\n", $label, 'ERROR (read source)');
|
||||
$this->errors++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$commitMsg = "chore: sync {$filename} from " . self::GENERIC_TEMPLATE . " [skip ci]";
|
||||
|
||||
$this->pushFile(
|
||||
$giteaUrl, $token, $org, $templateRepo,
|
||||
$destPath, $sourceContent, $branch, $commitMsg, $label
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phase 2: Sync platform template workflows to live repos based on manifest.platform.
|
||||
*/
|
||||
private function syncTemplatesToRepos(
|
||||
string $giteaUrl,
|
||||
string $token,
|
||||
string $org,
|
||||
string $branch,
|
||||
string $platformFilter
|
||||
): int {
|
||||
$this->log('INFO', '=== Phase 2: Sync Platform Templates → Live Repos ===');
|
||||
echo "\n";
|
||||
|
||||
$repos = $this->fetchOrgRepos($giteaUrl, $token, $org);
|
||||
|
||||
if ($repos === null) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
$this->log('INFO', 'Found ' . count($repos) . " repo(s) in \"{$org}\".");
|
||||
echo "\n";
|
||||
|
||||
fprintf(STDERR, "%-45s | %s\n", 'Repo / File', 'Status');
|
||||
fprintf(STDERR, "%s\n", str_repeat('-', 70));
|
||||
|
||||
// Cache template workflows to avoid repeated API calls
|
||||
$templateWorkflowCache = [];
|
||||
|
||||
foreach ($repos as $repoFullName) {
|
||||
[, $repoName] = explode('/', $repoFullName, 2);
|
||||
|
||||
// Skip template repos
|
||||
if (str_starts_with($repoName, 'Template-')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Read manifest.platform
|
||||
$platform = $this->getRepoPlatform($giteaUrl, $token, $org, $repoName, $branch);
|
||||
|
||||
// Apply platform filter
|
||||
if ($platformFilter !== '' && $platform !== $platformFilter) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Resolve template
|
||||
$templateRepo = self::PLATFORM_TEMPLATES[$platform] ?? self::DEFAULT_TEMPLATE;
|
||||
|
||||
// Get workflows from the template (cached)
|
||||
if (!isset($templateWorkflowCache[$templateRepo])) {
|
||||
$workflows = $this->listWorkflows($giteaUrl, $token, $org, $templateRepo, $branch);
|
||||
|
||||
if ($workflows === null) {
|
||||
$this->log('WARN', "Could not list workflows from {$templateRepo}, falling back to " . self::GENERIC_TEMPLATE);
|
||||
$workflows = $this->listWorkflows($giteaUrl, $token, $org, self::GENERIC_TEMPLATE, $branch);
|
||||
}
|
||||
|
||||
$templateWorkflowCache[$templateRepo] = $workflows ?? [];
|
||||
}
|
||||
|
||||
$workflows = $templateWorkflowCache[$templateRepo];
|
||||
|
||||
if (count($workflows) === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($workflows as $workflow) {
|
||||
$filename = $workflow['name'];
|
||||
$destPath = '.mokogitea/workflows/' . $filename;
|
||||
$label = "{$repoFullName}/{$filename}";
|
||||
|
||||
// Get source content from template
|
||||
$sourceContent = $this->getFileContent(
|
||||
$giteaUrl, $token, $org,
|
||||
$templateRepo, $destPath, $branch
|
||||
);
|
||||
|
||||
if ($sourceContent === null) {
|
||||
fprintf(STDERR, "%-45s | %s\n", $label, 'ERROR (read source)');
|
||||
$this->errors++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$commitMsg = "chore: sync {$filename} from {$templateRepo} [skip ci]";
|
||||
|
||||
$this->pushFile(
|
||||
$giteaUrl, $token, $org, $repoName,
|
||||
$destPath, $sourceContent, $branch, $commitMsg, $label
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Push a file to a repo — create or update, skip if identical.
|
||||
*/
|
||||
private function pushFile(
|
||||
string $giteaUrl,
|
||||
string $token,
|
||||
string $org,
|
||||
string $repoName,
|
||||
string $destPath,
|
||||
string $localContent,
|
||||
string $branch,
|
||||
string $commitMsg,
|
||||
string $label
|
||||
): void {
|
||||
$existing = $this->apiRequest(
|
||||
$giteaUrl,
|
||||
$token,
|
||||
'GET',
|
||||
"/api/v1/repos/{$org}/{$repoName}/contents/"
|
||||
. "{$destPath}?ref={$branch}"
|
||||
);
|
||||
|
||||
$encodedContent = base64_encode($localContent);
|
||||
|
||||
if ($existing['code'] === 200) {
|
||||
$data = json_decode($existing['body'], true);
|
||||
$remoteSha = $data['sha'] ?? '';
|
||||
$remoteContent = base64_decode($data['content'] ?? '');
|
||||
|
||||
if ($remoteContent === $localContent) {
|
||||
fprintf(STDERR, "%-45s | %s\n", $label, 'IDENTICAL (skipped)');
|
||||
$this->skipped++;
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->dryRun) {
|
||||
fprintf(STDERR, "%-45s | %s\n", $label, 'WOULD UPDATE');
|
||||
$this->updated++;
|
||||
return;
|
||||
}
|
||||
|
||||
$payload = json_encode([
|
||||
'content' => $encodedContent,
|
||||
'sha' => $remoteSha,
|
||||
'message' => $commitMsg,
|
||||
'branch' => $branch,
|
||||
]);
|
||||
|
||||
$response = $this->apiRequest(
|
||||
$giteaUrl,
|
||||
$token,
|
||||
'PUT',
|
||||
"/api/v1/repos/{$org}/{$repoName}/contents/" . $destPath,
|
||||
$payload
|
||||
);
|
||||
|
||||
if ($response['code'] === 200) {
|
||||
fprintf(STDERR, "%-45s | %s\n", $label, 'UPDATED');
|
||||
$this->updated++;
|
||||
} else {
|
||||
fprintf(STDERR, "%-45s | %s\n", $label, "ERROR (HTTP {$response['code']})");
|
||||
$this->errors++;
|
||||
}
|
||||
} elseif ($existing['code'] === 404) {
|
||||
if ($this->dryRun) {
|
||||
fprintf(STDERR, "%-45s | %s\n", $label, 'WOULD CREATE');
|
||||
$this->created++;
|
||||
return;
|
||||
}
|
||||
|
||||
$payload = json_encode([
|
||||
'content' => $encodedContent,
|
||||
'message' => $commitMsg,
|
||||
'branch' => $branch,
|
||||
]);
|
||||
|
||||
$response = $this->apiRequest(
|
||||
$giteaUrl,
|
||||
$token,
|
||||
'POST',
|
||||
"/api/v1/repos/{$org}/{$repoName}/contents/" . $destPath,
|
||||
$payload
|
||||
);
|
||||
|
||||
if ($response['code'] === 201) {
|
||||
fprintf(STDERR, "%-45s | %s\n", $label, 'CREATED');
|
||||
$this->created++;
|
||||
} else {
|
||||
fprintf(STDERR, "%-45s | %s\n", $label, "ERROR (HTTP {$response['code']})");
|
||||
$this->errors++;
|
||||
}
|
||||
} else {
|
||||
fprintf(STDERR, "%-45s | %s\n", $label, "ERROR (HTTP {$existing['code']})");
|
||||
$this->errors++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List workflow files in a repo's .mokogitea/workflows/ directory.
|
||||
*/
|
||||
private function listWorkflows(
|
||||
string $giteaUrl,
|
||||
string $token,
|
||||
string $org,
|
||||
string $repoName,
|
||||
string $branch
|
||||
): ?array {
|
||||
$response = $this->apiRequest(
|
||||
$giteaUrl,
|
||||
$token,
|
||||
'GET',
|
||||
"/api/v1/repos/{$org}/{$repoName}/contents/.mokogitea/workflows?ref={$branch}"
|
||||
);
|
||||
|
||||
if ($response['code'] !== 200) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = json_decode($response['body'], true);
|
||||
|
||||
if (!is_array($data)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Filter to only files (not directories)
|
||||
return array_values(array_filter($data, fn($item) => ($item['type'] ?? '') === 'file'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file content from a repo as a raw string.
|
||||
*/
|
||||
private function getFileContent(
|
||||
string $giteaUrl,
|
||||
string $token,
|
||||
string $org,
|
||||
string $repoName,
|
||||
string $filePath,
|
||||
string $branch
|
||||
): ?string {
|
||||
$response = $this->apiRequest(
|
||||
$giteaUrl,
|
||||
$token,
|
||||
'GET',
|
||||
"/api/v1/repos/{$org}/{$repoName}/contents/{$filePath}?ref={$branch}"
|
||||
);
|
||||
|
||||
if ($response['code'] !== 200) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = json_decode($response['body'], true);
|
||||
|
||||
if (!is_array($data) || !isset($data['content'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return base64_decode($data['content']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a repo's manifest.xml and extract the platform value.
|
||||
* Returns 'generic' if the manifest is missing or has no platform field.
|
||||
*/
|
||||
private function getRepoPlatform(
|
||||
string $giteaUrl,
|
||||
string $token,
|
||||
string $org,
|
||||
string $repoName,
|
||||
string $branch
|
||||
): string {
|
||||
$response = $this->apiRequest(
|
||||
$giteaUrl,
|
||||
$token,
|
||||
'GET',
|
||||
"/api/v1/repos/{$org}/{$repoName}/contents/.mokogitea/manifest.xml?ref={$branch}"
|
||||
);
|
||||
|
||||
if ($response['code'] !== 200) {
|
||||
return 'generic';
|
||||
}
|
||||
|
||||
$data = json_decode($response['body'], true);
|
||||
|
||||
if (!is_array($data) || !isset($data['content'])) {
|
||||
return 'generic';
|
||||
}
|
||||
|
||||
$xmlContent = base64_decode($data['content']);
|
||||
|
||||
if ($xmlContent === false || $xmlContent === '') {
|
||||
return 'generic';
|
||||
}
|
||||
|
||||
// Suppress XML warnings for malformed manifests
|
||||
$previous = libxml_use_internal_errors(true);
|
||||
$xml = simplexml_load_string($xmlContent);
|
||||
libxml_use_internal_errors($previous);
|
||||
|
||||
if ($xml === false) {
|
||||
return 'generic';
|
||||
}
|
||||
|
||||
// Try <governance><platform> (standard location)
|
||||
$platform = '';
|
||||
|
||||
// Register namespace if present
|
||||
$namespaces = $xml->getNamespaces(true);
|
||||
|
||||
if (!empty($namespaces)) {
|
||||
$ns = reset($namespaces);
|
||||
$xml->registerXPathNamespace('mp', $ns);
|
||||
|
||||
$nodes = $xml->xpath('//mp:governance/mp:platform');
|
||||
|
||||
if (!empty($nodes)) {
|
||||
$platform = trim((string) $nodes[0]);
|
||||
}
|
||||
|
||||
// Fallback: <identity><platform>
|
||||
if ($platform === '') {
|
||||
$nodes = $xml->xpath('//mp:identity/mp:platform');
|
||||
|
||||
if (!empty($nodes)) {
|
||||
$platform = trim((string) $nodes[0]);
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback: top-level <platform>
|
||||
if ($platform === '') {
|
||||
$nodes = $xml->xpath('//mp:platform');
|
||||
|
||||
if (!empty($nodes)) {
|
||||
$platform = trim((string) $nodes[0]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// No namespace
|
||||
if (isset($xml->governance->platform)) {
|
||||
$platform = trim((string) $xml->governance->platform);
|
||||
} elseif (isset($xml->identity->platform)) {
|
||||
$platform = trim((string) $xml->identity->platform);
|
||||
} elseif (isset($xml->platform)) {
|
||||
$platform = trim((string) $xml->platform);
|
||||
}
|
||||
}
|
||||
|
||||
if ($platform === '') {
|
||||
return 'generic';
|
||||
}
|
||||
|
||||
return strtolower($platform);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch all non-archived repos in an org (paginated).
|
||||
*/
|
||||
private function fetchOrgRepos(string $giteaUrl, string $token, string $org): ?array
|
||||
{
|
||||
$this->log('INFO', "Fetching repos from org: {$org}");
|
||||
|
||||
$page = 1;
|
||||
$repos = [];
|
||||
|
||||
while (true) {
|
||||
$response = $this->apiRequest(
|
||||
$giteaUrl,
|
||||
$token,
|
||||
'GET',
|
||||
"/api/v1/orgs/{$org}/repos?"
|
||||
. "limit=50&page={$page}"
|
||||
);
|
||||
|
||||
if ($response['code'] < 200 || $response['code'] >= 300) {
|
||||
if ($page === 1) {
|
||||
$this->log('ERROR', "Could not fetch repos "
|
||||
. "(HTTP {$response['code']}).");
|
||||
return null;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$data = json_decode($response['body'], true);
|
||||
|
||||
if (!is_array($data) || count($data) === 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ($data as $repo) {
|
||||
if (!empty($repo['archived'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$fullName = $repo['full_name'] ?? '';
|
||||
|
||||
if ($fullName !== '') {
|
||||
$repos[] = $fullName;
|
||||
}
|
||||
}
|
||||
|
||||
$page++;
|
||||
}
|
||||
|
||||
return $repos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make an HTTP request to the Gitea API.
|
||||
*/
|
||||
private function apiRequest(
|
||||
string $giteaUrl,
|
||||
string $token,
|
||||
string $method,
|
||||
string $endpoint,
|
||||
?string $body = null
|
||||
): array {
|
||||
$url = $giteaUrl . $endpoint;
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
'Content-Type: application/json',
|
||||
'Accept: application/json',
|
||||
"Authorization: token {$token}",
|
||||
]);
|
||||
|
||||
if ($body !== null) {
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
|
||||
}
|
||||
|
||||
$responseBody = curl_exec($ch);
|
||||
$httpCode = (int) curl_getinfo(
|
||||
$ch,
|
||||
CURLINFO_HTTP_CODE
|
||||
);
|
||||
|
||||
if (curl_errno($ch)) {
|
||||
$error = curl_error($ch);
|
||||
curl_close($ch);
|
||||
|
||||
return [
|
||||
'code' => 0,
|
||||
'body' => "cURL error: {$error}",
|
||||
];
|
||||
}
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
return ['code' => $httpCode, 'body' => $responseBody];
|
||||
}
|
||||
}
|
||||
|
||||
$app = new WorkflowSyncCli();
|
||||
exit($app->execute());
|
||||
+3
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mokoconsulting-tech/mokocli",
|
||||
"description": "MokoCLI Enterprise API \u2014 PHP implementation",
|
||||
"name": "mokoconsulting-tech/enterprise",
|
||||
"description": "moko-platform Enterprise API \u2014 PHP implementation",
|
||||
"type": "library",
|
||||
"version": "09.23.00",
|
||||
"license": "GPL-3.0-or-later",
|
||||
@@ -51,8 +51,7 @@
|
||||
"lib/Enterprise/CliFramework.php"
|
||||
],
|
||||
"files": [
|
||||
"src/functions.php",
|
||||
"src/aliases.php"
|
||||
"src/functions.php"
|
||||
]
|
||||
},
|
||||
"archive": {
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.Scripts.Deploy
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoPlatform.Scripts.Deploy
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /deploy/backup-before-deploy.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Snapshot Joomla directories before deployment for rollback capability
|
||||
*/
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.Scripts.Deploy
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoPlatform.Scripts.Deploy
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /deploy/deploy-dolibarr.php
|
||||
* VERSION: 09.25.05
|
||||
* VERSION: 09.25.01
|
||||
* BRIEF: Deploy Dolibarr module files to a remote server via SFTP/rsync
|
||||
*/
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: MokoCLI.Scripts.Deploy
|
||||
* INGROUP: MokoCLI
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* DEFGROUP: MokoPlatform.Scripts.Deploy
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /deploy/deploy-joomla.php
|
||||
* BRIEF: Smart Joomla deploy — routes files to correct Joomla directories based on XML manifest
|
||||
*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user