Skip to content

Conversation

@martin-helmich
Copy link
Member

Summary

Adds support for deploying stacks directly from GitHub template repositories using the new --from-template flag.

This enables users to quickly deploy pre-configured application stacks without manually managing docker-compose files locally. Template names like mittwald/n8n automatically resolve to the corresponding mittwald/stack-template-n8n repository.

What This Enables

Quick Stack Deployment
Deploy popular applications instantly from curated templates:

mw stack deploy --from-template=mittwald/n8n --stack-id=s-abc123

Template Repository Naming
Template names follow a simple convention:

  • Input: mittwald/n8n
  • Resolves to: github.com/mittwald/stack-template-n8n

Environment Configuration
Templates can include default environment variables via .env files, which can be overridden:

# Use template defaults
mw stack deploy --from-template=mittwald/n8n

# Override with local environment
mw stack deploy --from-template=mittwald/n8n --env-file=./production.env

Environment Variable Priority (from lowest to highest):

  1. Template .env file (if present)
  2. System environment variables
  3. Local --env-file flag

Behavior

  • Fetches docker-compose.yml and optional .env from the template repository's main branch
  • Mutually exclusive with --compose-file flag (prevents accidental mixing of local and remote sources)
  • Clear error messages for common issues (template not found, rate limits, network errors)
  • No local caching - always fetches fresh template content

Use Cases

  • Quick prototyping: Spin up applications without setup overhead
  • Standardized deployments: Teams can share vetted stack configurations via templates
  • Easy onboarding: New users can deploy complex stacks with a single command
  • Version consistency: Templates ensure everyone uses the same configuration

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants