renuo-cli 1.4.4 → 1.5.0

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: 7a14a5db957080089a5f4f809b39fe01ec7e881d9e0b5066d0d2feb6051cb345
4
- data.tar.gz: daa82da64aea95acf2efa4ad216652f97ff0822d1b1efb426c0e464b60be7a8d
3
+ metadata.gz: 29de8d5a59af51defd1df2ea0829d7839e9e9780e7ad7903eb5f3ab8ad3a0d7b
4
+ data.tar.gz: eefb399aa3b6950a841392253d1e002586962358ed3a812c4ec3fee435f3bd1b
5
5
  SHA512:
6
- metadata.gz: 7ff506e5db3ec04bd1a207af08ee9bd1a83d20a038391fb19dca2dfe2624b1973537d18223e31ae403c73d87d13034a6e437ba3d9de402d7f6e1c4e2af6c6046
7
- data.tar.gz: 89aa94ad40d176b73293fd475416b6aa1a745ceb62f814f1a36612eb5e47052f6be85d68bc6cfa7491e7c696974e6f0b13640786ceb62e4af3c66712e62d8153
6
+ metadata.gz: 20aa5b70c11e26303aa7ac1832fe788bd2258b22cb1d516dbfdddaa3db36e67bce5bc40b339f86b9e6661c06e8f9aa0ea03614bbe4049713b9153ceedf0160fd
7
+ data.tar.gz: 425889e37eeac52cfafed38422862827c95fea9d482e4d674187a2aab5dc05adaba242d23fcc28fb8d9a97516bb50783a0e22546b4074418609fa81ca1d66c93
@@ -0,0 +1,26 @@
1
+ require 'commander'
2
+ require_relative './environments'
3
+
4
+ class ConfigureSentry
5
+ ADMIN_EMAIL = 'admin@renuo.ch'.freeze
6
+
7
+ def initialize; end
8
+
9
+ def run(args)
10
+ project_name = args[0]
11
+ sentry_dsn = args[1]
12
+ abort('>> No project name given.') unless project_name
13
+ abort('>> No sentry DSN name given.') unless sentry_dsn
14
+
15
+ say "# Commands to setup Sentry on Heroku\n".colorize :green
16
+ ENVIRONMENTS.each { |env| print_environment_commands(env, project_name, sentry_dsn) }
17
+ end
18
+
19
+ private
20
+
21
+ def print_environment_commands(env, project_name, sentry_dsn)
22
+ heroku_name = "#{project_name}-#{env}"
23
+ say "heroku config:set SENTRY_DSN=#{sentry_dsn} --app #{heroku_name}"
24
+ say "heroku config:set SENTRY_ENVIRONMENT=#{env} --app #{heroku_name}"
25
+ end
26
+ end
@@ -1,11 +1,8 @@
1
1
  require 'commander'
2
- require_relative './fetch_emails.rb'
2
+ require_relative './environments'
3
+ require_relative './fetch_emails'
3
4
 
4
5
  class CreateHerokuApp
5
- MASTER = 'master'.freeze
6
- DEVELOP = 'develop'.freeze
7
- TESTING = 'testing'.freeze
8
- ENVIRONMENTS = [MASTER, DEVELOP, TESTING].freeze
9
6
  ADMIN_EMAIL = 'admin@renuo.ch'.freeze
10
7
 
11
8
  def initialize; end
@@ -0,0 +1,4 @@
1
+ MASTER = 'master'.freeze
2
+ DEVELOP = 'develop'.freeze
3
+ TESTING = 'testing'.freeze
4
+ ENVIRONMENTS = [MASTER, DEVELOP, TESTING].freeze
@@ -0,0 +1,33 @@
1
+ class ReleaseXing
2
+ TMP_FOLDER_NAME = ('_RENUO_RELEASE_TEMP_' + rand(100_000_000).to_s).freeze
3
+ MOVE_TO_TMP_FOLDER = "mkdir -p #{TMP_FOLDER_NAME} && cd #{TMP_FOLDER_NAME}".freeze
4
+
5
+ def run
6
+ checkout_project
7
+ cmd_in_folder 'git remote add -f renuo git@github.com:renuo/xing-campaign.git'
8
+ cmd_in_folder 'git pull'
9
+ cmd_in_folder 'git fetch renuo develop'
10
+ cmd_in_folder 'git subtree pull --prefix public renuo develop --squash'
11
+ cmd_in_folder 'git push'
12
+ ensure
13
+ cleanup
14
+ end
15
+
16
+ private
17
+
18
+ def checkout_project
19
+ system "#{MOVE_TO_TMP_FOLDER} && git clone git@gitlab.dc.xing.com:renuo-ag/wunsch-arbeitgeber.xing.com.git"
20
+ end
21
+
22
+ def cmd_in_folder(command)
23
+ system "#{move_and_cd} && #{command}"
24
+ end
25
+
26
+ def move_and_cd
27
+ "#{MOVE_TO_TMP_FOLDER} && cd wunsch-arbeitgeber.xing.com"
28
+ end
29
+
30
+ def cleanup
31
+ system("rm -rf #{TMP_FOLDER_NAME}")
32
+ end
33
+ end
@@ -1,6 +1,6 @@
1
1
  module Renuo
2
2
  module Cli
3
- VERSION = '1.4.4'.freeze
3
+ VERSION = '1.5.0'.freeze
4
4
  NAME = 'renuo-cli'.freeze
5
5
  end
6
6
  end
data/lib/renuo/cli.rb CHANGED
@@ -9,11 +9,13 @@ require 'renuo/cli/app/generate_password'
9
9
  require 'renuo/cli/app/upgrade_laptop.rb'
