feat(playground): one-click Nextcloud Playground preview + PR pipeline#38
Merged
Conversation
Contributor
|
Add a `blueprint.json` and README badge that boot a full Nextcloud in the browser with this app pre-installed, mirroring the mod_exelearning / moodle-playground setup. Because the Nextcloud app ships a compiled `js/` bundle that is not in git, the source archive can't be used directly: the preview must build the app. `make package-zip` produces the ZIP the playground's `installApp` step extracts (the prebuilt eXeLearning static editor is downloaded, not compiled, via `make download-editor`). `playground-preview.yml`: - push to main -> refresh the rolling `playground` prerelease asset (exelearning.zip) the README badge points at. - pull_request -> publish a per-PR prerelease and post a one-click playground link (inline base64 blueprint) as a sticky comment. - PR closed -> delete the per-PR prerelease and tag. Requires the matching `installApp` blueprint step in ateeducacion/nextcloud-playground.
GitHub release-asset downloads redirect to Azure Blob with no Access-Control-Allow-Origin header, so the playground's cross-origin fetch was rejected. Route the installApp URL through the shared zip-proxy worker (?repo&release&asset), which adds CORS headers.
installApp + app:enable alone leave Nextcloud unaware of the .elpx extension, so the viewer never triggers (the file opens as a download). Replicate what `make up` does: write config/mimetypemapping.json and config/mimetypealiases.json (via the playground writeFile step) then run maintenance:mimetype:update-js / update-db --repair-filecache. Needs the writeFile step in nextcloud-playground.
bd844c9 to
177ba70
Compare
…ontent Add propiedades.elpx to tests/fixtures (the larger styles/cataloguing sample is already there) and have the blueprint download both into the admin user's Files (exelearning-samples/) via the playground writeFile `url` source, then files:scan so they appear ready to click. The PR preview rewrites the fixture refs from raw main to the PR head commit so a branch's fixture changes show up in its preview. Needs the writeFile `url` support in nextcloud-playground.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
blueprint.json+ README badge that boot a full Nextcloud in the browser (via WebAssembly) with this app pre-installed, plus a CI pipeline that gives every PR its own one-click playground link — mirroring themod_exelearning/moodle-playgroundsetup.How
blueprint.json— provisions a fresh Nextcloud and installsexelearningvia the playground'sinstallAppstep, landing on Files.make package-zip— same staged tree asmake packagebut as a ZIP (the format the playground extracts in the browser). The prebuilt eXeLearning static editor is downloaded from the editor's latest release (make download-editor), not compiled..github/workflows/playground-preview.yml:main→ refresh the rollingplaygroundprerelease asset (exelearning.zip) the badge points at.pull_request(same-repo) → publish a per-PR prerelease (playground-pr-<N>) and post a sticky comment with a one-click link (blueprint inlined as URL-safe base64, so no per-PR file hosting).Why a build (not the source archive)
mod_exelearningcan point the playground at a GitHub source archive because Moodle plugins run from source. Herejs/*.jsis git-ignored — the compiled Vue/webpack bundle isn't in the repo — so the preview must build the app and host the artifact. Hosting uses GitHub Releases (prereleases), so no extra infra (Pages, third-party) is needed.Requires the
installAppblueprint step: ateeducacion/nextcloud-playground#1. The badge starts working once both PRs are merged, the playground redeploys to GitHub Pages, and aplaygroundprerelease withexelearning.zipexists (created by the first push tomainafter merge).Caveats
Test
make package-zip PACKAGE_VERSION=previewbuilds a valid ZIP withexelearning/as the single top-level dir and the version stamped. ✅