feat(packs): configure-and-deploy from registry (variables form + deploy-pack landing) - #17
Merged
Merged
Conversation
The Nomad Pack gallery deployed with defaults only. Now picking a pack opens a
configure step: it fetches the registry's per-pack JSON (api.nomad.getNomadPack)
and renders a form from the pack's variable schema — scalar vars only, plumbing
vars (job_name/namespace/datacenters/constraints) hidden, secrets masked,
placeholder ("change-me") vars required. The chosen values are serialized to the
pack var-file (composeFile, HCL) so `nomad-pack run --var-file` picks them up.
Quick facts (tasks/ports/bundled DB) are shown; packs with no schema fall back to
"create with defaults". Also adds optional deep-link props (defaultOpen /
initialPackName / initialRegistryUrl) for a future "Deploy to Nomploy" link.
Backend query getNomadPack already landed in main (cea80c1).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thank you for your contribution! Please sign our Contributor License Agreement by posting the following comment: I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
Adds /dashboard/deploy-pack?pack=<id>®istry=<url> — the target of a "Deploy to Nomploy" link from a pack registry (e.g. packs.nomploy.com). The logged-in user picks a project + environment (auto-selected when there's only one), then the Nomad Pack configure dialog opens pre-filled with that pack; on success it jumps to the environment. AddPack gains `hideTrigger` (render standalone, outside a dropdown menu, driven by defaultOpen) and `onCreated` (host page redirect) to support this. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Guard projectList[0] / environments[0] behind a local so tsc narrows them — the surrounding length checks already made these runtime-safe, but the prod build (tsconfig noUncheckedIndexedAccess) flagged them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
The panel side of the "registry as an app store" axis. Two parts:
1. Configure-before-deploy (variables form) —
add-pack.tsxThe Nomad Pack gallery deployed with defaults only. Now picking a pack opens a configure step that fetches the registry's per-pack JSON (
api.nomad.getNomadPack) and renders a form from the pack's variable schema — scalar vars only; plumbing vars (job_name/namespace/datacenters/constraints) hidden;sensitivemasked;placeholder("change-me") vars required; quick facts (tasks/ports/bundled DB) shown. Chosen values are serialized to the pack var-file (composeFile, HCL) so the existinggetBuildNomadPackCommandrunsnomad-pack run --var-file. Packs with no schema fall back to "create with defaults".2. Deep-link landing page —
pages/dashboard/deploy-pack.tsxTarget of a "Deploy to Nomploy" link from a registry (packs.nomploy.com carries
?pack=<id>®istry=<url>). The logged-in user picks a project + environment (auto-selected when there's only one), then the configure dialog opens pre-filled; on success it jumps to the environment.AddPackgainedhideTrigger(standalone, outside a dropdown) andonCreated(host redirect).Note: the backend query
nomad.getNomadPackalready landed inmain(bundled intocea80c121during a concurrent release), so this PR is frontend-only.tsc --noEmitclean; biome-formatted.Pairs with the registry site button (Nomploy/nomad-packs#128, merged) and the CI smoke-test (Nomploy/nomad-packs#127, merged).
🤖 Generated with Claude Code