belt 0.6.6 → 0.6.7
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/belt/cli/deploy_command.rb +21 -9
- data/lib/belt/docs/deployment.md +10 -2
- data/lib/belt/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ef904a59417a3f019eab7e6339fc6d13290bf05ff3d1d435c434834cea189bc2
|
|
4
|
+
data.tar.gz: 93a8820ef48b523d41e7a4aa8d0544090b2472bc7805b96bfee9f0f45c8e8114
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b562534dbed0dcad13db7d4e6f0ff9ff99f469af4de025a682902375d39ffe0bf73447a749674443acb81632e40f2f2c4b0e34ceced872a37d4a904dd5725b7f
|
|
7
|
+
data.tar.gz: d0915177422b65ef6f9a2dfb542cdd63b578acdbae1abf97cc4699354400b046e507818f71f7756a73f54183916921d2ad6862c877c4b8385fc6feb22ebd7b2d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.6.7
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **Non-prod deploys auto-approve by default.** `belt deploy <env>` no longer
|
|
10
|
+
prompts for confirmation when the environment isn't `prod`/`production` — the
|
|
11
|
+
Terraform plan is applied straight away. `prod` still prompts unless you pass
|
|
12
|
+
`--auto`. Pass `--confirm` (alias `--no-auto`) to force the prompt on any
|
|
13
|
+
environment. No more typing `--auto` on every dev deploy.
|
|
14
|
+
|
|
3
15
|
## 0.6.6
|
|
4
16
|
|
|
5
17
|
### Added
|
|
@@ -32,6 +32,7 @@ module Belt
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
auto_approve = false
|
|
35
|
+
force_confirm = false
|
|
35
36
|
rebuild = false
|
|
36
37
|
skip_backup = false
|
|
37
38
|
backup_only = false
|
|
@@ -42,6 +43,8 @@ module Belt
|
|
|
42
43
|
case arg
|
|
43
44
|
when '--auto', '--yes', '-y'
|
|
44
45
|
auto_approve = true
|
|
46
|
+
when '--confirm', '--no-auto'
|
|
47
|
+
force_confirm = true
|
|
45
48
|
when '--rebuild'
|
|
46
49
|
rebuild = true
|
|
47
50
|
when '--skip-backup', '--no-backup'
|
|
@@ -69,13 +72,14 @@ module Belt
|
|
|
69
72
|
puts 'Usage: belt deploy [environment] [options]'
|
|
70
73
|
puts "\nDefaults to BELT_ENV or the first available environment."
|
|
71
74
|
puts "\nOptions:"
|
|
72
|
-
puts ' --auto, --yes, -y Skip confirmation prompt (auto-
|
|
75
|
+
puts ' --auto, --yes, -y Skip confirmation prompt (prod only; non-prod auto-approves)'
|
|
76
|
+
puts ' --confirm, --no-auto Force the confirmation prompt even for non-prod envs'
|
|
73
77
|
puts ' --rebuild Rebuild and push Lambda code directly (bypasses Terraform)'
|
|
74
78
|
puts ' -h, --help Show this help'
|
|
75
79
|
puts "\nExamples:"
|
|
76
|
-
puts ' belt deploy # Deploy dev (or BELT_ENV)'
|
|
77
|
-
puts ' belt deploy prod # Deploy to prod'
|
|
78
|
-
puts ' belt deploy
|
|
80
|
+
puts ' belt deploy # Deploy dev (or BELT_ENV), no prompt'
|
|
81
|
+
puts ' belt deploy prod # Deploy to prod (prompts)'
|
|
82
|
+
puts ' belt deploy prod --auto # Deploy prod without confirmation'
|
|
79
83
|
puts ' belt deploy --rebuild # Fast code push (no infra changes)'
|
|
80
84
|
puts ' belt deploy frontend dev # Deploy frontend(s)'
|
|
81
85
|
puts ' belt deploy frontend dev --frontend ops'
|
|
@@ -84,6 +88,10 @@ module Belt
|
|
|
84
88
|
end
|
|
85
89
|
end
|
|
86
90
|
|
|
91
|
+
# Non-prod environments auto-approve by default — prod always prompts
|
|
92
|
+
# unless --auto is explicit. Pass --confirm to force the prompt anywhere.
|
|
93
|
+
auto_approve = true if !force_confirm && !%w[prod production].include?(env)
|
|
94
|
+
|
|
87
95
|
options = { auto_approve: auto_approve, skip_migrations: skip_migrations, extra_args: filtered_args }
|
|
88
96
|
if backup_only
|
|
89
97
|
new(env, **options, skip_backup: false).run_backup_only
|
|
@@ -108,13 +116,16 @@ module Belt
|
|
|
108
116
|
4. Build sidecar Lambda zips Terraform needs at plan time
|
|
109
117
|
5. terraform init (initialize providers/modules)
|
|
110
118
|
6. terraform plan (preview changes)
|
|
111
|
-
7. Prompt for confirmation (
|
|
119
|
+
7. Prompt for confirmation (prod only; non-prod auto-approves)
|
|
112
120
|
8. terraform apply (deploy changes)
|
|
113
121
|
9. Nested envs: share parent Cognito + copy DynamoDB if empty
|
|
114
122
|
10. Run pending data migrations in db/migrate (see `belt db:migrate`)
|
|
115
123
|
|
|
116
124
|
Options:
|
|
117
|
-
--auto, --yes, -y Skip confirmation prompt (auto-approve)
|
|
125
|
+
--auto, --yes, -y Skip confirmation prompt (auto-approve). Non-prod
|
|
126
|
+
environments auto-approve by default, so this is only
|
|
127
|
+
needed for prod.
|
|
128
|
+
--confirm, --no-auto Force the confirmation prompt even for non-prod envs
|
|
118
129
|
--rebuild Rebuild and push Lambda code directly (bypasses Terraform).
|
|
119
130
|
Much faster for code-only changes — packages gems via Docker,
|
|
120
131
|
zips, and pushes with `aws lambda update-function-code`.
|
|
@@ -140,9 +151,10 @@ module Belt
|
|
|
140
151
|
end
|
|
141
152
|
|
|
142
153
|
Examples:
|
|
143
|
-
belt deploy # Deploy dev (or BELT_ENV)
|
|
144
|
-
belt deploy prod # Deploy to prod
|
|
145
|
-
belt deploy
|
|
154
|
+
belt deploy # Deploy dev (or BELT_ENV), no prompt
|
|
155
|
+
belt deploy prod # Deploy to prod (prompts for confirmation)
|
|
156
|
+
belt deploy prod --auto # Deploy to prod without confirmation (CI mode)
|
|
157
|
+
belt deploy dev --confirm # Force the confirmation prompt on dev
|
|
146
158
|
belt deploy --rebuild # Fast code push to dev (no infra changes)
|
|
147
159
|
belt deploy prod --rebuild # Fast code push to prod
|
|
148
160
|
belt deploy prod --skip-backup # Skip backups for this deploy
|
data/lib/belt/docs/deployment.md
CHANGED
|
@@ -7,13 +7,21 @@ Lambda packaging, and pre-deploy backups.
|
|
|
7
7
|
## Quick Deploy
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
belt deploy <env> # init → plan → apply
|
|
11
|
-
belt deploy prod
|
|
10
|
+
belt deploy <env> # init → plan → apply
|
|
11
|
+
belt deploy prod # prod prompts for confirmation
|
|
12
|
+
belt deploy prod --auto # skip prod's confirmation prompt (CI)
|
|
13
|
+
belt deploy dev # non-prod auto-approves — no prompt
|
|
14
|
+
belt deploy dev --confirm # force the prompt on a non-prod env
|
|
12
15
|
belt deploy prod --skip-backup # skip pre-deploy backup
|
|
13
16
|
belt deploy --backup-only # create recovery point without deploying
|
|
14
17
|
belt deploy dev --skip-migrations # don't run pending db/migrate migrations
|
|
15
18
|
```
|
|
16
19
|
|
|
20
|
+
Non-prod environments auto-approve the Terraform plan by default — only `prod`
|
|
21
|
+
(and `production`) prompt. Pass `--confirm` (alias `--no-auto`) to force the
|
|
22
|
+
prompt anywhere; `--auto` still works everywhere and is what you want in CI for
|
|
23
|
+
prod.
|
|
24
|
+
|
|
17
25
|
## First-Time Setup
|
|
18
26
|
|
|
19
27
|
```bash
|
data/lib/belt/version.rb
CHANGED