renuo-cli 4.17.1 → 4.17.2

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: d001b3727b2158e75b84057e5520246f4a4983ebc9008a97802134a07a7fe9a1
4
- data.tar.gz: d258158583a1659efea53a52cfb1e29569753e55e4c30d62c95984fed5498813
3
+ metadata.gz: 4bd8ae089520815a2934d6aa8bd1b7209af01e717c1e623c0a53bfb0cda0931e
4
+ data.tar.gz: 49c94fd014528566a51727e6f7938b56ff8a0ec37aa93c5a4292b3ba10a0abd2
5
5
  SHA512:
6
- metadata.gz: cea757ec3ba510fbec394fe7d313edac2ef4db8e7d31f53e0c9cf83af0ef8d8225e53fa68a3f3c4beea206ef55e022774ef2cd342a1545aa4af925016b936bb1
7
- data.tar.gz: 38a9b4a0b037a9ec087fd39060b7b154fbb5ce77533e80f9d977246c62f25fc3dee99e88f36ac7cdf96ec7eb01f7651ef6a89eac22bcb43dbf8c2a95ae1a35bd
6
+ metadata.gz: 6d960d53deb1dc144cfeaa77311732139c0e29f651567934a7fbd3ea9d3a812f8f6fa77f83d90338ccc4fe55bf3f7a528aaa1e2191dbb120f09db031a13c8582
7
+ data.tar.gz: e70f032d4d4c1b7323cd5fc177d93e6c9d37ff83b72a54e3ee5be368eb07e88132fd81e50233217ef862ce1b3d5df696bfb957390f664f40b530f4e0a13360b7
@@ -83,6 +83,11 @@ class Renuo::Cli::Commands::CheckDeploioStatus
83
83
  when "available", "success"
84
84
  puts "#{type} succeeded"
85
85
  true
86
+ when "superseded"
87
+ puts "release was superseded"
88
+ true
89
+ when "paused"
90
+ abort "app is paused"
86
91
  when "error", "failed", "failure"
87
92
  puts fetch_build_logs
88
93
  abort "#{type} failed"
@@ -20,13 +20,14 @@ class Renuo::Cli::Commands::CreateDeploioApp # rubocop:disable Metrics/ClassLeng
20
20
  - Configure repository access by generating SSH keys and adding them to 1Password.
21
21
  - Create the application and database for each specified environment.
22
22
  DESC
23
- c.example "renuo create-deploio-app",
23
+ c.example "renuo create-deploio-app my-app git@github.com:renuo/my-app.git",
24
24
  "Prompts the user for the necessary information and generates the commands " \
25
25
  "to create the project, databases, and apps on Deploio."
26
- c.action { new.run }
26
+ c.action { |args| new.run(args) }
27
27
  end
28
28
 
29
- def run
29
+ def run(args)
30
+ @project_name, @git_url = args
30
31
  parse_arguments
31
32
  setup_commands
32
33
  setup_environments
@@ -59,12 +60,12 @@ class Renuo::Cli::Commands::CreateDeploioApp # rubocop:disable Metrics/ClassLeng
59
60
 
60
61
  def set_project_name
61
62
  loop do
62
- @project_name = ask("Enter the project name (e.g: my-app): ")
63
-
64
63
  break if @project_name&.length&.between?(3, 63) && @project_name.match?(/^[a-z0-9-]+$/)
65
64
 
66
65
  say ">> Project name must be between 3 and 63 characters and can only contain lowercase letters, " \
67
66
  "numbers, and hyphens. Please try again.".colorize(:red)
67
+
68
+ @project_name = ask("Enter the project name (e.g: my-app): ")
68
69
  end
69
70
 
70
71
  @project_display_name = @project_name
@@ -73,10 +74,11 @@ class Renuo::Cli::Commands::CreateDeploioApp # rubocop:disable Metrics/ClassLeng
73
74
 
74
75
  def set_git_url
75
76
  loop do
76
- @git_url = ask("Enter the git URL (e.g: git@github.com:my-org/my-app.git): ")
77
77
  break if @git_url.present? && git_url_valid?(@git_url)
78
78
 
79
79
  say ">> Git URL must be provided and valid. Please try again.".colorize(:red)
80
+
81
+ @git_url = ask("Enter the git URL: ") { |q| q.default = "git@github.com:renuo/#{@project_name}.git" }
80
82
  end
81
83
 
82
84
  return unless http_git_url?(@git_url)
@@ -87,27 +89,16 @@ class Renuo::Cli::Commands::CreateDeploioApp # rubocop:disable Metrics/ClassLeng
87
89
 
88
90
  def set_postgres_version
89
91
  loop do
90
- @postgres_version = ask("Enter Postgres version (e.g., 16) or leave empty to skip database creation: ")
92
+ @postgres_version = ask("Enter Postgres version (e.g., 17) or leave empty to skip database creation: ")
91
93
  break if @postgres_version.empty? || @postgres_version.match?(/^\d+$/)
