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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd4b86a1b7dc7acf4f88189a24b5d39c5cfcf71f512aafb5f04fb0af6d558a65
4
- data.tar.gz: cdc8752352bca6b2ff3cce8a9abcf249c6975c0949d3a95b745be7fc2096544c
3
+ metadata.gz: ef904a59417a3f019eab7e6339fc6d13290bf05ff3d1d435c434834cea189bc2
4
+ data.tar.gz: 93a8820ef48b523d41e7a4aa8d0544090b2472bc7805b96bfee9f0f45c8e8114
5
5
  SHA512:
6
- metadata.gz: 380937f0579d856a0f34407d5d1496306d5c9be64fb192d409e0bb78d2f6faea1d2016ae7db773312d92ff3f71876681b8e0d0384f2fc9127abd7eca386f5fbc
7
- data.tar.gz: 927a7c107926e787be5fe8ade9a0df86429b75ece20468176d4afa8de6ef15ccd10b3d99471c3cc52f3f7870dc6e5c18486a1578d0c6a8a58565a0d06c93023d
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-approve)'
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 dev --auto # Deploy without confirmation'
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 (unless --auto)
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 dev --auto # Deploy without confirmation (CI mode)
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
@@ -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 (interactive)
11
- belt deploy prod --auto # skip confirmation prompt
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
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Belt
4
- VERSION = '0.6.6'
4
+ VERSION = '0.6.7'
5
5
 
6
6
  # Ruby version new apps run on in Lambda. Rendered into the conveyor-belt
7
7
  # provider block (`ruby_version`) by `belt new` / `belt generate environment`.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: belt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stowzilla