10
10
  require 'renuo/cli/app/create_aws_project'
11
11
  require 'renuo/cli/app/create_heroku_app'
12
+ require 'renuo/cli/app/configure_sentry'
12
13
  require 'renuo/cli/app/create_new_logins'
13
14
  require 'renuo/cli/app/release_project.rb'
14
15
  require 'renuo/cli/app/fetch_emails.rb'
15
16
  require 'renuo/cli/app/heroku_users.rb'
16
17
  require 'renuo/cli/app/setup_uptimerobot'
18
+ require 'renuo/cli/app/release_xing'
17
19
 
18
20
  module Renuo
19
21
  class CLI
@@ -133,7 +135,7 @@ module Renuo
133
135
  'Patch or Custom release based on the current state of develop on Github'
134
136
  c.example 'renuo release my-project minor', 'release a minor release of my-project'
135
137
  c.example 'renuo release my-project custom 2.5.0', 'release my-project as release 2.5.0'
136
- c.action do|args|
138
+ c.action do |args|
137
139
  ReleaseProject.new.run(args)
138
140
  end
139
141
  end
@@ -143,16 +145,26 @@ module Renuo
143
145
  c.summary = 'Generates the script necessary to setup an application on Heroku.'
144
146
  c.description = 'Generates the script necessary to setup an application on Heroku.'
145
147
  c.example 'renuo create-heroku-app hello', 'generates the command to create hello on Heroku'
146
- c.action do|args|
148
+ c.action do |args|
147
149
  CreateHerokuApp.new.run(args)
148
150
  end
149
151
  end
150
152
 
153
+ command 'configure-sentry' do |c|
154
+ c.syntax = 'renuo configure-sentry [project-name] [SENTRY_DSN]'
155
+ c.summary = 'Generates the script necessary to setup sentry on Heroku.'
156
+ c.description = c.summary
157
+ c.example 'renuo configure-sentry myproject https://randomkey@sentry.io/11223344', 'generates the command to configure sentry for myproject on Heroku'
158
+ c.action do|args|
159
+ ConfigureSentry.new.run(args)
160
+ end
161
+ end
162
+
151
163
  command 'fetch-emails' do |c|
152
164
  c.syntax = 'renuo fetch-emails'
153
165
  c.summary = 'Retrieves all renuo employees email addresses'
154
166
  c.description = 'Retrieves all renuo employees email addresses. One per line.'
155
- c.action do|args|
167
+ c.action do |args|
156
168
  FetchEmails.new.run(args)
157
169
  end
158
170
  end
@@ -165,7 +177,7 @@ module Renuo
165
177
  'Adds the user alessandro.rodi@renuo.ch to all the Heroku projects'
166
178
  c.example 'renuo heroku-users remove alessandro.rodi@renuo.ch',
167
179
  'Removes the user alessandro.rodi@renuo.ch from all the Heroku projects'
168
- c.action do|args|
180
+ c.action do |args|
169
181
  HerokuUsers.new.run(args)
170
182
  end
171
183
  end
@@ -177,10 +189,20 @@ module Renuo
177
189
  "This command sets everything up and pauses the monitoring directly. Once the app is ready,"\
178
190
  " the monitoring should get started."
179
191
  c.example 'renuo setup-uptimerobot https://redmine.ch', 'Configures redmine monitoring on uptimerobot'
180
- c.action do|args|
192
+ c.action do |args|
181
193
  SetupUptimerobot.new(args).run
182
194
  end
183
195
  end
196
+
197
+ command 'release-xing' do |c|
198
+ c.syntax = 'renuo release-xing'
199
+ c.summary = 'Release Xing to preview.'
200
+ c.description = "Xing needs to be released manually. "\
201
+ "You need a VPN connection open before runnign this command."
202
+ c.action do |args|
203
+ ReleaseXing.new.run
204
+ end
205
+ end
184
206
  end
185
207
  end
186
208
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renuo-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renuo AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-30 00:00:00.000000000 Z
11
+ date: 2019-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -276,9 +276,11 @@ files:
276
276
  - bin/run
277
277
  - bin/setup
278
278
  - lib/renuo/cli.rb
279
+ - lib/renuo/cli/app/configure_sentry.rb
279
280
  - lib/renuo/cli/app/create_aws_project.rb
280
281
  - lib/renuo/cli/app/create_heroku_app.rb
281
282
  - lib/renuo/cli/app/create_new_logins.rb
283
+ - lib/renuo/cli/app/environments.rb
282
284
  - lib/renuo/cli/app/fetch_emails.rb
283
285
  - lib/renuo/cli/app/generate_password.rb
284
286
  - lib/renuo/cli/app/heroku_apps.rb
@@ -287,6 +289,7 @@ files:
287
289
  - lib/renuo/cli/app/local_storage.rb
288
290
  - lib/renuo/cli/app/name_display.rb
289
291
  - lib/renuo/cli/app/release_project.rb
292
+ - lib/renuo/cli/app/release_xing.rb
290
293
  - lib/renuo/cli/app/services/cloudfront_config_service.rb
291
294
  - lib/renuo/cli/app/services/markdown_parser_service.rb
292
295
  - lib/renuo/cli/app/setup_uptimerobot.rb
@@ -317,8 +320,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
317
320
  - !ruby/object:Gem::Version
318
321
  version: '0'
319
322
  requirements: []
320
- rubyforge_project:
321
- rubygems_version: 2.7.6
323
+ rubygems_version: 3.0.6
322
324
  signing_key:
323
325
  specification_version: 4
324
326
  summary: The Renuo CLI automates some common workflows.