92
94
 
93
95
  say ">> The postgres version is invalid. Only major versions are allowed. " \
94
- "For example, use 16 instead of 16.4. Please try again.".colorize(:red)
96
+ "For example, use 17 instead of 17.4. Please try again.".colorize(:red)
95
97
  end
96
98
  end
97
99
 
98
- def set_vault_name # rubocop:disable Metrics/MethodLength
99
- loop do
100
- @vault_name = ask("Enter the 1Password vault name (leave empty to skip): ")
101
- if @vault_name.empty?
102
- say "Skipping 1Password vault setup. Defaulting to Deploio."
103
- @vault_name = "Deploio"
104
- break
105
- elsif @vault_name.present?
106
- break
107
- else
108
- say ">> The vault name must be provided. Please try again.".colorize(:red)
109
- end
110
- end
100
+ def set_vault_name
101
+ @vault_name = ask("Enter the 1Password vault name: ") { |q| q.default = "Deploio" }
111
102
  end
112
103
 
113
104
  def setup_commands
@@ -141,12 +132,20 @@ class Renuo::Cli::Commands::CreateDeploioApp # rubocop:disable Metrics/ClassLeng
141
132
  end
142
133
 
143
134
  def say_database_creation(environment)
144
- say <<~OUTPUT
145
- nctl create postgres #{environment} \\
146
- --project=#{@project_name} \\
147
- --postgres-version=#{@postgres_version} \\
148
- --machine-type=nine-db-xs
149
- OUTPUT
135
+ if environment == "main"
136
+ say <<~OUTPUT
137
+ nctl create postgres #{environment} \\
138
+ --project=#{@project_name} \\
139
+ --postgres-version=#{@postgres_version} \\
140
+ --machine-type=nine-db-xs
141
+ OUTPUT
142
+ else
143
+ say <<~OUTPUT
144
+ nctl create postgresdatabase #{environment} \\
145
+ --project=#{@project_name} \\
146
+ --postgres-database-version=#{@postgres_version}
147
+ OUTPUT
148
+ end
150
149
  end
151
150
 
152
151
  def say_app_creation(environment)
@@ -156,8 +155,8 @@ class Renuo::Cli::Commands::CreateDeploioApp # rubocop:disable Metrics/ClassLeng
156
155
  --git-ssh-private-key-from-file=#{GITHUB_SSH_KEY_FILE_NAME} \\
157
156
  --git-url=#{@git_url} \\
158
157
  --git-revision="#{environment}" \\
159
- --basic-auth=false `# Disabling Deploio basic auth as Rails app handles authentication` \\
160
- --build-env=SECRET_KEY_BASE='rails secret' `# Do not forget to generate the secret key` \\
158
+ --basic-auth=#{environment == "develop"} \\
159
+ --build-env=SECRET_KEY_BASE="$(rails secret)" \\
161
160
  --language=ruby \\
162
161
  --size=mini
163
162
  OUTPUT
@@ -167,6 +166,7 @@ class Renuo::Cli::Commands::CreateDeploioApp # rubocop:disable Metrics/ClassLeng
167
166
  say <<~OUTPUT
168
167
  # Create SSH key item in 1Password directly
169
168
  op item create \\
169
+ --account renuo.1password.com \\
170
170
  --category ssh \\
171
171
  --ssh-generate-key #{SSH_ALGORITHM.downcase} \\
172
172
  --title "#{@project_name}-deploy-key" \\
@@ -175,8 +175,10 @@ class Renuo::Cli::Commands::CreateDeploioApp # rubocop:disable Metrics/ClassLeng
175
175
 
176
176
  # Extract keys to temp files for deploio usage
177
177
  op item get "#{@project_name}-deploy-key" --vault #{@vault_name} \\
178
+ --account renuo.1password.com \\
178
179
  --reveal --fields "public key" > #{file_name}.pub
179
180
  op item get "#{@project_name}-deploy-key" --vault #{@vault_name} --reveal \\
181
+ --account renuo.1password.com \\
180
182
  --fields "private key" --format json | jq -r '.ssh_formats.openssh.value' > #{file_name}
181
183
  OUTPUT
182
184
  end
@@ -3,7 +3,7 @@
3
3
  # :nocov:
4
4
  module Renuo
5
5
  class Cli
6
- VERSION = "4.17.1"
6
+ VERSION = "4.17.2"
7
7
  NAME = "renuo-cli"
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renuo-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.17.1
4
+ version: 4.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renuo AG
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  requirements: []
139
- rubygems_version: 3.7.2
139
+ rubygems_version: 4.0.2
140
140
  specification_version: 4
141
141
  summary: The Renuo CLI automates some common workflows.
142
142
  test_files: []