deploy-stack 0.9.12 → 0.9.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deploy-stack",
3
- "version": "0.9.12",
3
+ "version": "0.9.14",
4
4
  "description": "Provision production-ready AWS infrastructure and CI/CD pipelines in seconds.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -94,28 +94,29 @@ export async function generateTemplates(targetDir, config) {
94
94
 
95
95
  // 6. Create .dockerignore to keep images lean and secure
96
96
  const dockerignorePath = path.join(targetDir, '.dockerignore');
97
+ const appendDockerIgnore = '\n# Infrastructure (deploy-stack)\nterraform/\n**/.terraform/\n**/.terraform.*\n**/*.tfstate*\n.env\n';
98
+
97
99
  if (!fsSync.existsSync(dockerignorePath)) {
98
100
  const dockerignoreContent = `
99
101
  .git/
100
102
  .github/
101
- terraform/
102
- **/.terraform/
103
- **/.terraform.*
104
- **/*.tfstate*
105
- .env
106
103
  README.md
107
104
  node_modules/
108
105
  npm-debug.log
109
106
  __pycache__/
110
107
  *.pyc
111
108
  .DS_Store
112
- `.trim();
109
+ `.trim() + appendDockerIgnore;
113
110
  await fs.writeFile(dockerignorePath, dockerignoreContent);
111
+ } else {
112
+ const existingDockerignore = await fs.readFile(dockerignorePath, 'utf-8');
113
+ if (!existingDockerignore.includes('terraform/')) {
114
+ await fs.appendFile(dockerignorePath, appendDockerIgnore);
115
+ }
114
116
  }
115
- }
116
117
 
117
- function getGitignoreContent(framework) {
118
- const baseIgnore = `
118
+ function getGitignoreContent(framework) {
119
+ const baseIgnore = `
119
120
  # Infrastructure (deploy-stack)
120
121
  terraform/.terraform/
121
122
  terraform/*.tfstate
@@ -130,17 +131,34 @@ terraform/*.auto.tfvars
130
131
  Thumbs.db
131
132
  `;
132
133
 
133
- const presets = {
134
- node: '\n# Node.js\nnode_modules/\nnpm-debug.log\nyarn-error.log\n',
135
- nextjs: '\n# Next.js\nnode_modules/\n.next/\nout/\nbuild/\nnext-env.d.ts\n',
136
- nuxt: '\n# Nuxt 3\nnode_modules/\n.nuxt/\n.output/\ndist/\n',
137
- python: '\n# Python\n__pycache__/\n*.py[cod]\n*$py.class\nvenv/\nenv/\n.venv/\n.pytest_cache/\n',
138
- django: '\n# Django\n*.log\n*.pot\n*.pyc\n__pycache__/\ndb.sqlite3\nmedia/\n',
139
- go: '\n# Go\n/bin/\n/pkg/\n/obj/\n*.exe\n*.exe~*\n*.dll\n*.so\n*.dylib\n',
140
- rails: '\n# Rails\n/*.log\n/tmp/\n/log/\n/public/system/\n/public/assets/\n/vendor/bundle/\n',
141
- static: '\n# Static Sites\nnode_modules/\ndist/\nbuild/\nout/\n.output/\n.cache/\npublic/\n'
142
- };
143
-
144
- const frameworkIgnore = presets[framework] || '';
145
- return (baseIgnore + frameworkIgnore).trim();
134
+ const presets = {
135
+ node: '\n# Node.js\nnode_modules/\nnpm-debug.log\nyarn-error.log\n',
136
+ nextjs: '\n# Next.js\nnode_modules/\n.next/\nout/\nbuild/\nnext-env.d.ts\n',
137
+ nuxt: '\n# Nuxt 3\nnode_modules/\n.nuxt/\n.output/\ndist/\n',
138
+ python: '\n# Python\n__pycache__/\n*.py[cod]\n*$py.class\nvenv/\nenv/\n.venv/\n.pytest_cache/\n',
139
+ django: '\n# Django\n*.log\n*.pot\n*.pyc\n__pycache__/\ndb.sqlite3\nmedia/\n',
140
+ go: '\n# Go\n/bin/\n/pkg/\n/obj/\n*.exe\n*.exe~*\n*.dll\n*.so\n*.dylib\n',
141
+ rails: '\n# Rails\n/*.log\n/tmp/\n/log/\n/public/system/\n/public/assets/\n/vendor/bundle/\n',
142
+ static: '\n# Static Sites\nnode_modules/\ndist/\nbuild/\nout/\n.output/\n.cache/\npublic/\n'
143
+ };
144
+
145
+ const frameworkIgnore = presets[framework] || '';
146
+ return (baseIgnore + frameworkIgnore).trim();
147
+ }
148
+
149
+ // 7. Framework-specific cleanup
150
+ // Disable default workflows that crash in isolated CI environments
151
+ if (config.finalFramework === 'rails') {
152
+ const railsCiPath = path.join(targetDir, '.github', 'workflows', 'ci.yml');
153
+ const dependabotPath = path.join(targetDir, '.github', 'dependabot.yml');
154
+
155
+ if (fsSync.existsSync(railsCiPath)) {
156
+ fsSync.renameSync(railsCiPath, `${railsCiPath}.bak`);
157
+ console.log(' ⚠️ Disabled default Rails ci.yml (renamed to .bak) to prevent database connection crashes in CI.');
158
+ }
159
+ if (fsSync.existsSync(dependabotPath)) {
160
+ fsSync.renameSync(dependabotPath, `${dependabotPath}.bak`);
161
+ console.log(' ⚠️ Disabled default dependabot.yml (renamed to .bak) to prevent automated PRs from triggering the broken CI suite.');
162
+ }
163
+ }
146
164
  }
@@ -65,8 +65,8 @@ output "z_NEXT_STEP_REQUIRED" {
65
65
  🚀 INFRASTRUCTURE PROVISIONED SUCCESSFULLY!
66
66
  ====================================================================
67
67
 
68
- Your AWS environment is ready. However, your URLs will return an
69
- error until your application code is actually deployed.
68
+ Your AWS environment is ready. However, your URLs listed above will
69
+ return an error until your application code is actually deployed.
70
70
 
71
71
  TO DEPLOY YOUR APP:
72
72
  1. git add .