renuo-cli 4.21.0 → 4.21.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 +4 -4
- data/README.md +15 -0
- data/lib/renuo/cli/commands/ci/check_deploio_status.rb +3 -2
- data/lib/renuo/cli/commands/ci/setup.rb +26 -0
- data/lib/renuo/cli/commands/ci/update_deploio_app.rb +7 -11
- data/lib/renuo/cli/commands/debug.rb +6 -6
- data/lib/renuo/cli/templates/semaphore/semaphore-deploy.yml.erb +1 -0
- data/lib/renuo/cli/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9120767921d12d64d169446d7dc3a7e0329f498e80fc5c4f4afca46583ff9418
|
|
4
|
+
data.tar.gz: e16008accec27c375cb831856ce4fb9acce1ac2630fcdae9dfffcbc0a9a63c2f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 93c42b19caa65fb26adf806fe0079c842b6ed8661aaaa639ed5325bc4cd64d62d783363a6374db2aed5b3df50bc6769af4220b703359f75c0a38f5ef77dbc0c8
|
|
7
|
+
data.tar.gz: 3966f6f6510994401559c46b32931645d51f726d84a67a402977b5df6d9640b8e146c3208f04d54c05c3e0decee308c54da9a3c952a8ce6a068af637a2551c53
|
data/README.md
CHANGED
|
@@ -24,6 +24,21 @@ Run `bundle exec ruby -Ilib ./bin/renuo` to run the executable. (e.g. `ruby -Ili
|
|
|
24
24
|
|
|
25
25
|
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
26
26
|
|
|
27
|
+
### Testing commands in the shell
|
|
28
|
+
|
|
29
|
+
The easiest way to test the CLI during development is to temporarily add the local `bin` directory to your `PATH`:
|
|
30
|
+
|
|
31
|
+
```shell
|
|
32
|
+
export PATH="$PWD/bin:$PATH"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This binds the `renuo` command to your local version, so you can run commands directly:
|
|
36
|
+
|
|
37
|
+
```shell
|
|
38
|
+
renuo -h
|
|
39
|
+
renuo generate_github_settings
|
|
40
|
+
```
|
|
41
|
+
|
|
27
42
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
28
43
|
|
|
29
44
|
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`,
|
|
@@ -7,10 +7,11 @@ module Renuo::Cli::Commands::Ci
|
|
|
7
7
|
INTERVAL_IN_SECONDS = 5
|
|
8
8
|
|
|
9
9
|
command "ci check-deploio-status" do |c|
|
|
10
|
-
c.syntax = "renuo ci check-deploio-status"
|
|
10
|
+
c.syntax = "renuo ci check-deploio-status [options] <app-name>"
|
|
11
11
|
c.summary = "Checks the build and release status of the deployment."
|
|
12
12
|
c.description = c.summary
|
|
13
13
|
c.option "-p", "--project <name>", String, "The name of the project"
|
|
14
|
+
c.option "-g", "--git-revision <hash>", String, "The Git revision"
|
|
14
15
|
c.action { |args, options| new(args, options).run }
|
|
15
16
|
end
|
|
16
17
|
|
|
@@ -29,7 +30,7 @@ module Renuo::Cli::Commands::Ci
|
|
|
29
30
|
def initialize(args, options)
|
|
30
31
|
@app = args.first
|
|
31
32
|
@project = options.project
|
|
32
|
-
@revision = ENV.fetch("SEMAPHORE_GIT_SHA", nil)
|
|
33
|
+
@revision = options.git_revision || ENV.fetch("SEMAPHORE_GIT_SHA", nil)
|
|
33
34
|
|
|
34
35
|
abort "missing app name" unless @app
|
|
35
36
|
abort "missing project name" unless @project
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Renuo::Cli::Commands::Ci
|
|
4
|
+
class Setup
|
|
5
|
+
command "ci setup" do |c|
|
|
6
|
+
c.syntax = "renuo ci setup"
|
|
7
|
+
c.summary = "Installs and logs in to nctl."
|
|
8
|
+
c.description = c.summary
|
|
9
|
+
c.action { new.run }
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def run
|
|
13
|
+
system! "echo 'deb [trusted=yes] https://repo.nine.ch/deb/ /' " \
|
|
14
|
+
"| sudo tee /etc/apt/sources.list.d/repo.nine.ch.list"
|
|
15
|
+
system! "sudo apt-get update -qqo Dir::Etc::sourcelist=/etc/apt/sources.list.d/repo.nine.ch.list"
|
|
16
|
+
system! "sudo apt-get install -qq nctl"
|
|
17
|
+
system! "nctl auth login"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def system!(cmd)
|
|
23
|
+
abort unless system cmd
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
module Renuo::Cli::Commands::Ci
|
|
4
4
|
class UpdateDeploioApp
|
|
5
5
|
command "ci update-deploio-app" do |c|
|
|
6
|
-
c.syntax = "renuo ci update-deploio-app"
|
|
6
|
+
c.syntax = "renuo ci update-deploio-app [options] <app-name>"
|
|
7
7
|
c.summary = "Updates a Deploio app."
|
|
8
8
|
c.description = c.summary
|
|
9
9
|
c.option "-d", "--docker", "If the app uses a Dockerfile"
|
|
10
|
+
c.option "-g", "--git-revision <hash>", String, "The Git revision"
|
|
10
11
|
c.option "-p", "--project <name>", String, "The name of the project"
|
|
11
12
|
c.example "renuo ci update-deploio-app main -dp renuo-dashboard",
|
|
12
13
|
"Updates the 'main' app of the 'renuo-dashboard' project using a Dockerfile"
|
|
@@ -14,27 +15,22 @@ module Renuo::Cli::Commands::Ci
|
|
|
14
15
|
end
|
|
15
16
|
|
|
16
17
|
def run
|
|
17
|
-
system! "
|
|
18
|
-
system! "echo 'deb [trusted=yes] https://repo.nine.ch/deb/ /' " \
|
|
19
|
-
"| sudo tee /etc/apt/sources.list.d/repo.nine.ch.list"
|
|
20
|
-
system! "sudo apt-get update -qqo Dir::Etc::sourcelist=/etc/apt/sources.list.d/repo.nine.ch.list"
|
|
21
|
-
system! "sudo apt-get install -qq nctl"
|
|
22
|
-
system! "nctl auth login"
|
|
23
|
-
system! "nctl update app #{@app} -p #{@project} --env APP_REVISION=$SEMAPHORE_GIT_SHA " \
|
|
18
|
+
system! "nctl update app #{@app} -p #{@project} --env APP_REVISION=#{@git_revision} " \
|
|
24
19
|
"#{"--build-env RUBY_VERSION=#{File.read(".ruby-version").strip} " if @docker}" \
|
|
25
|
-
"--git-revision
|
|
20
|
+
"--git-revision #{@git_revision} --skip-repo-access-check"
|
|
26
21
|
end
|
|
27
22
|
|
|
28
23
|
private
|
|
29
24
|
|
|
30
25
|
def initialize(args, options)
|
|
31
26
|
@app = args.first
|
|
32
|
-
@project = options.project
|
|
33
27
|
@docker = options.docker
|
|
28
|
+
@git_revision = options.git_revision || ENV.fetch("SEMAPHORE_GIT_SHA", nil)
|
|
29
|
+
@project = options.project
|
|
34
30
|
|
|
35
31
|
abort "missing app name" unless @app
|
|
36
32
|
abort "missing project name" unless @project
|
|
37
|
-
abort "
|
|
33
|
+
abort "missing Git revision" unless @git_revision
|
|
38
34
|
end
|
|
39
35
|
|
|
40
36
|
def system!(cmd)
|
|
@@ -68,14 +68,14 @@ class Renuo::Cli::Commands::Debug # rubocop:disable Metrics/ClassLength
|
|
|
68
68
|
|
|
69
69
|
if should_scan_deploio && Cache.stored_at("deploio_apps")
|
|
70
70
|
select_deploio_targets(query).each do |app|
|
|
71
|
-
|
|
72
|
-
menu.choice(
|
|
71
|
+
bash_display_cmd, bash_exec_cmd = nctl_command(app, "exec", "bash")
|
|
72
|
+
menu.choice(bash_display_cmd) { exec bash_exec_cmd.squish }
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
menu.choice(
|
|
74
|
+
bundle_display_cmd, bundle_exec_cmd = nctl_command(app, "exec", "bundle exec rails console")
|
|
75
|
+
menu.choice(bundle_display_cmd) { exec bundle_exec_cmd.squish }
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
menu.choice(
|
|
77
|
+
logs_display_cmd, logs_exec_cmd = nctl_command(app, "logs", "-f")
|
|
78
|
+
menu.choice(logs_display_cmd) { exec logs_exec_cmd.squish }
|
|
79
79
|
|
|
80
80
|
app[:hosts].each { |host| open_cmds << "open https://#{host}" }
|
|
81
81
|
end
|
data/lib/renuo/cli/version.rb
CHANGED
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.21.
|
|
4
|
+
version: 4.21.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Renuo AG
|
|
@@ -66,6 +66,7 @@ files:
|
|
|
66
66
|
- lib/renuo/cli.rb
|
|
67
67
|
- lib/renuo/cli/commands/check_deploio_status.rb
|
|
68
68
|
- lib/renuo/cli/commands/ci/check_deploio_status.rb
|
|
69
|
+
- lib/renuo/cli/commands/ci/setup.rb
|
|
69
70
|
- lib/renuo/cli/commands/ci/update_deploio_app.rb
|
|
70
71
|
- lib/renuo/cli/commands/commit_leaderboard_stage.rb
|
|
71
72
|
- lib/renuo/cli/commands/commit_leaderboard_sync.rb
|