mirror of
https://github.com/j3ssie/osmedeus.git
synced 2026-08-22 07:32:27 +02:00
Org (tenant) layer - New Org model with org_uuid denormalized onto workspaces, assets, vulnerabilities and runs so cross-workspace queries need no join - Automatic attribution via BeforeAppendModel hooks; importers stay org-unaware - Read semantics: empty org means no filter (backward compatible) Write semantics: empty org coerced to the default org - Migration backfills every pre-existing row into the default org - CLI: osmedeus org create/show/assign/use/rename/delete - API: /osm/api/orgs CRUD plus ?org= on assets, vulns, runs and workspaces npm distribution - npm install -g @j3ssie/osmedeus ships the Go binary through npm - One npm name with version-suffixed platform builds pulled in as aliased optionalDependencies, so an install downloads exactly one binary - Binary ships gzipped and is decompressed on first run into a version-scoped cache, so an upgrade can never exec a stale binary - make bump-version is the single source of truth for the version constant Bundled agent skills - public/skills/ embedded in the binary, installed via osmedeus skills install - Filesystem-driven discovery: a new bundle needs no code change - make sync-skills mirrors bundles out to the standalone skills repo Platform sub-projects - Vendor dashboard, registry and workflow under platform/ so they version with the engine they talk to; make sync-platform publishes them out - Rebuild the embedded UI in public/ui/
95 lines
3.1 KiB
Bash
Executable File
95 lines
3.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Publish the vendored platform/ sub-projects OUT to their standalone repos.
|
|
#
|
|
# platform/<name>/ is the source of truth: the sub-projects are developed here,
|
|
# in the monorepo, alongside the Go code they talk to. This pushes each one to a
|
|
# local checkout of its public repo so the standalone repos stay in step.
|
|
#
|
|
# Only files tracked by THIS repo are published, so a sub-project's build output
|
|
# and node_modules (gitignored under platform/) never leak into the public repo.
|
|
#
|
|
# make sync-platform # write, review, commit yourself
|
|
# make sync-platform PLATFORM_COMMIT=1 # also commit and push
|
|
# make sync-platform PLATFORM=osmedeus-registry
|
|
# make sync-platform PLATFORM_DEST=/path/to/checkouts
|
|
#
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
|
|
# Default to the directory holding this repo, matching sync-skills' `../` default,
|
|
# rather than hardcoding a developer-specific path.
|
|
DEST_BASE="${PLATFORM_DEST:-$(cd "$REPO_ROOT/.." && pwd)}"
|
|
GIT_ORG="${PLATFORM_GIT_ORG:-git@github.com:osmedeus}"
|
|
DO_COMMIT="${PLATFORM_COMMIT:-}"
|
|
|
|
ALL_PLATFORMS=(osmedeus-dashboard osmedeus-registry osmedeus-workflow)
|
|
if [ -n "${PLATFORM:-}" ]; then
|
|
PLATFORMS=("$PLATFORM")
|
|
else
|
|
PLATFORMS=("${ALL_PLATFORMS[@]}")
|
|
fi
|
|
|
|
cd "$REPO_ROOT"
|
|
|
|
for name in "${PLATFORMS[@]}"; do
|
|
src="$REPO_ROOT/platform/$name"
|
|
dest="$DEST_BASE/$name"
|
|
|
|
if [ ! -d "$src" ]; then
|
|
echo "SKIP: platform/$name does not exist"
|
|
continue
|
|
fi
|
|
|
|
echo "==> Syncing $name"
|
|
|
|
if [ ! -d "$dest" ]; then
|
|
echo " Cloning $GIT_ORG/$name.git -> $dest"
|
|
git clone -q "$GIT_ORG/$name.git" "$dest"
|
|
fi
|
|
|
|
if [ ! -d "$dest/.git" ]; then
|
|
echo " ERROR: $dest is not a git checkout, refusing to write"
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$(git ls-files "platform/$name" | wc -l | tr -d ' ')" -eq 0 ]; then
|
|
echo " ERROR: no tracked files under platform/$name, refusing to sync"
|
|
exit 1
|
|
fi
|
|
|
|
# --delete propagates removals. Excluded paths are protected on the receiving
|
|
# side too, so the destination keeps its own .git, node_modules and build
|
|
# output — these are the same paths gitignored under platform/ here.
|
|
rsync -a --delete \
|
|
--exclude='.git/' \
|
|
--exclude='node_modules/' \
|
|
--exclude='.next/' \
|
|
--exclude='build/' \
|
|
--exclude='out/' \
|
|
--exclude='coverage/' \
|
|
--exclude='*.tsbuildinfo' \
|
|
--exclude='.env*' \
|
|
--exclude='.DS_Store' \
|
|
"$src/" "$dest/"
|
|
|
|
if [ -z "$DO_COMMIT" ]; then
|
|
changed=$(git -C "$dest" status --porcelain | wc -l | tr -d ' ')
|
|
echo " $changed change(s) staged in $dest - review and commit there"
|
|
continue
|
|
fi
|
|
|
|
if [ -n "$(git -C "$dest" status --porcelain)" ]; then
|
|
git -C "$dest" add -A
|
|
git -C "$dest" commit -q -m "sync: update from osmedeus monorepo ($(date +%Y-%m-%d))"
|
|
git -C "$dest" push -q origin
|
|
echo " Committed and pushed $name"
|
|
else
|
|
echo " No changes for $name"
|
|
fi
|
|
done
|
|
|
|
echo "==> Done"
|