geordi 2.11.0 → 3.1.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.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +8 -2
  4. data/CHANGELOG.md +40 -0
  5. data/Gemfile +2 -5
  6. data/Gemfile.lock +50 -3
  7. data/README.md +34 -7
  8. data/Rakefile +6 -10
  9. data/{bin → exe}/b +0 -0
  10. data/{bin → exe}/cap-all +0 -0
  11. data/{bin → exe}/console-for +0 -0
  12. data/{bin → exe}/cuc +0 -0
  13. data/{bin → exe}/cuc-show +0 -0
  14. data/{bin → exe}/cuc-vnc-setup +0 -0
  15. data/{bin → exe}/deploy-to-production +0 -0
  16. data/{bin → exe}/dump-for +0 -0
  17. data/{bin → exe}/dumple +0 -0
  18. data/{bin → exe}/geordi +0 -0
  19. data/{bin → exe}/gitpt +0 -0
  20. data/{bin → exe}/launchy_browser +0 -0
  21. data/{bin → exe}/load-dump +0 -0
  22. data/{bin → exe}/migrate-all +0 -0
  23. data/{bin → exe}/rs +0 -0
  24. data/{bin → exe}/run_tests +0 -0
  25. data/{bin → exe}/shell-for +0 -0
  26. data/{bin → exe}/tests +0 -0
  27. data/geordi.gemspec +23 -20
  28. data/lib/geordi/COMMAND_TEMPLATE +4 -6
  29. data/lib/geordi/capistrano_config.rb +7 -7
  30. data/lib/geordi/chromedriver_updater.rb +9 -10
  31. data/lib/geordi/cli.rb +1 -7
  32. data/lib/geordi/commands/_setup_vnc.rb +23 -23
  33. data/lib/geordi/commands/apache_site.rb +3 -3
  34. data/lib/geordi/commands/bundle_install.rb +3 -3
  35. data/lib/geordi/commands/capistrano.rb +5 -6
  36. data/lib/geordi/commands/chromedriver_update.rb +0 -9
  37. data/lib/geordi/commands/clean.rb +5 -6
  38. data/lib/geordi/commands/commit.rb +0 -1
  39. data/lib/geordi/commands/console.rb +4 -4
  40. data/lib/geordi/commands/create_database_yml.rb +4 -4
  41. data/lib/geordi/commands/create_databases.rb +3 -3
  42. data/lib/geordi/commands/cucumber.rb +25 -25
  43. data/lib/geordi/commands/delete_dumps.rb +12 -12
  44. data/lib/geordi/commands/deploy.rb +27 -28
  45. data/lib/geordi/commands/drop_databases.rb +13 -15
  46. data/lib/geordi/commands/dump.rb +12 -13
  47. data/lib/geordi/commands/eurest.rb +2 -2
  48. data/lib/geordi/commands/firefox.rb +4 -4
  49. data/lib/geordi/commands/migrate.rb +3 -3
  50. data/lib/geordi/commands/png_optimize.rb +15 -14
  51. data/lib/geordi/commands/rake.rb +3 -3
  52. data/lib/geordi/commands/remove_executable_flags.rb +3 -3
  53. data/lib/geordi/commands/rspec.rb +11 -11
  54. data/lib/geordi/commands/security_update.rb +84 -27
  55. data/lib/geordi/commands/server.rb +6 -6
  56. data/lib/geordi/commands/setup.rb +8 -8
  57. data/lib/geordi/commands/shell.rb +3 -3
  58. data/lib/geordi/commands/tests.rb +1 -1
  59. data/lib/geordi/commands/unit.rb +3 -3
  60. data/lib/geordi/commands/update.rb +7 -7
  61. data/lib/geordi/commands/vnc.rb +1 -1
  62. data/lib/geordi/commands/with_rake.rb +3 -3
  63. data/lib/geordi/commands/yarn_install.rb +3 -3
  64. data/lib/geordi/cucumber.rb +35 -36
  65. data/lib/geordi/db_cleaner.rb +40 -41
  66. data/lib/geordi/dump_loader.rb +6 -5
  67. data/lib/geordi/firefox_for_selenium.rb +26 -29
  68. data/lib/geordi/gitpt.rb +14 -15
  69. data/lib/geordi/interaction.rb +2 -6
  70. data/lib/geordi/remote.rb +9 -10
  71. data/lib/geordi/util.rb +26 -27
  72. data/lib/geordi/version.rb +1 -1
  73. metadata +25 -37
  74. data/features/commit.feature +0 -17
  75. data/features/console.feature +0 -7
  76. data/features/cucumber.feature +0 -261
  77. data/features/deploy.feature +0 -66
  78. data/features/dump.feature +0 -34
  79. data/features/firefox.feature +0 -44
  80. data/features/server.feature +0 -31
  81. data/features/setup.feature +0 -11
  82. data/features/shell.feature +0 -78
  83. data/features/support/env.rb +0 -8
  84. data/features/support/step_definitions/aruba_backport_steps.rb +0 -5
  85. data/features/support/step_definitions/miscellaneous_steps.rb +0 -11
