geordi 2.10.1 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/.travis.yml +8 -2
- data/CHANGELOG.md +46 -0
- data/Gemfile +2 -5
- data/Gemfile.lock +10 -10
- data/README.md +11 -6
- data/Rakefile +6 -10
- data/{bin → exe}/b +0 -0
- data/{bin → exe}/cap-all +0 -0
- data/{bin → exe}/console-for +0 -0
- data/{bin → exe}/cuc +0 -0
- data/{bin → exe}/cuc-show +0 -0
- data/{bin → exe}/cuc-vnc-setup +0 -0
- data/{bin → exe}/deploy-to-production +0 -0
- data/{bin → exe}/dump-for +0 -0
- data/{bin → exe}/dumple +0 -0
- data/{bin → exe}/geordi +0 -0
- data/{bin → exe}/gitpt +0 -0
- data/{bin → exe}/launchy_browser +0 -0
- data/{bin → exe}/load-dump +0 -0
- data/{bin → exe}/migrate-all +0 -0
- data/{bin → exe}/rs +0 -0
- data/{bin → exe}/run_tests +0 -0
- data/{bin → exe}/shell-for +0 -0
- data/{bin → exe}/tests +0 -0
- data/geordi.gemspec +23 -20
- data/lib/geordi/COMMAND_TEMPLATE +4 -6
- data/lib/geordi/capistrano_config.rb +20 -17
- data/lib/geordi/chromedriver_updater.rb +9 -10
- data/lib/geordi/cli.rb +5 -2
- data/lib/geordi/commands/_setup_vnc.rb +23 -23
- data/lib/geordi/commands/apache_site.rb +3 -3
- data/lib/geordi/commands/bundle_install.rb +3 -3
- data/lib/geordi/commands/capistrano.rb +5 -6
- data/lib/geordi/commands/chromedriver_update.rb +0 -9
- data/lib/geordi/commands/clean.rb +5 -6
- data/lib/geordi/commands/commit.rb +0 -1
- data/lib/geordi/commands/console.rb +4 -4
- data/lib/geordi/commands/create_database_yml.rb +4 -4
- data/lib/geordi/commands/create_databases.rb +3 -3
- data/lib/geordi/commands/cucumber.rb +25 -25
- data/lib/geordi/commands/delete_dumps.rb +12 -12
- data/lib/geordi/commands/deploy.rb +27 -28
- data/lib/geordi/commands/drop_databases.rb +13 -15
- data/lib/geordi/commands/dump.rb +12 -13
- data/lib/geordi/commands/eurest.rb +2 -2
- data/lib/geordi/commands/firefox.rb +4 -4
- data/lib/geordi/commands/migrate.rb +3 -3
- data/lib/geordi/commands/png_optimize.rb +15 -14
- data/lib/geordi/commands/rake.rb +3 -3
- data/lib/geordi/commands/remove_executable_flags.rb +3 -3
- data/lib/geordi/commands/rspec.rb +11 -11
- data/lib/geordi/commands/security_update.rb +25 -25
- data/lib/geordi/commands/server.rb +6 -6
- data/lib/geordi/commands/setup.rb +8 -8
- data/lib/geordi/commands/shell.rb +3 -3
- data/lib/geordi/commands/tests.rb +1 -1
- data/lib/geordi/commands/unit.rb +3 -3
- data/lib/geordi/commands/update.rb +7 -7
- data/lib/geordi/commands/vnc.rb +1 -1
- data/lib/geordi/commands/with_rake.rb +3 -3
- data/lib/geordi/commands/yarn_install.rb +3 -3
- data/lib/geordi/cucumber.rb +35 -36
- data/lib/geordi/db_cleaner.rb +40 -41
- data/lib/geordi/dump_loader.rb +6 -5
- data/lib/geordi/firefox_for_selenium.rb +26 -29
- data/lib/geordi/gitpt.rb +14 -15
- data/lib/geordi/interaction.rb +2 -6
- data/lib/geordi/remote.rb +9 -10
- data/lib/geordi/util.rb +28 -25
- data/lib/geordi/version.rb +1 -1
- metadata +27 -39
- data/features/commit.feature +0 -17
- data/features/console.feature +0 -7
- data/features/cucumber.feature +0 -261
- data/features/deploy.feature +0 -66
- data/features/dump.feature +0 -34
- data/features/firefox.feature +0 -44
- data/features/server.feature +0 -31
- data/features/setup.feature +0 -11
- data/features/shell.feature +0 -78
- data/features/support/env.rb +0 -8
- data/features/support/step_definitions/aruba_backport_steps.rb +0 -5
- data/features/support/step_definitions/miscellaneous_steps.rb +0 -11
@@ -17,18 +17,18 @@ Geordi will ask for confirmation before actually dropping databases and will
|
|
17
17
|
offer to edit the whitelist instead.
|
18
18
|
LONGDESC
|
19
19
|
|
20
|
-
option :postgres_only, :
|
21
|
-
:
|
22
|
-
option :mysql_only, :
|
23
|
-
:
|
24
|
-
option :postgres, :
|
25
|
-
:
|
26
|
-
option :mysql, :
|
27
|
-
:
|
20
|
+
option :postgres_only, aliases: '-P', type: :boolean,
|
21
|
+
desc: 'Only clean Postgres', default: false
|
22
|
+
option :mysql_only, aliases: '-M', type: :boolean,
|
23
|
+
desc: 'Only clean MySQL/MariaDB', default: false
|
24
|
+
option :postgres, banner: 'PORT_OR_SOCKET',
|
25
|
+
desc: 'Use Postgres port or socket'
|
26
|
+
option :mysql, banner: 'PORT_OR_SOCKET',
|
27
|
+
desc: 'Use MySQL/MariaDB port or socket'
|
28
28
|
|
29
29
|
def drop_databases
|
30
30
|
require 'geordi/db_cleaner'
|
31
|
-
fail '-P and -M are mutually exclusive' if options.postgres_only
|
31
|
+
Interaction.fail '-P and -M are mutually exclusive' if options.postgres_only && options.mysql_only
|
32
32
|
mysql_flags = nil
|
33
33
|
postgres_flags = nil
|
34
34
|
|
@@ -38,7 +38,7 @@ def drop_databases
|
|
38
38
|
mysql_flags = "--port=#{mysql_port} --protocol=TCP"
|
39
39
|
rescue AttributeError
|
40
40
|
unless File.exist? options.mysql
|
41
|
-
fail "Path #{options.mysql} is not a valid MySQL socket"
|
41
|
+
Interaction.fail "Path #{options.mysql} is not a valid MySQL socket"
|
42
42
|
end
|
43
43
|
mysql_flags = "--socket=#{options.mysql}"
|
44
44
|
end
|
@@ -48,13 +48,11 @@ def drop_databases
|
|
48
48
|
postgres_flags = "--port=#{options.postgres}"
|
49
49
|
end
|
50
50
|
|
51
|
-
extra_flags = {'mysql' => mysql_flags,
|
52
|
-
'postgres' => postgres_flags
|
53
|
-
}
|
51
|
+
extra_flags = { 'mysql' => mysql_flags,
|
52
|
+
'postgres' => postgres_flags }
|
54
53
|
cleaner = DBCleaner.new(extra_flags)
|
55
54
|
cleaner.clean_mysql unless options.postgres_only
|
56
55
|
cleaner.clean_postgres unless options.mysql_only
|
57
56
|
|
58
|
-
success 'Done.'
|
57
|
+
Interaction.success 'Done.'
|
59
58
|
end
|
60
|
-
|
data/lib/geordi/commands/dump.rb
CHANGED
@@ -20,44 +20,43 @@ dump into the development database after downloading it.
|
|
20
20
|
geordi dump staging -l
|
21
21
|
DESC
|
22
22
|
|
23
|
-
option :load, :
|
24
|
-
option :select_server, :
|
23
|
+
option :load, aliases: ['-l'], type: :string, desc: 'Load a dump'
|
24
|
+
option :select_server, default: false, type: :boolean, aliases: '-s'
|
25
25
|
|
26
|
-
def dump(target = nil, *
|
26
|
+
def dump(target = nil, *_args)
|
27
27
|
require 'geordi/dump_loader'
|
28
28
|
require 'geordi/remote'
|
29
29
|
|
30
30
|
if target.nil?
|
31
31
|
if options.load
|
32
32
|
# validate load option
|
33
|
-
fail 'Missing a dump file.' if options.load == 'load'
|
34
|
-
File.
|
33
|
+
Interaction.fail 'Missing a dump file.' if options.load == 'load'
|
34
|
+
File.exist?(options.load) || raise('Could not find the given dump file: ' + options.load)
|
35
35
|
|
36
36
|
loader = DumpLoader.new(options.load)
|
37
37
|
|
38
|
-
announce "Sourcing dump into the #{loader.config['database']} db"
|
38
|
+
Interaction.announce "Sourcing dump into the #{loader.config['database']} db"
|
39
39
|
loader.load
|
40
40
|
|
41
|
-
success "Your #{loader.config['database']} database has now the data of #{options.load}."
|
41
|
+
Interaction.success "Your #{loader.config['database']} database has now the data of #{options.load}."
|
42
42
|
|
43
43
|
else
|
44
|
-
announce 'Dumping the development database'
|
44
|
+
Interaction.announce 'Dumping the development database'
|
45
45
|
Util.system! 'dumple development'
|
46
|
-
success 'Successfully dumped the development database.'
|
46
|
+
Interaction.success 'Successfully dumped the development database.'
|
47
47
|
end
|
48
48
|
|
49
49
|
else
|
50
|
-
announce 'Dumping the database of ' + target
|
50
|
+
Interaction.announce 'Dumping the database of ' + target
|
51
51
|
dump_path = Geordi::Remote.new(target).dump(options)
|
52
52
|
|
53
53
|
if options.load
|
54
54
|
loader = DumpLoader.new(dump_path)
|
55
55
|
|
56
|
-
announce "Sourcing dump into the #{loader.config['database']} db"
|
56
|
+
Interaction.announce "Sourcing dump into the #{loader.config['database']} db"
|
57
57
|
loader.load
|
58
58
|
|
59
|
-
success "Your #{loader.config['database']} database has now the data of #{target}."
|
59
|
+
Interaction.success "Your #{loader.config['database']} database has now the data of #{target}."
|
60
60
|
end
|
61
61
|
end
|
62
|
-
|
63
62
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
desc 'eurest', 'Open the current Eurest cantina menu', :
|
1
|
+
desc 'eurest', 'Open the current Eurest cantina menu', hide: true
|
2
2
|
def eurest
|
3
|
-
Util.system! %
|
3
|
+
Util.system! %(file="Speiseplan_KW`date +%V`.pdf" && wget -O/tmp/$file http://www.eurest-extranet.de/eurest/export/sites/default/sigma-technopark/de/downloads/$file && xdg-open /tmp/$file)
|
4
4
|
end
|
@@ -10,12 +10,12 @@ Useful when you need Firefox for Selenium or the VNC set up, but can't use the
|
|
10
10
|
This command is aliased `chrome` for users running Selenium in Chrome.
|
11
11
|
LONGDESC
|
12
12
|
|
13
|
-
option :setup, :
|
14
|
-
:
|
13
|
+
option :setup, banner: 'FIREFOX_VERSION',
|
14
|
+
desc: 'Install a special test runner Firefox with the given version'
|
15
15
|
|
16
16
|
def firefox(*command)
|
17
17
|
if options.setup
|
18
|
-
fail 'Firefox version required (e.g. --setup 24.0)' if options.setup == 'setup'
|
18
|
+
Interaction.fail 'Firefox version required (e.g. --setup 24.0)' if options.setup == 'setup'
|
19
19
|
|
20
20
|
require 'geordi/firefox_for_selenium'
|
21
21
|
Geordi::FirefoxForSelenium.install(options.setup)
|
@@ -27,7 +27,7 @@ def firefox(*command)
|
|
27
27
|
FirefoxForSelenium.setup_firefox
|
28
28
|
|
29
29
|
puts
|
30
|
-
note_cmd command.join(' ')
|
30
|
+
Interaction.note_cmd command.join(' ')
|
31
31
|
system *command # Util.system! would reset the Firefox PATH
|
32
32
|
end
|
33
33
|
end
|
@@ -10,11 +10,11 @@ LONGDESC
|
|
10
10
|
def migrate
|
11
11
|
invoke_cmd 'bundle_install'
|
12
12
|
invoke_cmd 'yarn_install'
|
13
|
-
announce 'Migrating'
|
13
|
+
Interaction.announce 'Migrating'
|
14
14
|
|
15
15
|
if File.directory?('db/migrate')
|
16
16
|
if Util.file_containing?('Gemfile', /parallel_tests/)
|
17
|
-
note 'Development and parallel test databases'
|
17
|
+
Interaction.note 'Development and parallel test databases'
|
18
18
|
puts
|
19
19
|
|
20
20
|
Util.system! 'bundle exec rake db:migrate parallel:prepare'
|
@@ -22,6 +22,6 @@ def migrate
|
|
22
22
|
invoke_cmd 'rake', 'db:migrate'
|
23
23
|
end
|
24
24
|
else
|
25
|
-
note 'No migrations directory found.'
|
25
|
+
Interaction.note 'No migrations directory found.'
|
26
26
|
end
|
27
27
|
end
|
@@ -10,10 +10,10 @@ LONGDESC
|
|
10
10
|
def png_optimize(path)
|
11
11
|
require 'fileutils'
|
12
12
|
|
13
|
-
announce 'Optimizing .png files'
|
13
|
+
Interaction.announce 'Optimizing .png files'
|
14
14
|
|
15
15
|
if `which pngcrush`.strip.empty?
|
16
|
-
fail 'Please install pngcrush first (sudo apt-get install pngcrush)'
|
16
|
+
Interaction.fail 'Please install pngcrush first (sudo apt-get install pngcrush)'
|
17
17
|
end
|
18
18
|
|
19
19
|
po = PngOptimizer.new
|
@@ -22,10 +22,10 @@ def png_optimize(path)
|
|
22
22
|
elsif File.file?(path)
|
23
23
|
po.optimize_inplace(path)
|
24
24
|
else
|
25
|
-
fail 'Neither directory nor file: ' + path
|
25
|
+
Interaction.fail 'Neither directory nor file: ' + path
|
26
26
|
end
|
27
27
|
|
28
|
-
success 'PNG optimization completed.'
|
28
|
+
Interaction.success 'PNG optimization completed.'
|
29
29
|
end
|
30
30
|
|
31
31
|
class PngOptimizer
|
@@ -35,10 +35,10 @@ class PngOptimizer
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def optimization_default_args
|
38
|
-
args =
|
39
|
-
args <<
|
40
|
-
args <<
|
41
|
-
args <<
|
38
|
+
args = ''
|
39
|
+
args << '-rem alla ' # remove everything except transparency
|
40
|
+
args << '-rem text ' # remove text chunks
|
41
|
+
args << '-reduce ' # eliminate unused colors and reduce bit-depth (if possible)
|
42
42
|
args
|
43
43
|
end
|
44
44
|
|
@@ -50,10 +50,11 @@ class PngOptimizer
|
|
50
50
|
dirname = File.dirname(original)
|
51
51
|
basename = File.basename(original)
|
52
52
|
count = 0
|
53
|
-
|
53
|
+
|
54
|
+
loop do
|
54
55
|
tmp_name = "#{dirname}/#{basename}_temp_#{count += 1}.png"
|
55
|
-
|
56
|
-
|
56
|
+
break tmp_name unless File.exist?(tmp_name)
|
57
|
+
end
|
57
58
|
end
|
58
59
|
|
59
60
|
def optimize_inplace(input_file)
|
@@ -61,9 +62,9 @@ class PngOptimizer
|
|
61
62
|
result = optimize_file(input_file, temp_file)
|
62
63
|
if result
|
63
64
|
FileUtils.rm(input_file)
|
64
|
-
FileUtils.mv(
|
65
|
+
FileUtils.mv(temp_file.to_s, input_file.to_s)
|
65
66
|
else
|
66
|
-
fail 'Error:' + $?
|
67
|
+
Interaction.fail 'Error:' + $?
|
67
68
|
end
|
68
69
|
end
|
69
70
|
|
@@ -71,7 +72,7 @@ class PngOptimizer
|
|
71
72
|
# Dir[".png"] works case sensitive, so to catch all funky .png extensions we have to go the following way:
|
72
73
|
png_relative_paths = []
|
73
74
|
Dir["#{path}/*.*"].each do |file_name|
|
74
|
-
png_relative_paths << file_name if ends_with?(File.basename(file_name.downcase),
|
75
|
+
png_relative_paths << file_name if ends_with?(File.basename(file_name.downcase), '.png')
|
75
76
|
end
|
76
77
|
png_relative_paths.each do |png_relative_path|
|
77
78
|
optimize_inplace(png_relative_path)
|
data/lib/geordi/commands/rake.rb
CHANGED
@@ -10,10 +10,10 @@ Example: `geordi rake db:migrate`
|
|
10
10
|
LONGDESC
|
11
11
|
|
12
12
|
def rake(*args)
|
13
|
-
|
14
|
-
if File.
|
13
|
+
%w[development test cucumber].each do |env| # update long_desc when changing this
|
14
|
+
if File.exist? "config/environments/#{env}.rb"
|
15
15
|
call = %w[bundle exec rake] + args + ["RAILS_ENV=#{env}"]
|
16
|
-
note_cmd call.join(' ')
|
16
|
+
Interaction.note_cmd call.join(' ')
|
17
17
|
|
18
18
|
Util.system! *call
|
19
19
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
desc 'remove-executable-flags', 'Remove executable-flags from files that should not be executable'
|
2
2
|
def remove_executable_flags
|
3
|
-
announce 'Removing executable-flags'
|
3
|
+
Interaction.announce 'Removing executable-flags'
|
4
4
|
|
5
5
|
patterns = %w[
|
6
6
|
*.rb *.html *.erb *.haml *.yml *.css *.sass *.rake *.png *.jpg
|
7
7
|
*.gif *.pdf *.txt *.rdoc *.feature Rakefile VERSION README Capfile
|
8
8
|
]
|
9
|
-
|
10
|
-
note pattern
|
9
|
+
patterns.each do |pattern|
|
10
|
+
Interaction.note pattern
|
11
11
|
`find . -name "#{pattern}" -exec chmod -x {} ';'`
|
12
12
|
end
|
13
13
|
puts 'Done.'
|
@@ -7,29 +7,29 @@ detection, etc.
|
|
7
7
|
LONGDESC
|
8
8
|
|
9
9
|
def rspec(*files)
|
10
|
-
if File.
|
10
|
+
if File.exist?('spec/spec_helper.rb')
|
11
11
|
invoke_cmd 'bundle_install'
|
12
12
|
invoke_cmd 'yarn_install'
|
13
13
|
|
14
|
-
announce 'Running specs'
|
14
|
+
Interaction.announce 'Running specs'
|
15
15
|
|
16
|
-
if Util.file_containing?('Gemfile', /parallel_tests/)
|
17
|
-
note 'All specs at once (using parallel_tests)'
|
18
|
-
Util.system! 'bundle exec rake parallel:spec', :
|
16
|
+
if Util.file_containing?('Gemfile', /parallel_tests/) && files.empty?
|
17
|
+
Interaction.note 'All specs at once (using parallel_tests)'
|
18
|
+
Util.system! 'bundle exec rake parallel:spec', fail_message: 'Specs failed.'
|
19
19
|
|
20
20
|
else
|
21
21
|
# tell which specs will be run
|
22
22
|
if files.empty?
|
23
23
|
files << 'spec/'
|
24
|
-
note 'All specs in spec/'
|
24
|
+
Interaction.note 'All specs in spec/'
|
25
25
|
else
|
26
|
-
note 'Only: ' + files.join(', ')
|
26
|
+
Interaction.note 'Only: ' + files.join(', ')
|
27
27
|
end
|
28
28
|
|
29
29
|
command = ['bundle exec']
|
30
|
-
command << if File.
|
30
|
+
command << if File.exist?('script/spec')
|
31
31
|
'spec -c' # RSpec 1
|
32
|
-
elsif File.
|
32
|
+
elsif File.exist?('bin/rspec')
|
33
33
|
'bin/rspec'
|
34
34
|
else
|
35
35
|
'rspec'
|
@@ -38,9 +38,9 @@ def rspec(*files)
|
|
38
38
|
command << files.join(' ')
|
39
39
|
|
40
40
|
puts
|
41
|
-
Util.system! command.join(' '), :
|
41
|
+
Util.system! command.join(' '), fail_message: 'Specs failed.'
|
42
42
|
end
|
43
43
|
else
|
44
|
-
note 'RSpec not employed.'
|
44
|
+
Interaction.note 'RSpec not employed.'
|
45
45
|
end
|
46
46
|
end
|
@@ -8,47 +8,47 @@ Switches branches, pulls, pushes and deploys as required by our workflow. Tells
|
|
8
8
|
what it will do before it does it.
|
9
9
|
LONGDESC
|
10
10
|
|
11
|
-
def security_update(step='prepare')
|
11
|
+
def security_update(step = 'prepare')
|
12
12
|
case step
|
13
13
|
when 'prepare'
|
14
|
-
announce 'Preparing for security update'
|
15
|
-
warn 'Please read https://makandracards.com/makandra/1587 before applying security updates!'
|
16
|
-
note 'About to checkout production and pull'
|
17
|
-
prompt('Continue?', 'y', /y|yes/)
|
14
|
+
Interaction.announce 'Preparing for security update'
|
15
|
+
Interaction.warn 'Please read https://makandracards.com/makandra/1587 before applying security updates!'
|
16
|
+
Interaction.note 'About to checkout production and pull'
|
17
|
+
Interaction.prompt('Continue?', 'y', /y|yes/) || Interaction.fail('Cancelled.')
|
18
18
|
|
19
|
-
Util.system! 'git checkout production', :
|
20
|
-
Util.system! 'git pull', :
|
19
|
+
Util.system! 'git checkout production', show_cmd: true
|
20
|
+
Util.system! 'git pull', show_cmd: true
|
21
21
|
|
22
|
-
success 'Successfully prepared for security update'
|
22
|
+
Interaction.success 'Successfully prepared for security update'
|
23
23
|
puts
|
24
|
-
note 'Please apply the security update now and commit your changes.'
|
25
|
-
note 'When you are done, run `geordi security-update finish`.'
|
24
|
+
Interaction.note 'Please apply the security update now and commit your changes.'
|
25
|
+
Interaction.note 'When you are done, run `geordi security-update finish`.'
|
26
26
|
|
27
27
|
|
28
28
|
when 'f', 'finish'
|
29
29
|
# ensure everything is committed
|
30
|
-
`git status --porcelain`.empty?
|
30
|
+
`git status --porcelain`.empty? || Interaction.fail('Please commit your changes before finishing the update.')
|
31
31
|
|
32
|
-
announce 'Finishing security update'
|
33
|
-
note 'Working directory clean.'
|
34
|
-
prompt('Have you successfully run all tests?', 'n', /y|yes/)
|
32
|
+
Interaction.announce 'Finishing security update'
|
33
|
+
Interaction.note 'Working directory clean.'
|
34
|
+
Interaction.prompt('Have you successfully run all tests?', 'n', /y|yes/) || Interaction.fail('Please run tests first.')
|
35
35
|
|
36
|
-
note 'About to: push production, checkout & pull master, merge production, push master'
|
37
|
-
prompt('Continue?', 'n', /y|yes/)
|
36
|
+
Interaction.note 'About to: push production, checkout & pull master, merge production, push master'
|
37
|
+
Interaction.prompt('Continue?', 'n', /y|yes/) || Interaction.fail('Cancelled.')
|
38
38
|
|
39
|
-
Util.system! 'git push', :
|
40
|
-
Util.system! 'git checkout master', :
|
41
|
-
Util.system! 'git pull', :
|
42
|
-
Util.system! 'git merge production', :
|
43
|
-
Util.system! 'git push', :
|
39
|
+
Util.system! 'git push', show_cmd: true
|
40
|
+
Util.system! 'git checkout master', show_cmd: true
|
41
|
+
Util.system! 'git pull', show_cmd: true
|
42
|
+
Util.system! 'git merge production', show_cmd: true
|
43
|
+
Util.system! 'git push', show_cmd: true
|
44
44
|
|
45
|
-
announce 'Deploying all targets'
|
45
|
+
Interaction.announce 'Deploying all targets'
|
46
46
|
deploy = (Util.gem_major_version('capistrano') == 3) ? 'deploy' : 'deploy:migrations'
|
47
47
|
invoke_cmd 'capistrano', deploy
|
48
48
|
|
49
|
-
success 'Successfully pushed and deployed security update'
|
49
|
+
Interaction.success 'Successfully pushed and deployed security update'
|
50
50
|
puts
|
51
|
-
note 'Now send an email to customer and project lead, informing them about the update.'
|
52
|
-
note 'Do not forget to make a joblog on a security budget, if available.'
|
51
|
+
Interaction.note 'Now send an email to customer and project lead, informing them about the update.'
|
52
|
+
Interaction.note 'Do not forget to make a joblog on a security budget, if available.'
|
53
53
|
end
|
54
54
|
end
|
@@ -1,18 +1,18 @@
|
|
1
1
|
desc 'server [PORT]', 'Start a development server'
|
2
2
|
|
3
|
-
option :port, :
|
4
|
-
:
|
5
|
-
option :public, :
|
6
|
-
:
|
3
|
+
option :port, aliases: '-p', default: '3000',
|
4
|
+
desc: 'Choose a port'
|
5
|
+
option :public, aliases: '-P', type: :boolean,
|
6
|
+
desc: 'Make the server accessible in the local network'
|
7
7
|
|
8
8
|
def server(port = nil)
|
9
9
|
invoke_cmd 'bundle_install'
|
10
10
|
invoke_cmd 'yarn_install'
|
11
11
|
require 'geordi/util'
|
12
12
|
|
13
|
-
announce 'Booting a development server'
|
13
|
+
Interaction.announce 'Booting a development server'
|
14
14
|
port ||= options.port
|
15
|
-
note "URL: http://#{
|
15
|
+
Interaction.note "URL: http://#{File.basename(Dir.pwd)}.vcap.me:#{port}"
|
16
16
|
puts
|
17
17
|
|
18
18
|
command = Util.server_command
|
@@ -19,14 +19,14 @@ After setting up, runs all tests when called with the `--test` option:
|
|
19
19
|
geordi setup -t
|
20
20
|
LONGDESC
|
21
21
|
|
22
|
-
option :dump, :
|
23
|
-
:
|
24
|
-
option :test, :
|
22
|
+
option :dump, type: :string, aliases: '-d', banner: 'TARGET',
|
23
|
+
desc: 'After setup, dump the TARGET db and source it into the development db'
|
24
|
+
option :test, type: :boolean, aliases: '-t', desc: 'After setup, run tests'
|
25
25
|
|
26
26
|
def setup
|
27
|
-
if File.
|
28
|
-
announce 'Running bin/setup'
|
29
|
-
note "Geordi's own setup routine is skipped"
|
27
|
+
if File.exist? 'bin/setup'
|
28
|
+
Interaction.announce 'Running bin/setup'
|
29
|
+
Interaction.note "Geordi's own setup routine is skipped"
|
30
30
|
|
31
31
|
Util.system! 'bin/setup'
|
32
32
|
else
|
@@ -34,8 +34,8 @@ def setup
|
|
34
34
|
invoke_cmd 'migrate'
|
35
35
|
end
|
36
36
|
|
37
|
-
success 'Successfully set up the project.'
|
37
|
+
Interaction.success 'Successfully set up the project.'
|
38
38
|
|
39
|
-
invoke_cmd 'dump', options.dump, :
|
39
|
+
invoke_cmd 'dump', options.dump, load: true if options.dump
|
40
40
|
invoke_cmd 'tests' if options.test
|
41
41
|
end
|