geordi 5.2.0 → 5.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +29 -2
- data/Gemfile.lock +1 -1
- data/README.md +9 -8
- data/lib/geordi/commands/console.rb +1 -1
- data/lib/geordi/commands/delete_dumps.rb +26 -28
- data/lib/geordi/commands/docker.rb +7 -5
- data/lib/geordi/commands/shell.rb +0 -2
- data/lib/geordi/cucumber.rb +2 -2
- data/lib/geordi/dump_loader.rb +5 -1
- data/lib/geordi/remote.rb +1 -1
- data/lib/geordi/util.rb +4 -14
- data/lib/geordi/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 693551524b9b50f70e2daf649cd8184cc197b1576153beaf675ebaae01a88e84
|
4
|
+
data.tar.gz: 915a4c3e1449f0883e31bd828a850354db26bcdcf57523ffdf28ade6e51bee1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcbd43ffb224b54a7ba553c6bbcab6931d06b15df4a5e2e3eb9a93fe019187df47174bb2b61030a54d2408fb80235a1937eae7ff0a0f3c17e58756d3cbfc94b0
|
7
|
+
data.tar.gz: 03ef92df5d677f51ee70bec10bf035034824980b5c16c15c38e587de5b2a2cf683ddbce64067695e566fc9ee207d26af6f1986d909210b9fda61d9570bb91add
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.2
|
data/CHANGELOG.md
CHANGED
@@ -7,14 +7,41 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
7
7
|
## Unreleased
|
8
8
|
|
9
9
|
### Compatible changes
|
10
|
-
|
11
10
|
### Breaking changes
|
12
11
|
|
12
|
+
## 5.3.0 2021-02-01
|
13
13
|
|
14
|
-
|
14
|
+
### Compatible changes
|
15
|
+
* Changed: Dumping and loading a database will not keep the database dump in `tmp/` but delete it once the operation finishes successfully. Example: `geordi dump staging -l` will remove the file `tmp/staging.dump` after it loaded the dump.
|
16
|
+
|
17
|
+
|
18
|
+
## 5.2.4 2021-01-29
|
15
19
|
|
16
20
|
### Compatible changes
|
21
|
+
* Fix and improve delete-dumps command (now supporting multiple arguments)
|
22
|
+
|
23
|
+
|
24
|
+
## 5.2.3 2021-01-27
|
25
|
+
|
26
|
+
### Compatible changes
|
27
|
+
* Remove auto-bundling from `geordi shell` and remote `geordi console`
|
28
|
+
|
29
|
+
|
30
|
+
## 5.2.2 2020-12-17
|
17
31
|
|
32
|
+
### Compatible changes
|
33
|
+
* Ignore ACL settings when loading a PostgreSQL dump
|
34
|
+
|
35
|
+
|
36
|
+
## 5.2.1 2020-12-15
|
37
|
+
|
38
|
+
### Compatible changes
|
39
|
+
* Fix a bug regarding `geordi vnc` which was introduced in 5.1.0
|
40
|
+
|
41
|
+
|
42
|
+
## 5.2.0 2020-12-14
|
43
|
+
|
44
|
+
### Compatible changes
|
18
45
|
* Geordi update will exit with a warning when Ruby version changes during pull.
|
19
46
|
* Add `geordi docker` command with support for opening a shell for dockerized dev environments.
|
20
47
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -111,13 +111,13 @@ in `.geordi.yml` in the project root.
|
|
111
111
|
### `geordi delete-dumps [DIRECTORY]`
|
112
112
|
Delete database dump files (*.dump).
|
113
113
|
|
114
|
-
Example: `geordi
|
114
|
+
Example: `geordi delete-dumps` or `geordi delete-dumps ~/tmp/dumps`
|
115
115
|
|
116
|
-
Recursively
|
116
|
+
Recursively searches for files ending in `.dump` and offers to delete them. When
|
117
117
|
no argument is given, two default directories are searched for dump files: the
|
118
118
|
current working directory and `~/dumps` (for dumps created with geordi).
|
119
119
|
|
120
|
-
|
120
|
+
Will ask for confirmation before actually deleting files.
|
121
121
|
|
122
122
|
|
123
123
|
### `geordi deploy [STAGE]`
|
@@ -169,8 +169,11 @@ There are three subcommands:
|
|
169
169
|
|
170
170
|
- `geordi docker setup`
|
171
171
|
Fetches all docker containers.
|
172
|
+
|
172
173
|
- `geordi docker shell`
|
173
174
|
Runs the docker service named 'main'.
|
175
|
+
Append `--secondary` to open a second shell in an already running container.
|
176
|
+
|
174
177
|
- `geordi docker vnc`
|
175
178
|
Opens a VNC viewer to connect to the VNC server in the container.
|
176
179
|
|
@@ -423,11 +426,9 @@ Once you have completed your modifications, please update CHANGELOG and README
|
|
423
426
|
as needed. Use `rake readme` to regenerate the Geordi section of the README from
|
424
427
|
the command documentations.
|
425
428
|
|
426
|
-
Make sure tests are green in the
|
427
|
-
|
428
|
-
|
429
|
-
Before releasing your changes, wait for the Travis results to see that tests
|
430
|
-
passed in all Ruby versions.
|
429
|
+
Make sure tests are green in the oldest supported Ruby version. Before releasing
|
430
|
+
a new gem version, wait for the CI results to see that tests are green in all
|
431
|
+
Ruby versions.
|
431
432
|
|
432
433
|
|
433
434
|
Adding a new command
|
@@ -14,9 +14,9 @@ option :select_server, type: :string, aliases: '-s', banner: '[SERVER_NUMBER]',
|
|
14
14
|
|
15
15
|
def console(target = 'development', *_args)
|
16
16
|
require 'geordi/remote'
|
17
|
-
invoke_geordi 'bundle_install'
|
18
17
|
|
19
18
|
if target == 'development'
|
19
|
+
invoke_geordi 'bundle_install'
|
20
20
|
invoke_geordi 'yarn_install'
|
21
21
|
|
22
22
|
Interaction.announce 'Opening a local Rails console'
|
@@ -1,43 +1,41 @@
|
|
1
1
|
desc 'delete-dumps [DIRECTORY]', 'Delete database dump files (*.dump)'
|
2
2
|
long_desc <<-LONGDESC
|
3
|
-
Example: `geordi
|
3
|
+
Example: `geordi delete-dumps` or `geordi delete-dumps ~/tmp/dumps`
|
4
4
|
|
5
|
-
Recursively
|
5
|
+
Recursively searches for files ending in `.dump` and offers to delete them. When
|
6
6
|
no argument is given, two default directories are searched for dump files: the
|
7
7
|
current working directory and `~/dumps` (for dumps created with geordi).
|
8
8
|
|
9
|
-
|
9
|
+
Will ask for confirmation before actually deleting files.
|
10
10
|
LONGDESC
|
11
11
|
|
12
|
-
def delete_dumps(
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
]
|
19
|
-
else
|
20
|
-
[dump_directory]
|
12
|
+
def delete_dumps(*locations)
|
13
|
+
Interaction.announce 'Retrieving dump files'
|
14
|
+
|
15
|
+
dump_files = []
|
16
|
+
if locations.empty?
|
17
|
+
locations = [ File.join(Dir.home, 'dumps'), Dir.pwd ]
|
21
18
|
end
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
locations.map! &File.method(:expand_path)
|
20
|
+
|
21
|
+
Interaction.note "Looking in #{locations.join(', ')}"
|
22
|
+
locations.each do |dir|
|
23
|
+
directory = File.expand_path(dir)
|
24
|
+
unless File.directory? File.realdirpath(directory)
|
25
|
+
Interaction.warn "Directory #{directory} does not exist. Skipping."
|
27
26
|
next
|
28
27
|
end
|
29
|
-
|
28
|
+
dump_files.concat Dir.glob("#{directory}/**/*.dump")
|
30
29
|
end
|
30
|
+
deletable_dumps = dump_files.flatten.uniq.sort.select &File.method(:file?)
|
31
|
+
|
31
32
|
if deletable_dumps.empty?
|
32
|
-
Interaction.
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
Interaction.prompt('Delete those dumps', 'n', /y|yes/) || raise('Cancelled.')
|
40
|
-
deletable_dumps.each do |dump|
|
41
|
-
File.delete dump unless File.directory? dump
|
33
|
+
Interaction.note 'No dump files found'
|
34
|
+
else
|
35
|
+
puts deletable_dumps
|
36
|
+
Interaction.prompt('Delete these files?', 'n', /y|yes/) || Interaction.fail('Cancelled.')
|
37
|
+
|
38
|
+
deletable_dumps.each &File.method(:delete)
|
39
|
+
Interaction.success 'Done.'
|
42
40
|
end
|
43
41
|
end
|
@@ -1,17 +1,17 @@
|
|
1
1
|
class DockerCLI < Thor
|
2
|
-
desc 'setup', 'Setup docker and fetch required docker-container for the current project
|
2
|
+
desc 'setup', 'Setup docker and fetch required docker-container for the current project'
|
3
3
|
def setup
|
4
4
|
docker.setup
|
5
5
|
end
|
6
6
|
|
7
|
-
desc 'shell', 'Open a shell in the main docker container for the current project
|
7
|
+
desc 'shell', 'Open a shell in the main docker container for the current project'
|
8
8
|
option :secondary, default: false, type: :boolean
|
9
9
|
map 'shell' => '_shell'
|
10
10
|
def _shell
|
11
11
|
docker.shell(:secondary => options[:secondary])
|
12
12
|
end
|
13
13
|
|
14
|
-
desc 'vnc', 'Open a vnc viewer connecting to the docker container
|
14
|
+
desc 'vnc', 'Open a vnc viewer connecting to the docker container'
|
15
15
|
def vnc
|
16
16
|
docker.vnc
|
17
17
|
end
|
@@ -24,7 +24,7 @@ class DockerCLI < Thor
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
desc 'docker', 'Manage docker containers for the current project
|
27
|
+
desc 'docker', 'Manage docker containers for the current project'
|
28
28
|
long_desc <<-LONGDESC
|
29
29
|
Manage docker containers to run your project dockerized.
|
30
30
|
|
@@ -35,10 +35,12 @@ There are three subcommands:
|
|
35
35
|
|
36
36
|
- `geordi docker setup`
|
37
37
|
Fetches all docker containers.
|
38
|
+
|
38
39
|
- `geordi docker shell`
|
39
40
|
Runs the docker service named 'main'.
|
41
|
+
Append `--secondary` to open a second shell in an already running container.
|
42
|
+
|
40
43
|
- `geordi docker vnc`
|
41
44
|
Opens a VNC viewer to connect to the VNC server in the container.
|
42
|
-
|
43
45
|
LONGDESC
|
44
46
|
subcommand 'docker', DockerCLI
|
@@ -15,8 +15,6 @@ option :select_server, type: :string, aliases: '-s', banner: '[SERVER_NUMBER]',
|
|
15
15
|
def shelll(target, *_args)
|
16
16
|
require 'geordi/remote'
|
17
17
|
|
18
|
-
invoke_geordi 'bundle_install'
|
19
|
-
|
20
18
|
Interaction.announce 'Opening a shell on ' + target
|
21
19
|
Geordi::Remote.new(target).shell(options)
|
22
20
|
end
|
data/lib/geordi/cucumber.rb
CHANGED
@@ -11,7 +11,7 @@ module Geordi
|
|
11
11
|
class Cucumber
|
12
12
|
|
13
13
|
VNC_DISPLAY = ':17'.freeze
|
14
|
-
VNC_PASSWORD_FILE = File.
|
14
|
+
VNC_PASSWORD_FILE = File.expand_path('~/.vnc/passwd').freeze # default for "vncpasswd"
|
15
15
|
VNC_SERVER_DEFAULT_OPTIONS = "-localhost -nolisten tcp -geometry 1280x1024 -rfbauth #{VNC_PASSWORD_FILE}".freeze
|
16
16
|
VNC_SERVER_COMMAND = "vncserver #{VNC_DISPLAY} #{ENV.fetch('GEORDI_VNC_OPTIONS', VNC_SERVER_DEFAULT_OPTIONS)}".freeze
|
17
17
|
VNC_VIEWER_COMMAND = "vncviewer -passwd #{VNC_PASSWORD_FILE}".freeze
|
@@ -60,7 +60,7 @@ module Geordi
|
|
60
60
|
VNC_ENV_VARIABLES.each do |variable|
|
61
61
|
ENV["OUTER_#{variable}"] = ENV[variable] if ENV[variable]
|
62
62
|
end
|
63
|
-
ENV['BROWSER'] = ENV['LAUNCHY_BROWSER'] = File.expand_path('../../
|
63
|
+
ENV['BROWSER'] = ENV['LAUNCHY_BROWSER'] = File.expand_path('../../exe/launchy_browser', __dir__)
|
64
64
|
ENV['DISPLAY'] = VNC_DISPLAY
|
65
65
|
|
66
66
|
Interaction.note 'Run `geordi vnc` to view the Selenium test browsers'
|
data/lib/geordi/dump_loader.rb
CHANGED
@@ -34,7 +34,7 @@ module Geordi
|
|
34
34
|
|
35
35
|
def postgresql_command
|
36
36
|
ENV['PGPASSWORD'] = config['password']
|
37
|
-
command = 'pg_restore --no-owner --clean'
|
37
|
+
command = 'pg_restore --no-owner --clean --no-acl'
|
38
38
|
command << ' --username=' << config['username'].to_s if config['username']
|
39
39
|
command << ' --port=' << config['port'].to_s if config['port']
|
40
40
|
command << ' --host=' << config['host'].to_s if config['host']
|
@@ -58,6 +58,10 @@ module Geordi
|
|
58
58
|
|
59
59
|
source_command = send("#{config['adapter']}_command")
|
60
60
|
Util.run! source_command, fail_message: "An error occured loading #{File.basename(dump_file)}"
|
61
|
+
|
62
|
+
Interaction.announce 'Clean up'
|
63
|
+
Interaction.note 'Removing: ' + dump_file
|
64
|
+
Util.run!("rm #{dump_file}")
|
61
65
|
end
|
62
66
|
|
63
67
|
end
|
data/lib/geordi/remote.rb
CHANGED
@@ -59,7 +59,7 @@ module Geordi
|
|
59
59
|
server_option = options[:select_server]
|
60
60
|
server_number = server_option.to_i
|
61
61
|
|
62
|
-
server =
|
62
|
+
server = if server_option == 'select_server'
|
63
63
|
select_server
|
64
64
|
elsif server_number != 0 && server_number <= @config.servers.count
|
65
65
|
server_index = server_number - 1
|
data/lib/geordi/util.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'geordi/interaction'
|
2
2
|
require 'socket'
|
3
|
+
require 'bundler'
|
3
4
|
|
4
5
|
module Geordi
|
5
6
|
class Util
|
@@ -167,15 +168,10 @@ module Geordi
|
|
167
168
|
# Get the version for the given gem by parsing Gemfile.lock.
|
168
169
|
# Returns nil if the gem is not used.
|
169
170
|
def gem_version(gem)
|
170
|
-
|
171
|
-
|
172
|
-
matches = line.match(/\* #{gem} \(([\d\.]+)/)
|
173
|
-
next if matches.nil? || matches[1].nil?
|
171
|
+
lock_file = Bundler::LockfileParser.new(Bundler.read_file(Bundler.default_lockfile))
|
172
|
+
spec = lock_file.specs.detect { |spec| spec.name == gem }
|
174
173
|
|
175
|
-
|
176
|
-
end
|
177
|
-
|
178
|
-
nil
|
174
|
+
spec && spec.version
|
179
175
|
end
|
180
176
|
|
181
177
|
def file_containing?(file, regex)
|
@@ -192,12 +188,6 @@ module Geordi
|
|
192
188
|
string
|
193
189
|
end
|
194
190
|
|
195
|
-
private
|
196
|
-
|
197
|
-
def bundle_list
|
198
|
-
@bundle_list ||= `bundle list`
|
199
|
-
end
|
200
|
-
|
201
191
|
end
|
202
192
|
end
|
203
193
|
end
|
data/lib/geordi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geordi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
|
-
rubygems_version: 3.
|
121
|
+
rubygems_version: 3.0.8
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: Collection of command line tools we use in our daily work with Ruby, Rails
|