deploy-stack 0.9.14 → 0.9.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -30,7 +30,7 @@ You retain complete ownership of your infrastructure code without relying on bla
30
30
  * **Hardened, Unprivileged Containers:** Built-in Dockerfile generators explicitly drop root privileges and utilize `nginx-unprivileged` for maximum Fargate security compliance.
31
31
  * **Cost & Observability Baselines:** Prevents runaway AWS bills with explicit 14-day CloudWatch log retention policies and auto-generates 5XX error alerting.
32
32
  * **Safe Overwrite Flow:** Idempotent CLI safely backs up existing configurations to timestamped `.bak` files and updates `.gitignore` to guarantee zero data loss during rapid iteration.
33
- * **Framework Agnostic:** Tailored container presets for Next.js, Express.js, FastAPI, and **Zero-Config Static Sites** (React, Vue, SvelteKit, Astro, Vite).
33
+ * **Framework Agnostic:** Tailored container presets for Next.js, Express.js, FastAPI, Go, Django, Ruby on Rails, Nuxt 3, and **Zero-Config Static Sites** (React, Vue, SvelteKit, Astro, Vite).
34
34
  * **Smart Git Integration:** Automatically detects your working branch (`main`, `master`, `develop`) and binds it directly to the generated GitHub Actions pipeline.
35
35
  * **Production-Grade Defaults:** Automatically provisions an Amazon ECS Fargate cluster fronted by an Application Load Balancer across multiple availability zones.
36
36
  * **Global Edge Acceleration:** Includes an integrated AWS CloudFront CDN distribution with SSL termination and optimized caching.
@@ -39,6 +39,7 @@ You retain complete ownership of your infrastructure code without relying on bla
39
39
  * **Built-in Secrets Sync:** Provides a dedicated CLI workflow to securely push local `.env` variables into AWS Secrets Manager and map them directly into containers at runtime.
