renuo-cli 4.10.2 → 4.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/renuo/cli/app/check_deploio_status.rb +2 -0
- data/lib/renuo/cli/app/create_deploio_app.rb +166 -0
- data/lib/renuo/cli/version.rb +1 -1
- data/lib/renuo/cli.rb +22 -1
- metadata +4 -220
- data/.editorconfig +0 -21
- data/.gitignore +0 -106
- data/.mdlrc +0 -2
- data/.rspec +0 -2
- data/.rubocop.yml +0 -11
- data/.ruby-version +0 -1
- data/.semaphore/bin/cache_restore +0 -16
- data/.semaphore/bin/cache_store +0 -16
- data/.semaphore/main-deploy.yml +0 -18
- data/.semaphore/semaphore.yml +0 -37
- data/Gemfile +0 -5
- data/Rakefile +0 -10
- data/bin/check +0 -26
- data/bin/console +0 -11
- data/bin/run +0 -7
- data/bin/setup +0 -6
- data/config/1password-secrets.yml +0 -11
- data/notification.yml +0 -25
- data/renuo-cli.gemspec +0 -48
- data/vcr_cassettes/successful_uptimerobot_calls.yml +0 -93
- data/vcr_cassettes/unsuccessful_uptimerobot_calls.yml +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7a64110378ec1c2591e47e75409554144f7f5f718dd8634978b6137d3a2f85e
|
4
|
+
data.tar.gz: cb5c0f8744b0f38fe14124e50b7935c7d5ccc7a681da9ed326549707ba4d9d1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7cf8a49e4c273c3fdecddb2422198f9e3fd517ac086db2fdd66a6691955dcb7349bc0ea28fdc3d89655d9d7e9c37e363fc61c9e4a6fa20ee41eba1988b12333
|
7
|
+
data.tar.gz: 13a151e1e03d3fc57930c9065c96477f991783c2122949bb71740a10c52732ff3a989d77b2454e13a2ef5adab5ac451e4190af5f377751ac736d191ae43bb34d
|
@@ -12,6 +12,8 @@ class CheckDeploioStatus
|
|
12
12
|
PROJECT = ENV.fetch "DEPLOIO_PROJECT", nil
|
13
13
|
|
14
14
|
def initialize(opts)
|
15
|
+
abort "missing env DEPLOIO_APP_NAME" if APP_NAME.nil?
|
16
|
+
abort "missing env DEPLOIO_PROJECT" if PROJECT.nil?
|
15
17
|
@revision = opts.git_revision || `git rev-parse HEAD`.strip
|
16
18
|
end
|
17
19
|
|
@@ -0,0 +1,166 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class CreateDeploioApp # rubocop:disable Metrics/ClassLength
|
4
|
+
DATABASE_SSH_KEY_FILE = "temporary_database_ssh_key"
|
5
|
+
GITHUB_SSH_KEY_FILE_NAME = "temporary_repository_ssh_key"
|
6
|
+
GITHUB_DEPLOY_KEY_TITLE = "deploio-deploy-key"
|
7
|
+
SSH_ALGORITHM = "Ed25519"
|
8
|
+
|
9
|
+
def run(_args)
|
10
|
+
parse_arguments
|
11
|
+
setup_commands
|
12
|
+
setup_environments
|
13
|
+
ensure
|
14
|
+
cleanup
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
# rubocop:disable Metrics/MethodLength
|
20
|
+
def parse_arguments
|
21
|
+
@project_name = ask("Enter the project name (e.g: my_app): ")
|
22
|
+
validate_project_name!
|
23
|
+
|
24
|
+
@app_name = ask("Enter the app name (e.g: main): ")
|
25
|
+
validate_app_name!
|
26
|
+
|
27
|
+
@git_url = ask("Enter the git URL (e.g: git@github.com:my-org/my-app.git): ")
|
28
|
+
validate_git_url
|
29
|
+
|
30
|
+
@postgres_version = ask("Enter the Postgres version (major version only, e.g., 16): ")
|
31
|
+
validate_postgres_version
|
32
|
+
|
33
|
+
@vault_name = ask("Enter the 1Password vault name (leave empty to skip): ")
|
34
|
+
if @vault_name.empty?
|
35
|
+
say "Skipping 1Password vault setup. Defaulting to Deploio."
|
36
|
+
@vault_name = "Deploio"
|
37
|
+
else
|
38
|
+
validate_vault_name
|
39
|
+
end
|
40
|
+
end
|
41
|
+
# rubocop:enable Metrics/MethodLength
|
42
|
+
|
43
|
+
def ask(prompt)
|
44
|
+
print prompt
|
45
|
+
gets.chomp
|
46
|
+
end
|
47
|
+
|
48
|
+
def setup_commands
|
49
|
+
say "# Commands to setup your Deploio application\n".bold
|
50
|
+
say_project_creation
|
51
|
+
say "\n# Configure repository access\n".bold
|
52
|
+
say_configure_repository_deploy_key
|
53
|
+
end
|
54
|
+
|
55
|
+
def setup_environments
|
56
|
+
ENVIRONMENTS.each do |environment|
|
57
|
+
say "\n# Commands to create #{environment} application \n".bold
|
58
|
+
say_database_creation(environment)
|
59
|
+
say "\n# Commands to create #{environment} database \n".bold
|
60
|
+
say_app_creation(environment)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def cleanup
|
65
|
+
say "rm #{GITHUB_SSH_KEY_FILE_NAME}"
|
66
|
+
end
|
67
|
+
|
68
|
+
def validate_app_name!
|
69
|
+
abort(">> App name must be provided") if @app_name.blank?
|
70
|
+
end
|
71
|
+
|
72
|
+
def validate_project_name!
|
73
|
+
abort(">> Project name must be between 3 and 63 characters.") unless @project_name&.length&.between?(3, 63)
|
74
|
+
end
|
75
|
+
|
76
|
+
def validate_git_url
|
77
|
+
abort(">> Git URL must be provided") unless @git_url
|
78
|
+
http_git_url_regex = URI::DEFAULT_PARSER.make_regexp(%w[http https])
|
79
|
+
ssh_git_url_regex = %r{^(git@[\w.-]+[:|/][\w.-]+/[\w.-]+\.git)$}
|
80
|
+
valid_git_url = @git_url.match?(http_git_url_regex) || @git_url.match?(ssh_git_url_regex)
|
81
|
+
abort(">> Git URL must be valid") unless valid_git_url
|
82
|
+
end
|
83
|
+
|
84
|
+
def validate_postgres_version
|
85
|
+
return if @postgres_version.match?(/^\d+$/)
|
86
|
+
|
87
|
+
abort("The postgres version is invalid. Only major versions are allowed (e.g., use 16 instead of 16.4)")
|
88
|
+
end
|
89
|
+
|
90
|
+
def validate_vault_name
|
91
|
+
return if @vault_name.present?
|
92
|
+
|
93
|
+
abort("The vault name must be provided")
|
94
|
+
end
|
95
|
+
|
96
|
+
def say_project_creation
|
97
|
+
say <<~OUTPUT
|
98
|
+
nctl create project #{@project_name} \\
|
99
|
+
--display-name='#{@app_name}'
|
100
|
+
OUTPUT
|
101
|
+
end
|
102
|
+
|
103
|
+
def say_database_creation(environment)
|
104
|
+
say <<~OUTPUT
|
105
|
+
nctl create postgres #{environment} \\
|
106
|
+
--project=#{@project_name} \\
|
107
|
+
--postgres-version=#{@postgres_version}
|
108
|
+
OUTPUT
|
109
|
+
end
|
110
|
+
|
111
|
+
def say_app_creation(environment)
|
112
|
+
generate_ssh_key(DATABASE_SSH_KEY_FILE)
|
113
|
+
say <<~OUTPUT
|
114
|
+
nctl create app #{environment} \\
|
115
|
+
--project #{@project_name} \\
|
116
|
+
--git-ssh-private-key-from-file=#{GITHUB_SSH_KEY_FILE_NAME} \\
|
117
|
+
--git-url=#{@git_url} \\
|
118
|
+
--git-revision="#{environment}" \\
|
119
|
+
--basic-auth=false \\ # Disabling Deploio basic auth as Rails app handles authentication
|
120
|
+
--build-env=SECRET_KEY_BASE='rails secret' \\ # Don't forget to generate the secret key
|
121
|
+
--language=ruby-heroku
|
122
|
+
OUTPUT
|
123
|
+
end
|
124
|
+
|
125
|
+
def generate_ssh_key(file_name)
|
126
|
+
say <<~OUTPUT
|
127
|
+
ssh-keygen -t #{SSH_ALGORITHM} \\
|
128
|
+
-f #{file_name} \\
|
129
|
+
-N ''
|
130
|
+
OUTPUT
|
131
|
+
|
132
|
+
say <<~OUTPUT
|
133
|
+
op item create \\
|
134
|
+
--title #{file_name} \\
|
135
|
+
--vault #{@vault_name} \\
|
136
|
+
--category ssh-key \\
|
137
|
+
--tags #{@project_name} \\
|
138
|
+
--ssh-public-key < #{file_name}.pub \\
|
139
|
+
--ssh-private-key < #{file_name}
|
140
|
+
OUTPUT
|
141
|
+
end
|
142
|
+
|
143
|
+
def say_configure_repository_deploy_key
|
144
|
+
generate_ssh_key(GITHUB_SSH_KEY_FILE_NAME)
|
145
|
+
say_configure_deploy_key
|
146
|
+
end
|
147
|
+
|
148
|
+
def say_configure_deploy_key
|
149
|
+
unless @git_url&.include?("github")
|
150
|
+
say "# Attention: Deploy key unconfigured because not using GitHub".colorize(:orange)
|
151
|
+
return
|
152
|
+
end
|
153
|
+
|
154
|
+
repo_name = @git_url[%r{github.com/(.*/.*)\.git}, 1]
|
155
|
+
unless repo_name
|
156
|
+
say "# Attention: Deploy key unconfigured because repository URL is not valid".colorize(:orange)
|
157
|
+
return
|
158
|
+
end
|
159
|
+
|
160
|
+
say <<~OUTPUT
|
161
|
+
gh repo deploy-key add #{GITHUB_SSH_KEY_FILE_NAME} \\
|
162
|
+
--repo #{repo_name} \\
|
163
|
+
--title #{GITHUB_DEPLOY_KEY_TITLE}
|
164
|
+
OUTPUT
|
165
|
+
end
|
166
|
+
end
|
data/lib/renuo/cli/version.rb
CHANGED
data/lib/renuo/cli.rb
CHANGED
@@ -16,6 +16,7 @@ require "renuo/cli/app/generate_password"
|
|
16
16
|
require "renuo/cli/app/upgrade_laptop"
|
17
17
|
require "renuo/cli/app/create_aws_project"
|
18
18
|
require "renuo/cli/app/create_heroku_app"
|
19
|
+
require "renuo/cli/app/create_deploio_app"
|
19
20
|
require "renuo/cli/app/configure_sentry"
|
20
21
|
require "renuo/cli/app/create_new_logins"
|
21
22
|
require "renuo/cli/app/release_project"
|
@@ -156,7 +157,7 @@ module Renuo
|
|
156
157
|
end
|
157
158
|
|
158
159
|
command "create-heroku-app" do |c|
|
159
|
-
c.syntax = "renuo create-heroku-app"
|
160
|
+
c.syntax = "renuo create-heroku-app [application-name]"
|
160
161
|
c.summary = "Generates the script necessary to setup an application on Heroku."
|
161
162
|
c.description = "Generates the script necessary to setup an application on Heroku."
|
162
163
|
c.example "renuo create-heroku-app hello", "generates the command to create hello on Heroku"
|
@@ -165,6 +166,26 @@ module Renuo
|
|
165
166
|
end
|
166
167
|
end
|
167
168
|
|
169
|
+
command "create-deploio-app" do |c|
|
170
|
+
c.syntax = "renuo create-deploio-app"
|
171
|
+
c.summary = "Generates the script necessary to setup an application on Deploio."
|
172
|
+
c.description = <<~DESC
|
173
|
+
Generates the script necessary to setup an application on Deploio.
|
174
|
+
This command will:
|
175
|
+
- Prompt for the application name, Git URL, PostgreSQL version, and 1Password vault name.
|
176
|
+
- Validate the provided inputs.
|
177
|
+
- Generate the necessary commands to create a project on Deploio.
|
178
|
+
- Configure repository access by generating SSH keys and adding them to 1Password.
|
179
|
+
- Create the application and database for each specified environment.
|
180
|
+
DESC
|
181
|
+
c.example "renuo create-deploio-app",
|
182
|
+
"Prompts the user for the necessary information and generates the commands " \
|
183
|
+
"to create the project, databases, and apps on Deploio."
|
184
|
+
c.action do |args|
|
185
|
+
CreateDeploioApp.new.run(args)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
168
189
|
command "configure-sentry" do |c|
|
169
190
|
c.syntax = "renuo configure-sentry [project-name] [SENTRY_DSN]"
|
170
191
|
c.summary = "Generates the script necessary to setup sentry on Heroku."
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: renuo-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Renuo AG
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-02-
|
10
|
+
date: 2025-02-21 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: activesupport
|
@@ -93,202 +93,6 @@ dependencies:
|
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '0'
|
96
|
-
- !ruby/object:Gem::Dependency
|
97
|
-
name: aruba
|
98
|
-
requirement: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - "~>"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: 0.14.5
|
103
|
-
type: :development
|
104
|
-
prerelease: false
|
105
|
-
version_requirements: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: 0.14.5
|
110
|
-
- !ruby/object:Gem::Dependency
|
111
|
-
name: bundler
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
113
|
-
requirements:
|
114
|
-
- - "~>"
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: '2.5'
|
117
|
-
type: :development
|
118
|
-
prerelease: false
|
119
|
-
version_requirements: !ruby/object:Gem::Requirement
|
120
|
-
requirements:
|
121
|
-
- - "~>"
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
version: '2.5'
|
124
|
-
- !ruby/object:Gem::Dependency
|
125
|
-
name: byebug
|
126
|
-
requirement: !ruby/object:Gem::Requirement
|
127
|
-
requirements:
|
128
|
-
- - ">="
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
version: '0'
|
131
|
-
type: :development
|
132
|
-
prerelease: false
|
133
|
-
version_requirements: !ruby/object:Gem::Requirement
|
134
|
-
requirements:
|
135
|
-
- - ">="
|
136
|
-
- !ruby/object:Gem::Version
|
137
|
-
version: '0'
|
138
|
-
- !ruby/object:Gem::Dependency
|
139
|
-
name: cucumber
|
140
|
-
requirement: !ruby/object:Gem::Requirement
|
141
|
-
requirements:
|
142
|
-
- - "~>"
|
143
|
-
- !ruby/object:Gem::Version
|
144
|
-
version: '3.1'
|
145
|
-
type: :development
|
146
|
-
prerelease: false
|
147
|
-
version_requirements: !ruby/object:Gem::Requirement
|
148
|
-
requirements:
|
149
|
-
- - "~>"
|
150
|
-
- !ruby/object:Gem::Version
|
151
|
-
version: '3.1'
|
152
|
-
- !ruby/object:Gem::Dependency
|
153
|
-
name: dotenv
|
154
|
-
requirement: !ruby/object:Gem::Requirement
|
155
|
-
requirements:
|
156
|
-
- - "~>"
|
157
|
-
- !ruby/object:Gem::Version
|
158
|
-
version: 2.7.2
|
159
|
-
type: :development
|
160
|
-
prerelease: false
|
161
|
-
version_requirements: !ruby/object:Gem::Requirement
|
162
|
-
requirements:
|
163
|
-
- - "~>"
|
164
|
-
- !ruby/object:Gem::Version
|
165
|
-
version: 2.7.2
|
166
|
-
- !ruby/object:Gem::Dependency
|
167
|
-
name: mdl
|
168
|
-
requirement: !ruby/object:Gem::Requirement
|
169
|
-
requirements:
|
170
|
-
- - "~>"
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
version: '0.13'
|
173
|
-
type: :development
|
174
|
-
prerelease: false
|
175
|
-
version_requirements: !ruby/object:Gem::Requirement
|
176
|
-
requirements:
|
177
|
-
- - "~>"
|
178
|
-
- !ruby/object:Gem::Version
|
179
|
-
version: '0.13'
|
180
|
-
- !ruby/object:Gem::Dependency
|
181
|
-
name: pry
|
182
|
-
requirement: !ruby/object:Gem::Requirement
|
183
|
-
requirements:
|
184
|
-
- - "~>"
|
185
|
-
- !ruby/object:Gem::Version
|
186
|
-
version: '0.14'
|
187
|
-
type: :development
|
188
|
-
prerelease: false
|
189
|
-
version_requirements: !ruby/object:Gem::Requirement
|
190
|
-
requirements:
|
191
|
-
- - "~>"
|
192
|
-
- !ruby/object:Gem::Version
|
193
|
-
version: '0.14'
|
194
|
-
- !ruby/object:Gem::Dependency
|
195
|
-
name: rake
|
196
|
-
requirement: !ruby/object:Gem::Requirement
|
197
|
-
requirements:
|
198
|
-
- - "~>"
|
199
|
-
- !ruby/object:Gem::Version
|
200
|
-
version: '13.0'
|
201
|
-
type: :development
|
202
|
-
prerelease: false
|
203
|
-
version_requirements: !ruby/object:Gem::Requirement
|
204
|
-
requirements:
|
205
|
-
- - "~>"
|
206
|
-
- !ruby/object:Gem::Version
|
207
|
-
version: '13.0'
|
208
|
-
- !ruby/object:Gem::Dependency
|
209
|
-
name: renuocop
|
210
|
-
requirement: !ruby/object:Gem::Requirement
|
211
|
-
requirements:
|
212
|
-
- - ">="
|
213
|
-
- !ruby/object:Gem::Version
|
214
|
-
version: '0'
|
215
|
-
type: :development
|
216
|
-
prerelease: false
|
217
|
-
version_requirements: !ruby/object:Gem::Requirement
|
218
|
-
requirements:
|
219
|
-
- - ">="
|
220
|
-
- !ruby/object:Gem::Version
|
221
|
-
version: '0'
|
222
|
-
- !ruby/object:Gem::Dependency
|
223
|
-
name: rspec
|
224
|
-
requirement: !ruby/object:Gem::Requirement
|
225
|
-
requirements:
|
226
|
-
- - "~>"
|
227
|
-
- !ruby/object:Gem::Version
|
228
|
-
version: '3.5'
|
229
|
-
type: :development
|
230
|
-
prerelease: false
|
231
|
-
version_requirements: !ruby/object:Gem::Requirement
|
232
|
-
requirements:
|
233
|
-
- - "~>"
|
234
|
-
- !ruby/object:Gem::Version
|
235
|
-
version: '3.5'
|
236
|
-
- !ruby/object:Gem::Dependency
|
237
|
-
name: simplecov
|
238
|
-
requirement: !ruby/object:Gem::Requirement
|
239
|
-
requirements:
|
240
|
-
- - ">="
|
241
|
-
- !ruby/object:Gem::Version
|
242
|
-
version: '0'
|
243
|
-
type: :development
|
244
|
-
prerelease: false
|
245
|
-
version_requirements: !ruby/object:Gem::Requirement
|
246
|
-
requirements:
|
247
|
-
- - ">="
|
248
|
-
- !ruby/object:Gem::Version
|
249
|
-
version: '0'
|
250
|
-
- !ruby/object:Gem::Dependency
|
251
|
-
name: simplecov-console
|
252
|
-
requirement: !ruby/object:Gem::Requirement
|
253
|
-
requirements:
|
254
|
-
- - ">="
|
255
|
-
- !ruby/object:Gem::Version
|
256
|
-
version: '0'
|
257
|
-
type: :development
|
258
|
-
prerelease: false
|
259
|
-
version_requirements: !ruby/object:Gem::Requirement
|
260
|
-
requirements:
|
261
|
-
- - ">="
|
262
|
-
- !ruby/object:Gem::Version
|
263
|
-
version: '0'
|
264
|
-
- !ruby/object:Gem::Dependency
|
265
|
-
name: vcr
|
266
|
-
requirement: !ruby/object:Gem::Requirement
|
267
|
-
requirements:
|
268
|
-
- - "~>"
|
269
|
-
- !ruby/object:Gem::Version
|
270
|
-
version: '6.2'
|
271
|
-
type: :development
|
272
|
-
prerelease: false
|
273
|
-
version_requirements: !ruby/object:Gem::Requirement
|
274
|
-
requirements:
|
275
|
-
- - "~>"
|
276
|
-
- !ruby/object:Gem::Version
|
277
|
-
version: '6.2'
|
278
|
-
- !ruby/object:Gem::Dependency
|
279
|
-
name: webmock
|
280
|
-
requirement: !ruby/object:Gem::Requirement
|
281
|
-
requirements:
|
282
|
-
- - "~>"
|
283
|
-
- !ruby/object:Gem::Version
|
284
|
-
version: '3.23'
|
285
|
-
type: :development
|
286
|
-
prerelease: false
|
287
|
-
version_requirements: !ruby/object:Gem::Requirement
|
288
|
-
requirements:
|
289
|
-
- - "~>"
|
290
|
-
- !ruby/object:Gem::Version
|
291
|
-
version: '3.23'
|
292
96
|
description: The Renuo CLI automates some commonly used workflows by providing a command
|
293
97
|
line interface.
|
294
98
|
email:
|
@@ -298,26 +102,9 @@ executables:
|
|
298
102
|
extensions: []
|
299
103
|
extra_rdoc_files: []
|
300
104
|
files:
|
301
|
-
- ".editorconfig"
|
302
|
-
- ".gitignore"
|
303
|
-
- ".mdlrc"
|
304
|
-
- ".rspec"
|
305
|
-
- ".rubocop.yml"
|
306
|
-
- ".ruby-version"
|
307
|
-
- ".semaphore/bin/cache_restore"
|
308
|
-
- ".semaphore/bin/cache_store"
|
309
|
-
- ".semaphore/main-deploy.yml"
|
310
|
-
- ".semaphore/semaphore.yml"
|
311
|
-
- Gemfile
|
312
105
|
- LICENSE.txt
|
313
106
|
- README.md
|
314
|
-
- Rakefile
|
315
|
-
- bin/check
|
316
|
-
- bin/console
|
317
107
|
- bin/renuo
|
318
|
-
- bin/run
|
319
|
-
- bin/setup
|
320
|
-
- config/1password-secrets.yml
|
321
108
|
- lib/renuo/cli.rb
|
322
109
|
- lib/renuo/cli/app/check_deploio_status.rb
|
323
110
|
- lib/renuo/cli/app/command_helper.rb
|
@@ -326,6 +113,7 @@ files:
|
|
326
113
|
- lib/renuo/cli/app/configure_semaphore.rb
|
327
114
|
- lib/renuo/cli/app/configure_sentry.rb
|
328
115
|
- lib/renuo/cli/app/create_aws_project.rb
|
116
|
+
- lib/renuo/cli/app/create_deploio_app.rb
|
329
117
|
- lib/renuo/cli/app/create_heroku_app.rb
|
330
118
|
- lib/renuo/cli/app/create_new_logins.rb
|
331
119
|
- lib/renuo/cli/app/create_slidev_presentation.rb
|
@@ -359,10 +147,6 @@ files:
|
|
359
147
|
- lib/renuo/cli/app/upgrade_laptop/upgrade_laptop_execution.rb
|
360
148
|
- lib/renuo/cli/app/upgrade_laptop/upgrade_mac_os.rb
|
361
149
|
- lib/renuo/cli/version.rb
|
362
|
-
- notification.yml
|
363
|
-
- renuo-cli.gemspec
|
364
|
-
- vcr_cassettes/successful_uptimerobot_calls.yml
|
365
|
-
- vcr_cassettes/unsuccessful_uptimerobot_calls.yml
|
366
150
|
homepage: https://github.com/renuo/renuo-cli
|
367
151
|
licenses:
|
368
152
|
- MIT
|
@@ -375,7 +159,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
375
159
|
requirements:
|
376
160
|
- - ">="
|
377
161
|
- !ruby/object:Gem::Version
|
378
|
-
version: 3.
|
162
|
+
version: 3.2.0
|
379
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
380
164
|
requirements:
|
381
165
|
- - ">="
|
data/.editorconfig
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# EditorConfig helps developers define and maintain consistent
|
2
|
-
# coding styles between different editors and IDEs
|
3
|
-
# editorconfig.org
|
4
|
-
|
5
|
-
root = true
|
6
|
-
|
7
|
-
[*]
|
8
|
-
|
9
|
-
# Change these settings to your own preference
|
10
|
-
indent_style = space
|
11
|
-
indent_size = 2
|
12
|
-
|
13
|
-
# We recommend you to keep these unchanged
|
14
|
-
end_of_line = lf
|
15
|
-
charset = utf-8
|
16
|
-
trim_trailing_whitespace = true
|
17
|
-
insert_final_newline = true
|
18
|
-
|
19
|
-
[*.md]
|
20
|
-
trim_trailing_whitespace = false
|
21
|
-
|
data/.gitignore
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
### JetBrains template
|
2
|
-
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
|
3
|
-
|
4
|
-
*.iml
|
5
|
-
|
6
|
-
## Directory-based project format:
|
7
|
-
.idea/
|
8
|
-
# if you remove the above rule, at least ignore the following:
|
9
|
-
|
10
|
-
# User-specific stuff:
|
11
|
-
# .idea/workspace.xml
|
12
|
-
# .idea/tasks.xml
|
13
|
-
# .idea/dictionaries
|
14
|
-
|
15
|
-
# Sensitive or high-churn files:
|
16
|
-
# .idea/dataSources.ids
|
17
|
-
# .idea/dataSources.xml
|
18
|
-
# .idea/sqlDataSources.xml
|
19
|
-
# .idea/dynamic.xml
|
20
|
-
# .idea/uiDesigner.xml
|
21
|
-
|
22
|
-
# Gradle:
|
23
|
-
# .idea/gradle.xml
|
24
|
-
# .idea/libraries
|
25
|
-
|
26
|
-
# Mongo Explorer plugin:
|
27
|
-
# .idea/mongoSettings.xml
|
28
|
-
|
29
|
-
## File-based project format:
|
30
|
-
*.ipr
|
31
|
-
*.iws
|
32
|
-
|
33
|
-
## Plugin-specific files:
|
34
|
-
|
35
|
-
# IntelliJ
|
36
|
-
/out/
|
37
|
-
|
38
|
-
# mpeltonen/sbt-idea plugin
|
39
|
-
.idea_modules/
|
40
|
-
|
41
|
-
# JIRA plugin
|
42
|
-
atlassian-ide-plugin.xml
|
43
|
-
|
44
|
-
# Crashlytics plugin (for Android Studio and IntelliJ)
|
45
|
-
com_crashlytics_export_strings.xml
|
46
|
-
crashlytics.properties
|
47
|
-
crashlytics-build.properties
|
48
|
-
### Vim template
|
49
|
-
[._]*.s[a-w][a-z]
|
50
|
-
[._]s[a-w][a-z]
|
51
|
-
*.un~
|
52
|
-
Session.vim
|
53
|
-
.netrwhist
|
54
|
-
*~
|
55
|
-
### Ruby template
|
56
|
-
*.gem
|
57
|
-
*.rbc
|
58
|
-
/.config
|
59
|
-
/coverage/
|
60
|
-
/InstalledFiles
|
61
|
-
/pkg/
|
62
|
-
/spec/reports/
|
63
|
-
/spec/examples.txt
|
64
|
-
/test/tmp/
|
65
|
-
/test/version_tmp/
|
66
|
-
/tmp/
|
67
|
-
|
68
|
-
## Specific to RubyMotion:
|
69
|
-
.dat*
|
70
|
-
.repl_history
|
71
|
-
build/
|
72
|
-
|
73
|
-
## Documentation cache and generated files:
|
74
|
-
/.yardoc/
|
75
|
-
/_yardoc/
|
76
|
-
/doc/
|
77
|
-
/rdoc/
|
78
|
-
|
79
|
-
## Environment normalisation:
|
80
|
-
/.bundle/
|
81
|
-
/vendor/bundle
|
82
|
-
/lib/bundler/man/
|
83
|
-
|
84
|
-
# for a library or gem, you might want to ignore these files since the code is
|
85
|
-
# intended to run in multiple environments; otherwise, check them in:
|
86
|
-
# Gemfile.lock
|
87
|
-
# .ruby-version
|
88
|
-
# .ruby-gemset
|
89
|
-
|
90
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
91
|
-
.rvmrc
|
92
|
-
|
93
|
-
# Created by .ignore support plugin (hsz.mobi)
|
94
|
-
.local_storage
|
95
|
-
/.bundle/
|
96
|
-
/.yardoc
|
97
|
-
/Gemfile.lock
|
98
|
-
/_yardoc/
|
99
|
-
/coverage/
|
100
|
-
/doc/
|
101
|
-
/pkg/
|
102
|
-
/spec/reports/
|
103
|
-
/tmp/
|
104
|
-
/certificates/
|
105
|
-
/config/application.yml
|
106
|
-
.env
|
data/.mdlrc
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
3.4.1
|
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
|
3
|
-
for cache_group in "$@"
|
4
|
-
do
|
5
|
-
case $cache_group in
|
6
|
-
|
7
|
-
ruby)
|
8
|
-
cache restore gems-$SEMAPHORE_GIT_BRANCH-$(checksum Gemfile.lock),gems-$SEMAPHORE_GIT_BRANCH,gems-develop,gems-master
|
9
|
-
;;
|
10
|
-
|
11
|
-
*)
|
12
|
-
echo "Invalid argument: Cache group $cache_group not found."
|
13
|
-
exit 1
|
14
|
-
;;
|
15
|
-
esac
|
16
|
-
done
|
data/.semaphore/bin/cache_store
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
|
3
|
-
for cache_group in "$@"
|
4
|
-
do
|
5
|
-
case $cache_group in
|
6
|
-
|
7
|
-
ruby)
|
8
|
-
cache store gems-$SEMAPHORE_GIT_BRANCH-$(checksum Gemfile.lock) vendor/bundle
|
9
|
-
;;
|
10
|
-
|
11
|
-
*)
|
12
|
-
echo "Invalid argument: Cache group $cache_group not found."
|
13
|
-
exit 1
|
14
|
-
;;
|
15
|
-
esac
|
16
|
-
done
|
data/.semaphore/main-deploy.yml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
version: v1.0
|
2
|
-
name: main-deploy
|
3
|
-
agent:
|
4
|
-
machine:
|
5
|
-
type: e2-standard-2
|
6
|
-
os_image: ubuntu2204
|
7
|
-
|
8
|
-
blocks:
|
9
|
-
- name: main-deploy
|
10
|
-
task:
|
11
|
-
secrets:
|
12
|
-
- name: rubygems-deploy
|
13
|
-
jobs:
|
14
|
-
- name: main-deploy
|
15
|
-
commands:
|
16
|
-
- checkout --use-cache
|
17
|
-
- gem build renuo-cli
|
18
|
-
- gem push renuo-cli-*.gem
|
data/.semaphore/semaphore.yml
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
version: "v1.0"
|
2
|
-
name: renuo-cli
|
3
|
-
|
4
|
-
agent:
|
5
|
-
machine:
|
6
|
-
type: e2-standard-2
|
7
|
-
os_image: ubuntu2204
|
8
|
-
|
9
|
-
auto_cancel:
|
10
|
-
running:
|
11
|
-
when: "true"
|
12
|
-
|
13
|
-
fail_fast:
|
14
|
-
cancel:
|
15
|
-
when: "branch != 'main'"
|
16
|
-
|
17
|
-
blocks:
|
18
|
-
- name: tests
|
19
|
-
execution_time_limit:
|
20
|
-
minutes: 5
|
21
|
-
dependencies: []
|
22
|
-
task:
|
23
|
-
secrets:
|
24
|
-
- name: renuo-cli
|
25
|
-
prologue:
|
26
|
-
commands:
|
27
|
-
- checkout --use-cache
|
28
|
-
- source .semaphore/bin/cache_restore ruby
|
29
|
-
- bundle install -j 4 --path vendor/bundle
|
30
|
-
- source .semaphore/bin/cache_store ruby
|
31
|
-
jobs:
|
32
|
-
- name: tests
|
33
|
-
commands:
|
34
|
-
- ENV=CI bin/check
|
35
|
-
promotions:
|
36
|
-
- name: main
|
37
|
-
pipeline_file: main-deploy.yml
|
data/Gemfile
DELETED
data/Rakefile
DELETED
data/bin/check
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
|
3
|
-
if ! bundle exec rubocop -D -c .rubocop.yml
|
4
|
-
then
|
5
|
-
echo 'rubocop detected issues!'
|
6
|
-
exit 1
|
7
|
-
fi
|
8
|
-
|
9
|
-
if ! bundle exec mdl .
|
10
|
-
then
|
11
|
-
echo 'Violated markdown rules, see https://github.com/mivok/markdownlint/blob/master/docs/RULES.md, commit aborted'
|
12
|
-
exit 1
|
13
|
-
fi
|
14
|
-
|
15
|
-
if ! bundle exec rspec
|
16
|
-
then
|
17
|
-
echo 'rspec errors'
|
18
|
-
exit 1
|
19
|
-
fi
|
20
|
-
|
21
|
-
if ! bundle exec cucumber
|
22
|
-
then
|
23
|
-
echo 'cucumber errors'
|
24
|
-
exit 1
|
25
|
-
fi
|
26
|
-
|
data/bin/console
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'bundler/setup'
|
4
|
-
require 'renuo/cli'
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
require 'pry'
|
10
|
-
Pry.start
|
11
|
-
|
data/bin/run
DELETED
data/bin/setup
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
items:
|
2
|
-
- default_folder: "./certificates/"
|
3
|
-
private_link: "https://start.1password.com/open/i?a=QZNJJCCDWVCGBGI73Z2L55KSGE&v=c4grjzxqhcipunrlflodw7ml7i&i=2v6oqm72wdp7divjqsy6grcjzi&h=renuo.1password.com"
|
4
|
-
files:
|
5
|
-
- name: "file1.txt"
|
6
|
-
- name: "file2.csv"
|
7
|
-
- name: "file3.md"
|
8
|
-
env_variables:
|
9
|
-
- name: "ENV_VAR1"
|
10
|
-
- name: "ENV_VAR2"
|
11
|
-
- name: "ENV_VAR3"
|
data/notification.yml
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
apiVersion: v1alpha
|
2
|
-
kind: Notification
|
3
|
-
metadata:
|
4
|
-
name: <%= project_name %>
|
5
|
-
spec:
|
6
|
-
rules:
|
7
|
-
- name: deployment notifications
|
8
|
-
filter:
|
9
|
-
projects: [<%= project_name %>]
|
10
|
-
branches: [main, develop]
|
11
|
-
pipelines: [/.*-deploy.yml/]
|
12
|
-
notify:
|
13
|
-
slack:
|
14
|
-
endpoint: <%= slack_url %>
|
15
|
-
channels: ["#project-<%= project_name %>"]
|
16
|
-
- name: build notifications
|
17
|
-
filter:
|
18
|
-
projects: [<%= project_name %>]
|
19
|
-
branches: [main, develop]
|
20
|
-
pipelines: [semaphore.yml]
|
21
|
-
results: [failed]
|
22
|
-
notify:
|
23
|
-
slack:
|
24
|
-
endpoint: <%= slack_url %>
|
25
|
-
channels: ["#project-<%= project_name %>"]
|
data/renuo-cli.gemspec
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
lib = File.expand_path("lib", __dir__)
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require "renuo/cli/version"
|
6
|
-
|
7
|
-
# rubocop:disable Metrics/BlockLength
|
8
|
-
Gem::Specification.new do |spec|
|
9
|
-
spec.name = Renuo::Cli::NAME
|
10
|
-
spec.version = Renuo::Cli::VERSION
|
11
|
-
spec.authors = ["Renuo AG"]
|
12
|
-
spec.email = ["info@renuo.ch"]
|
13
|
-
|
14
|
-
spec.summary = "The Renuo CLI automates some common workflows."
|
15
|
-
spec.description = "The Renuo CLI automates some commonly used workflows by providing a command line interface."
|
16
|
-
spec.homepage = "https://github.com/renuo/renuo-cli"
|
17
|
-
spec.license = "MIT"
|
18
|
-
|
19
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
-
spec.executables << "renuo"
|
21
|
-
spec.require_paths = ["lib"]
|
22
|
-
spec.metadata["rubygems_mfa_required"] = "true"
|
23
|
-
|
24
|
-
spec.required_ruby_version = ">= 3.1.0"
|
25
|
-
|
26
|
-
spec.add_dependency "activesupport", "~> 8.0.0"
|
27
|
-
spec.add_dependency "colorize", "~> 0"
|
28
|
-
spec.add_dependency "commander", "~> 5.0"
|
29
|
-
spec.add_dependency "gems", "~> 1.1"
|
30
|
-
spec.add_dependency "redcarpet", "~> 3.0"
|
31
|
-
spec.add_dependency "terminal-table"
|
32
|
-
|
33
|
-
spec.add_development_dependency "aruba", "~> 0.14.5"
|
34
|
-
spec.add_development_dependency "bundler", "~> 2.5"
|
35
|
-
spec.add_development_dependency "byebug"
|
36
|
-
spec.add_development_dependency "cucumber", "~> 3.1"
|
37
|
-
spec.add_development_dependency "dotenv", "~> 2.7.2"
|
38
|
-
spec.add_development_dependency "mdl", "~> 0.13"
|
39
|
-
spec.add_development_dependency "pry", "~> 0.14"
|
40
|
-
spec.add_development_dependency "rake", "~> 13.0"
|
41
|
-
spec.add_development_dependency "renuocop"
|
42
|
-
spec.add_development_dependency "rspec", "~> 3.5"
|
43
|
-
spec.add_development_dependency "simplecov"
|
44
|
-
spec.add_development_dependency "simplecov-console"
|
45
|
-
spec.add_development_dependency "vcr", "~> 6.2"
|
46
|
-
spec.add_development_dependency "webmock", "~> 3.23"
|
47
|
-
end
|
48
|
-
# rubocop:enable Metrics/BlockLength
|
@@ -1,93 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: https://api.uptimerobot.com/v2/newMonitor
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: friendly_name=test.ch&url=https%3A%2F%2Ftest.ch&type=1&interval=300&alert_contacts=0716852_0_0-2806074_0_0&api_key=<API-KEY>
|
9
|
-
headers:
|
10
|
-
Accept-Encoding:
|
11
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
-
Accept:
|
13
|
-
- "*/*"
|
14
|
-
User-Agent:
|
15
|
-
- Ruby
|
16
|
-
Host:
|
17
|
-
- api.uptimerobot.com
|
18
|
-
response:
|
19
|
-
status:
|
20
|
-
code: 200
|
21
|
-
message: OK
|
22
|
-
headers:
|
23
|
-
Date:
|
24
|
-
- Fri, 05 Apr 2019 15:04:18 GMT
|
25
|
-
Content-Type:
|
26
|
-
- application/json; charset=utf-8
|
27
|
-
Transfer-Encoding:
|
28
|
-
- chunked
|
29
|
-
Connection:
|
30
|
-
- keep-alive
|
31
|
-
Access-Control-Allow-Origin:
|
32
|
-
- "*"
|
33
|
-
Etag:
|
34
|
-
- W/"33-+Q4/l04ZnLs/j/WZc5awQaqxWko"
|
35
|
-
Vary:
|
36
|
-
- Accept-Encoding
|
37
|
-
Expect-Ct:
|
38
|
-
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
|
39
|
-
Server:
|
40
|
-
- cloudflare
|
41
|
-
Cf-Ray:
|
42
|
-
- 4c2c69e72e76cc60-ZRH
|
43
|
-
body:
|
44
|
-
encoding: ASCII-8BIT
|
45
|
-
string: '{"stat":"ok","monitor":{"id":782356891,"status":1}}'
|
46
|
-
http_version:
|
47
|
-
recorded_at: Fri, 05 Apr 2019 15:04:18 GMT
|
48
|
-
- request:
|
49
|
-
method: post
|
50
|
-
uri: https://api.uptimerobot.com/v2/editMonitor
|
51
|
-
body:
|
52
|
-
encoding: US-ASCII
|
53
|
-
string: id=782356891&status=0&api_key=<API-KEY>
|
54
|
-
headers:
|
55
|
-
Accept-Encoding:
|
56
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
57
|
-
Accept:
|
58
|
-
- "*/*"
|
59
|
-
User-Agent:
|
60
|
-
- Ruby
|
61
|
-
Host:
|
62
|
-
- api.uptimerobot.com
|
63
|
-
response:
|
64
|
-
status:
|
65
|
-
code: 200
|
66
|
-
message: OK
|
67
|
-
headers:
|
68
|
-
Date:
|
69
|
-
- Fri, 05 Apr 2019 15:04:18 GMT
|
70
|
-
Content-Type:
|
71
|
-
- application/json; charset=utf-8
|
72
|
-
Content-Length:
|
73
|
-
- '40'
|
74
|
-
Connection:
|
75
|
-
- keep-alive
|
76
|
-
Access-Control-Allow-Origin:
|
77
|
-
- "*"
|
78
|
-
Etag:
|
79
|
-
- W/"28-IX6S7KrVjMYO09zUzWnglIFSrbs"
|
80
|
-
Vary:
|
81
|
-
- Accept-Encoding
|
82
|
-
Expect-Ct:
|
83
|
-
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
|
84
|
-
Server:
|
85
|
-
- cloudflare
|
86
|
-
Cf-Ray:
|
87
|
-
- 4c2c69e8be39cc3c-ZRH
|
88
|
-
body:
|
89
|
-
encoding: UTF-8
|
90
|
-
string: '{"stat":"ok","monitor":{"id":782356891}}'
|
91
|
-
http_version:
|
92
|
-
recorded_at: Fri, 05 Apr 2019 15:04:18 GMT
|
93
|
-
recorded_with: VCR 4.0.0
|
@@ -1,48 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: https://api.uptimerobot.com/v2/newMonitor
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: friendly_name=test.ch&url=https%3A%2F%2Ftest.ch&type=1&interval=300&alert_contacts=0716852_0_0-2806074_0_0&api_key=<API-KEY>
|
9
|
-
headers:
|
10
|
-
Accept-Encoding:
|
11
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
-
Accept:
|
13
|
-
- "*/*"
|
14
|
-
User-Agent:
|
15
|
-
- Ruby
|
16
|
-
Host:
|
17
|
-
- api.uptimerobot.com
|
18
|
-
response:
|
19
|
-
status:
|
20
|
-
code: 200
|
21
|
-
message: OK
|
22
|
-
headers:
|
23
|
-
Date:
|
24
|
-
- Fri, 05 Apr 2019 15:04:18 GMT
|
25
|
-
Content-Type:
|
26
|
-
- application/json; charset=utf-8
|
27
|
-
Transfer-Encoding:
|
28
|
-
- chunked
|
29
|
-
Connection:
|
30
|
-
- keep-alive
|
31
|
-
Access-Control-Allow-Origin:
|
32
|
-
- "*"
|
33
|
-
Etag:
|
34
|
-
- W/"55-MrMKN/ToW+ARHfUbinDrKAYK9Jc"
|
35
|
-
Vary:
|
36
|
-
- Accept-Encoding
|
37
|
-
Expect-Ct:
|
38
|
-
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
|
39
|
-
Server:
|
40
|
-
- cloudflare
|
41
|
-
Cf-Ray:
|
42
|
-
- 4c2c69ea6f943e5c-ZRH
|
43
|
-
body:
|
44
|
-
encoding: ASCII-8BIT
|
45
|
-
string: '{"stat":"fail","error":{"type":"already_exists","message":"monitor already exists."}}'
|
46
|
-
http_version:
|
47
|
-
recorded_at: Fri, 05 Apr 2019 15:04:18 GMT
|
48
|
-
recorded_with: VCR 4.0.0
|