@@ -1,66 +0,0 @@
1
- Feature: The deploy command
2
-
3
- Scenario: Deploying from master to staging
4
-
5
- Unfortunately, Aruba cannot run commands truly interactively. We need to
6
- answer prompts blindly, and check the output afterwards.
7
-
8
- When I run `geordi deploy` interactively
9
- # Answer three prompts
10
- And I type "staging"
11
- And I type "master"
12
- And I type ""
13
- # Confirm deployment
14
- And I type "yes"
15
- Then the output should contain:
16
- """
17
- # Checking whether your master branch is ready
18
- Util.system! git checkout master
19
- > All good.
20
-
21
- # You are about to:
22
- > Deploy to staging
23
- Go ahead with the deployment? [n]
24
- """
25
- And the output should contain:
26
- """
27
- > cap staging deploy:migrations
28
- Util.system! cap staging deploy:migrations
29
-
30
- > Deployment complete.
31
- """
32
-
33
-
34
- Scenario: Deploying the current branch
35
-
36
- Deploying the current branch requires support by the deployed application:
37
- its deploy config needs to pick up the DEPLOY_BRANCH environment variable.
38
-
39
- When I run `geordi deploy --current-branch` interactively
40
- # Answer deployment stage prompt
41
- And I type "staging"
42
- Then the output should contain "configure config/deploy/staging.rb"
43
- And the output should contain "ENV['DEPLOY_BRANCH']"
44
-
45
- Given a file named "config/deploy/staging.rb" with:
46
- """
47
- set :branch, ENV['DEPLOY_BRANCH'] || 'master'
48
- """
49
- When I run `geordi deploy --current-branch` interactively
50
- # Answer deployment stage prompt
51
- And I type "staging"
52
- # Confirm deployment
53
- And I type "yes"
54
- # Current branch is always "master" during tests
55
- Then the output should contain "From current branch master"
56
- And the output should contain "DEPLOY_BRANCH=master cap staging deploy:migrations"
57
-
58
-
59
- Scenario: Deploying with a given stage
60
- Given a file named "config/deploy/staging.rb" with "staging.rb exists"
61
-
62
- When I run `geordi deploy staging` interactively
63
- And I type "master"
64
- And I type ""
65
- And I type "no"
66
- Then the output should not contain "Deployment stage: [staging]"
@@ -1,34 +0,0 @@
1
- Feature: The dump command
2
- Most aspects of connection to a server are tested in shell feature.
3
-
4
- Scenario: Creating a dump of the development database
5
- When I run `geordi dump`
6
- Then the output should contain "Util.system! dumple development"
7
- And the output should contain "Successfully dumped the development database"
8
-
9
-
10
- Scenario: Creating a dump of a remote database
11
- Given a file named "Capfile" with "Capfile exists"
12
- And a file named "config/deploy.rb" with:
13
- """
14
- """
15
- And a file named "config/deploy/staging.rb" with:
16
- """
17
- set :rails_env, 'staging'
18
- set :deploy_to, '/var/www/example.com'
19
- set :user, 'user'
20
-
21
- server 'www.example.com'
22
- """
23
-
24
- When I run `geordi dump staging`
25
- Then the output should contain "# Dumping the database of staging"
26
- And the output should contain "> Connecting to www.example.com"
27
- And the output should contain "Util.system! ssh, user@www.example.com, -t, cd /var/www/example.com/current && bash --login -c 'dumple staging --for_download'"
28
- And the output should contain "> Downloading remote dump to tmp/staging.dump"
29
- # Omitting the absolute path in this regex (.*)
30
- And the output should match:
31
- """
32
- Util\.system! scp -C user@www\.example\.com:~\/dumps\/dump_for_download.dump .*?\/tmp\/aruba\/tmp\/staging.dump
33
- """
34
- And the output should contain "> Dumped the staging database to tmp/staging.dump"
@@ -1,44 +0,0 @@
1
- Feature: The firefox/chrome command
2
-
3
- This command is used internally by the cucumber command.
4
-
5
- Scenario: Running a command with VNC set up
6
- Given a file named "testfile" with "testcontent"
7
-
8
- When I run `geordi firefox cat testfile`
9
- Then the output should contain "> Run `geordi vnc` to view the Selenium test browsers"
10
- And the output should contain "testcontent"
11
- But the output should not contain "Firefox for Selenium"
12
-
13
-
14
- Scenario: The command is aliased as "chrome"
15
- Given a file named "testfile" with "testcontent"
16
-
17
- When I run `geordi chrome cat testfile`
18
- Then the output should contain "> Run `geordi vnc` to view the Selenium test browsers"
19
- And the output should contain "testcontent"
20
-
21
- Scenario: Having a .firefox-version that is not installed yet
22
- Given a file named ".firefox-version" with "1337"
23
- And a file named "testfile" with "testcontent"
24
-
25
- When I run `geordi firefox cat testfile` interactively
26
- And I type "yes"
27
- Then the output should contain "> Firefox 1337 not found"
28
- And the output should contain "Run tests anyway?"
29
- And the output should contain "testcontent"
30
-
31
-
32
- Scenario: A .firefox-version file with "system" is ignored (legacy support)
33
- Given a file named ".firefox-version" with "system"
34
- And a file named "testfile" with "testcontent"
35
-
36
- When I run `geordi firefox cat testfile`
37
- Then the output should contain "> Run `geordi vnc`"
38
- And the output should contain "testcontent"
39
- But the output should not contain "Firefox for Selenium"
40
-
41
-
42
- Scenario: Running --setup without a version prints an error
43
- When I run `geordi firefox --setup`
44
- Then the output should contain "Firefox version required"
@@ -1,31 +0,0 @@
1
- Feature: The server/devserver command
2
-
3
- Scenario: Booting a development server
4
- When I run `geordi server`
5
- Then the output should contain "http://aruba.vcap.me:3000"
6
- And the output should contain "Util.system! bundle exec rails server -p 3000"
7
-
8
-
9
- Scenario: Passing a port as argument
10
- When I run `geordi server 3001`
11
- Then the output should contain "http://aruba.vcap.me:3001"
12
- And the output should contain "Util.system! bundle exec rails server -p 3001"
13
-
14
-
15
- Scenario: Passing a port as option
16
- When I run `geordi server -p 3001`
17
- Then the output should contain "http://aruba.vcap.me:3001"
18
- And the output should contain "Util.system! bundle exec rails server -p 3001"
19
-
20
-
21
- Scenario: The command is aliased for backwards compatibility
22
- When I run `geordi devserver`
23
- Then the output should contain "Util.system! bundle exec rails server"
24
-
25
-
26
- Scenario: Starting the server as accessible from the local network
27
-
28
- ... so it can be accessed from a test iPad or so.
29
-
30
- When I run `geordi server --public`
31
- Then the output should contain "Util.system! bundle exec rails server -b 0.0.0.0"
@@ -1,11 +0,0 @@
1
- Feature: Project setup
2
-
3
- Scenario: A local bin/setup is preferred
4
- Given a file named "bin/setup" with "custom project setup"
5
-
6
- When I run `geordi setup`
7
- Then the output should contain "Running bin/setup"
8
- And the output should contain "Geordi's own setup routine is skipped"
9
- And the output should contain "Util.system! bin/setup"
10
- And the output should not contain "Creating databases"
11
- But the output should contain "Successfully set up the project"
@@ -1,78 +0,0 @@
1
- Feature: The shell command
2
-
3
- Background:
4
- Given a file named "Capfile" with "Capfile exists"
5
-
6
-
7
- Scenario: It opens a remote shell on the primary server
8
- Given a file named "config/deploy.rb" with "deploy.rb exists"
9
- And a file named "config/deploy/geordi.rb" with:
10
- """
11
- set :user, 'deploy'
12
- set :deploy_to, '/var/www/example.com'
13
- server 'first.example.com'
14
- server 'second.example.com'
15
- """
16
-
17
- When I run `geordi shell geordi`
18
- Then the output should contain "Util.system! ssh, deploy@first.example.com, -t, cd /var/www/example.com/current && bash --login"
19
-
20
-
21
- Scenario: It understands Capistrano 3 syntax
22
- Given a file named "config/deploy.rb" with "deploy.rb exists"
23
- And a file named "config/deploy/geordi.rb" with:
24
- """
25
- set :deploy_to, '/var/www/example.com'
26
- server 'first.example.com', user: 'deploy'
27
- """
28
-
29
- When I run `geordi shell geordi`
30
- Then the output should contain "Util.system! ssh, deploy@first.example.com, -t, cd /var/www/example.com/current && bash --login"
31
-
32
- Scenario: It allows multiline capistrano server definitions
33
- Given a file named "config/deploy.rb" with "deploy.rb exists"
34
- And a file named "config/deploy/geordi.rb" with:
35
- """
36
- set :deploy_to, '/var/www/example.com'
37
- server 'first.example.com',
38
- user: 'deploy'
39
- """
40
-
41
- When I run `geordi shell geordi`
42
- Then the output should contain "Util.system! ssh, deploy@first.example.com, -t, cd /var/www/example.com/current && bash --login"
43
-
44
-
45
- Scenario: It prefers stage settings over general config
46
- Given a file named "config/deploy.rb" with:
47
- """
48
- set :deploy_to, '/var/www/unknown.example.com'
49
- set :user, 'user'
50
-
51
- server 'www.unknown.example.com'
52
- """
53
- And a file named "config/deploy/staging.rb" with:
54
- """
55
- set :deploy_to, '/var/www/example.com'
56
-
57
- server 'www.example.com'
58
- """
59
-
60
- When I run `geordi shell staging`
61
- Then the output should contain "Util.system! ssh, user@www.example.com, -t, cd /var/www/example.com/current"
62
-
63
-
64
- Scenario: It allows whitespaces in the config
65
- We also add the unset command to check we are still matching the right
66
- commands and not allow any char at the beginning.
67
-
68
- Given a file named "config/deploy.rb" with "deploy.rb exists"
69
- And a file named "config/deploy/staging.rb" with:
70
- """
71
- unset :user, 'wrong'
72
- set :deploy_to, '/var/www/example.com'
73
- set :user, 'user'
74
- server 'www.example.com'
75
- """
76
-
77
- When I run `geordi shell staging`
78
- Then the output should contain "Util.system! ssh, user@www.example.com, -t, cd /var/www/example.com/current"
@@ -1,8 +0,0 @@
1
- require 'aruba/cucumber'
2
-
3
- if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.8.7')
4
- require 'pry'
5
- end
6
-
7
- # Disables execution of Util.system! calls
8
- ENV['GEORDI_TESTING'] = 'true'
@@ -1,5 +0,0 @@
1
- Given(/^(?:a|the) file(?: named)? "([^"]*)" with "([^"]*)"$/) do |file_name, file_content|
2
- unescape_content = file_content.gsub('\n', "\n").gsub('\"', '"').gsub('\e', "\e").gsub('\033', "\e").gsub('\016', "\016").gsub('\017', "\017").gsub('\t', "\t")
3
-
4
- write_file(file_name, unescape_content)
5
- end
@@ -1,11 +0,0 @@
1
- When /^I wait for (\d+) seconds?$/ do |seconds|
2
- sleep seconds.to_i
3
- end
4
-
5
- Given 'I have staged changes' do
6
- ENV['GEORDI_TESTING_STAGED_CHANGES'] = 'true'
7
- end
8
-
9
- After do
10
- ENV['GEORDI_TESTING_STAGED_CHANGES'] = 'false'
11
- end