40
40
  * **Ecosystem Ready:** Integrated directly with the [deploy-stack GitHub Action](https://github.com/marketplace/actions/deploy-stack-aws-fargate-terraform-deploy) for a secure, boilerplate-free continuous deployment pipeline.
41
41
  * **Database Scaffolding:** Automatically provisions fully isolated, zero-trust AWS RDS PostgreSQL databases for backend monoliths.
42
+ * **Smart Boilerplate Resolution:** Intelligently detects and optionally safely disables default framework CI pipelines (e.g., Rails `ci.yml`) that crash in isolated environments, guaranteeing a green pipeline on the first run.
42
43
  * **Safe Teardown:** Completely remove all generated AWS resources and empty S3 state buckets with a single `destroy` command.
43
44
 
44
45
  ---
@@ -68,6 +69,8 @@ npx deploy-stack secrets push .env.production
68
69
  ```
69
70
  *This command encrypts your values in AWS Secrets Manager and updates `terraform/secret_keys.json` to expose those variables inside your ECS tasks at boot.*
70
71
 
72
+ *Note: For frameworks like Ruby on Rails, `deploy-stack` automatically detects your local `config/master.key` and securely injects it into AWS Secrets Manager via git-ignored `.auto.tfvars` files—ensuring zero hardcoded secrets.*
73
+
71
74
  ---
72
75
 
73
76
  ## 🛠️ Next Steps After Generation
@@ -125,6 +128,10 @@ your-project/
125
128
  * **[Create React App](https://github.com/anton-codes-iac/deploy-stack-cra-example):** Validates backward compatibility with legacy Webpack pipelines and `build/` auto-detection.
126
129
  * **[Astro Static Site](https://github.com/anton-codes-iac/deploy-stack-astro-example):** Demonstrates modern static site generation (SSG).
127
130
  * **[SvelteKit Application](https://github.com/anton-codes-iac/deploy-stack-svelte-example):** Demonstrates static adapter integration and custom output folder detection.
131
+ * **[Ruby on Rails](https://github.com/anton-codes-iac/deploy-stack-rails-example):** A production Rails 7+ setup featuring an auto-provisioned PostgreSQL database and secure `.auto.tfvars` Master Key injection.
132
+ * **[Nuxt 3 (SSR)](https://github.com/anton-codes-iac/deploy-stack-nuxt-example):** Demonstrates a fully server-side rendered Nuxt application using Nitro's optimized Node output.
133
+ * **[Django / Python](https://github.com/anton-codes-iac/deploy-stack-django-example):** A secure Gunicorn/WSGI implementation with PostgreSQL and unprivileged container adapters.
134
+ * **[Go / Fiber](https://github.com/anton-codes-iac/deploy-stack-go-example):** A distroless, compiled Go binary deployment demonstrating ultra-low memory footprints and instant boot times.
128
135
  ---
129
136
 
130
137
  ## 🛡️ Telemetry & Privacy
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deploy-stack",
3
- "version": "0.9.14",
3
+ "version": "0.9.15",
4
4
  "description": "Provision production-ready AWS infrastructure and CI/CD pipelines in seconds.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -214,6 +214,26 @@ export async function mainStack() {
214
214
  const deployBranch = project.branch || currentGitBranch;
215
215
  const buildDir = detectedFramework?.buildDir || 'dist';
216
216
 
217
+ // 7.4 Check for conflicting CI boilerplate (Rails)
218
+ let disableDefaultCI = false;
219
+ if (finalFramework === 'rails') {
220
+ const ciPath = path.join(targetDir, '.github', 'workflows', 'ci.yml');
221
+ const dependabotPath = path.join(targetDir, '.github', 'dependabot.yml');
222
+
223
+ if (fsSync.existsSync(ciPath) || fsSync.existsSync(dependabotPath)) {
224
+ console.log('');
225
+ const ciContent = await confirm({
226
+ message: color.yellow('We detected default Rails GitHub Actions (ci.yml, dependabot.yml) that usually crash in isolated CI environments without a database. Would you like deploy-stack to safely disable them by renaming them to .bak?'),
227
+ initialValue: true,
228
+ });
229
+ if (typeof ciContent === 'symbol') {
230
+ cancel('Provisioning cancelled.');
231
+ process.exit(0);
232
+ }
233
+ disableDefaultCI = ciContent;
234
+ }
235
+ }
236
+
217
237
  // 7.5. The Pre-Flight Cost Estimator
218
238
  // We explicitly ask for financial consent to eliminate AWS billing anxiety.
219
239
  console.log(''); // Add a blank line for visual pacing
@@ -266,7 +286,8 @@ export async function mainStack() {
266
286
  BUILD_DIR: buildDir,
267
287
  finalFramework: finalFramework,
268
288
  NEEDS_DATABASE: needsDatabase,
269
- DJANGO_WSGI: djangoWsgi
289
+ DJANGO_WSGI: djangoWsgi,
290
+ DISABLE_DEFAULT_CI: disableDefaultCI
270
291
  });
271
292
 
272
293
  // 11. Track the event in telemetry
@@ -67,6 +67,10 @@ Make sure your app returns a `200 OK` at your configured path:
67
67
  * **Next.js (App Router):** Create `app/api/health/route.ts` returning a 200 response.
68
68
  * **Express.js:** Add `app.get('/api/health', (req, res) => res.sendStatus(200));`
69
69
  * **FastAPI/Python:** Add `@app.get("/api/health")` returning a 200 status.
70
+ * **Ruby on Rails:** Rails 7.1+ includes a default `/up` health check. Ensure `Rails.application.config.force_ssl = true` isn't blocking HTTP health checks from the ALB.
71
+ * **Django:** Add a simple view in `urls.py` that returns `HttpResponse("OK", status=200)` at your configured path.
72
+ * **Go:** Add a handler to your mux: `http.HandleFunc("/api/health", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(200) })`
73
+ * **Nuxt 3:** Create a server route at `server/routes/health.ts` returning `200`.
70
74
 
71
75
  ### 2. Enable Standalone Output (Next.js ONLY)
72
76
 
@@ -91,6 +95,10 @@ When running inside a Docker container, your server must bind to all network int
91
95
  Make sure your app is configured correctly:
92
96
  * **Express.js:** `app.listen(port, '0.0.0.0', () => ...)`
93
97
  * **FastAPI:** `uvicorn.run(app, host="0.0.0.0", port=8000)`
98
+ * **Ruby on Rails:** Bound automatically by the CLI's Puma command (`-b tcp://0.0.0.0:{{PORT}}`).
99
+ * **Django:** Bound automatically by the CLI's Gunicorn command (`--bind 0.0.0.0:{{PORT}}`).
100
+ * **Go:** Ensure your `ListenAndServe` string looks like this: `http.ListenAndServe(":8080", nil)` or `http.ListenAndServe("0.0.0.0:8080", nil)`.
101
+ * **Nuxt 3:** Bound automatically via the `NITRO_HOST=0.0.0.0` environment variable injected by the CLI Dockerfile.
94
102
 
95
103
  ### 4. Static Sites (Vite, Astro, React, Vue, SvelteKit)
96
104