-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add GitHub template support for stack deployments #1544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9bfb21b to
50b25f0
Compare
Add support for deploying stacks from GitHub template repositories. Template names like "mittwald/n8n" are automatically converted to "mittwald/stack-template-n8n" repositories. Fetches both docker-compose.yml and .env files from the main branch. Features: - New --from-template flag (mutually exclusive with --compose-file) - Custom error types for better error handling (TemplateFileNotFoundError, GitHubRateLimitError, TemplateNetworkError) - Environment variable precedence: template .env < process.env < --env-file - Comprehensive unit tests with axios mocking 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
50b25f0 to
6fb6e39
Compare
…e stack ID Add support for filling missing environment variables from templates using __PROMPT__ and __GENERATE__ placeholders, retrieve existing stack state before deploying, and auto-resolve stack ID from project context. Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for deploying container stacks directly from GitHub template repositories using a new --from-template flag. Users can now quickly deploy pre-configured applications without managing local docker-compose files.
Changes:
- Introduces template loading functionality with GitHub repository fetching and environment variable handling
- Adds a custom retrieve function to automatically detect single stacks in a project context
- Updates the deploy command to support both local file and template-based deployments
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/resources/stack/template-loader.ts | Core template loading logic with GitHub API integration and error handling |
| src/lib/resources/stack/template-loader.test.ts | Comprehensive test suite for template loading functionality |
| src/lib/resources/stack/flags.ts | Adds automatic stack ID retrieval for single-stack projects |
| src/lib/resources/stack/env.ts | Extends environment handling with prompt and generate placeholders |
| src/lib/context/FlagSetBuilder.ts | Adds retrieveFunction option to flag set builder |
| src/commands/stack/deploy.tsx | Integrates template loading into deploy command with new flag |
| docs/stack.md | Documents the new --from-template flag and its behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Summary
Adds support for deploying stacks directly from GitHub template repositories using the new
--from-templateflag.This enables users to quickly deploy pre-configured application stacks without manually managing docker-compose files locally. Template names like
mittwald/n8nautomatically resolve to the correspondingmittwald/stack-template-n8nrepository.What This Enables
Quick Stack Deployment
Deploy popular applications instantly from curated templates:
Template Repository Naming
Template names follow a simple convention:
mittwald/n8ngithub.com/mittwald/stack-template-n8nEnvironment Configuration
Templates can include default environment variables via
.envfiles, which can be overridden:Environment Variable Priority (from lowest to highest):
.envfile (if present)--env-fileflagBehavior
docker-compose.ymland optional.envfrom the template repository'smainbranch--compose-fileflag (prevents accidental mixing of local and remote sources)Use Cases
🤖 Generated with Claude Code