ey-core 3.4.0 → 3.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +5 -5
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +1 -0
  4. data/CHANGELOG.md +27 -5
  5. data/Gemfile +0 -1
  6. data/README.md +65 -8
  7. data/Rakefile +4 -1
  8. data/ey-core.gemspec +9 -5
  9. data/features/accounts.feature +13 -0
  10. data/features/applications.feature +29 -0
  11. data/features/current_user.feature +14 -0
  12. data/features/docker_registry_credentials.feature +21 -0
  13. data/features/environment_variables.feature +54 -0
  14. data/features/environments.feature +30 -0
  15. data/features/init.feature +6 -0
  16. data/features/login.feature +6 -0
  17. data/features/scp.feature +6 -0
  18. data/features/step_definitions/accounts_steps.rb +37 -0
  19. data/features/step_definitions/applications_steps.rb +39 -0
  20. data/features/step_definitions/current_user_steps.rb +11 -0
  21. data/features/step_definitions/deprecated_command_steps.rb +3 -0
  22. data/features/step_definitions/docker_registry_credentials_steps.rb +3 -0
  23. data/features/step_definitions/environment_variables_steps.rb +51 -0
  24. data/features/step_definitions/environments_steps.rb +52 -0
  25. data/features/step_definitions/version_steps.rb +3 -0
  26. data/features/support/account_helpers.rb +89 -0
  27. data/features/support/app_helpers.rb +19 -0
  28. data/features/support/aruba.rb +1 -0
  29. data/features/support/boilerplate.rb +1 -0
  30. data/features/support/client_helpers.rb +36 -0
  31. data/features/support/config_file_helpers.rb +42 -0
  32. data/features/support/core.rb +19 -0
  33. data/features/support/deployment_helpers.rb +19 -0
  34. data/features/support/env.rb +40 -0
  35. data/features/support/environment_helpers.rb +23 -0
  36. data/features/support/environment_variable_helpers.rb +20 -0
  37. data/features/support/fake_kernel.rb +23 -0
  38. data/features/support/io.rb +5 -0
  39. data/features/support/mock_api.rb +20 -0
  40. data/features/support/output_helpers.rb +7 -0
  41. data/features/support/resource_helpers.rb +201 -0
  42. data/features/support/server_helpers.rb +27 -0
  43. data/features/version.feature +8 -0
  44. data/features/whoami.feature +14 -0
  45. data/lib/ey-core/cli/deploy.rb +4 -4
  46. data/lib/ey-core/cli/docker_registry_login.rb +29 -0
  47. data/lib/ey-core/cli/environment_variables.rb +71 -0
  48. data/lib/ey-core/cli/helpers/core.rb +29 -0
  49. data/lib/ey-core/cli/main.rb +5 -4
  50. data/lib/ey-core/cli/servers.rb +35 -17
  51. data/lib/ey-core/cli/ssh.rb +1 -1
  52. data/lib/ey-core/client.rb +35 -0
  53. data/lib/ey-core/client/mock.rb +5 -0
  54. data/lib/ey-core/collections/auto_scaling_alarms.rb +8 -0
  55. data/lib/ey-core/collections/auto_scaling_groups.rb +8 -0
  56. data/lib/ey-core/collections/auto_scaling_policies.rb +33 -0
  57. data/lib/ey-core/collections/container_clusters.rb +9 -0
  58. data/lib/ey-core/collections/container_service_deployments.rb +17 -0
  59. data/lib/ey-core/collections/environment_variables.rb +8 -0
  60. data/lib/ey-core/collections/servers.rb +4 -0
  61. data/lib/ey-core/models/account.rb +10 -0
  62. data/lib/ey-core/models/address.rb +2 -0
  63. data/lib/ey-core/models/application.rb +1 -0
  64. data/lib/ey-core/models/auto_scaling_alarm.rb +54 -0
  65. data/lib/ey-core/models/auto_scaling_group.rb +75 -0
  66. data/lib/ey-core/models/base_auto_scaling_policy.rb +61 -0
  67. data/lib/ey-core/models/container_service_deployment.rb +17 -0
  68. data/lib/ey-core/models/environment.rb +60 -47
  69. data/lib/ey-core/models/environment_variable.rb +29 -0
  70. data/lib/ey-core/models/request.rb +6 -0
  71. data/lib/ey-core/models/server.rb +2 -0
  72. data/lib/ey-core/models/simple_auto_scaling_policy.rb +24 -0
  73. data/lib/ey-core/models/step_auto_scaling_policy.rb +24 -0
  74. data/lib/ey-core/models/target_auto_scaling_policy.rb +24 -0
  75. data/lib/ey-core/requests/boot_environment.rb +1 -1
  76. data/lib/ey-core/requests/create_account.rb +5 -0
  77. data/lib/ey-core/requests/create_address.rb +1 -0
  78. data/lib/ey-core/requests/create_application.rb +8 -7
  79. data/lib/ey-core/requests/create_auto_scaling_alarm.rb +69 -0
  80. data/lib/ey-core/requests/create_auto_scaling_group.rb +62 -0
  81. data/lib/ey-core/requests/create_auto_scaling_policy.rb +68 -0
  82. data/lib/ey-core/requests/create_environment.rb +2 -0
  83. data/lib/ey-core/requests/create_environment_variable.rb +39 -0
  84. data/lib/ey-core/requests/create_user.rb +8 -6
  85. data/lib/ey-core/requests/destroy_auto_scaling_alarm.rb +49 -0
  86. data/lib/ey-core/requests/destroy_auto_scaling_group.rb +44 -0
  87. data/lib/ey-core/requests/destroy_auto_scaling_policy.rb +49 -0
  88. data/lib/ey-core/requests/discover_container_service_deployments.rb +71 -0
  89. data/lib/ey-core/requests/discover_server.rb +60 -0
  90. data/lib/ey-core/requests/get_applications.rb +1 -1
  91. data/lib/ey-core/requests/get_auto_scaling_alarm.rb +27 -0
  92. data/lib/ey-core/requests/get_auto_scaling_alarms.rb +34 -0
  93. data/lib/ey-core/requests/get_auto_scaling_group.rb +21 -0
  94. data/lib/ey-core/requests/get_auto_scaling_groups.rb +29 -0
  95. data/lib/ey-core/requests/get_auto_scaling_policies.rb +46 -0
  96. data/lib/ey-core/requests/get_auto_scaling_policy.rb +27 -0
  97. data/lib/ey-core/requests/get_deployments.rb +1 -1
  98. data/lib/ey-core/requests/get_environment_variable.rb +19 -0
  99. data/lib/ey-core/requests/get_environment_variables.rb +29 -0
  100. data/lib/ey-core/requests/get_environments.rb +1 -1
  101. data/lib/ey-core/requests/get_ssl_certificate.rb +1 -1
  102. data/lib/ey-core/requests/retrieve_docker_registry_credentials.rb +24 -0
  103. data/lib/ey-core/requests/update_auto_scaling_alarm.rb +45 -0
  104. data/lib/ey-core/requests/update_auto_scaling_group.rb +45 -0
  105. data/lib/ey-core/requests/update_auto_scaling_policy.rb +46 -0
  106. data/lib/ey-core/requests/update_environment_variable.rb +25 -0
  107. data/lib/ey-core/test_helpers.rb +2 -0
  108. data/lib/ey-core/test_helpers/auto_scaling_helpers.rb +35 -0
  109. data/lib/ey-core/version.rb +1 -1
  110. data/spec/addresses_spec.rb +2 -1
  111. data/spec/auto_scaling_alarms_spec.rb +40 -0
  112. data/spec/auto_scaling_groups_spec.rb +28 -0
  113. data/spec/auto_scaling_policies_spec.rb +94 -0
  114. data/spec/docker_registry_credentials_spec.rb +16 -0
  115. data/spec/environments_spec.rb +18 -0
  116. data/spec/servers_spec.rb +8 -0
  117. data/spec/spec_helper.rb +7 -0
  118. data/spec/support/core.rb +0 -2
  119. metadata +192 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1666dc7dd164cf3aa06869572f6d663c3c7108ec
4
- data.tar.gz: eba158a6d0bbd66c885d3a5e38569e50ad70899c
2
+ SHA256:
3
+ metadata.gz: e7cd69781a4eb3275ce1a1326c7ea79279dcff1c6de8a663d95e0276d318e36e
4
+ data.tar.gz: e60e683abec4d85850bf11d7368c3ec501cd9c4d96af07ed5fc6613988fe4f69
5
5
  SHA512:
6
- metadata.gz: df68df0484a849dafc7726e6e0ebafbc96d2aca30e3de1e9aae32fb04baf035bbcc70c5fffd25d5fab4f9c7e49231b32f8f365d6827bd41d9dadb90ccbce283a
7
- data.tar.gz: 77d5890272ca1fe4c2b248a945dae39efffbb64e1293bd2338e3bffd35864580d6c5952d014612abb21a1443ef594b1a455cd8424b576326e8d948d96dd76c28
6
+ metadata.gz: d8d9bf7f44d69e2de4a71d393aa29e6e88cc851ebd99177c091388975bbe006d2cf4f9ccde6ab7d291dc200cbac0c26aa57ec96ba7322a5386e83d49df76a567
7
+ data.tar.gz: bbf84bfa83d24a4f293c14b928614b68846d988a30835d2973251f2a5caf6c85ad49703c1dc12b3e2e1478fec01003d9a14d8057f6a1f03ecf43e7ed93dc947f
@@ -1 +1 @@
1
- 1.9.3
1
+ 2.5.8
@@ -15,6 +15,7 @@ cache: bundler
15
15
  rvm:
16
16
  - 2.2.2
17
17
  - 2.3.1
18
+ - 2.4.2
18
19
 
19
20
  env:
20
21
  - COVERAGE=true
@@ -1,13 +1,35 @@
1
1
  # Change Log
2
2
 
3
- ## [Unreleased](https://github.com/engineyard/core-client-rb/tree/HEAD)
3
+ ## [Unreleased](https://github.com/engineyard/core-client-rb/tree/develop)
4
4
 
5
- [Full Changelog](https://github.com/engineyard/core-client-rb/compare/v2.8.4...HEAD)
5
+ [Full Changelog](https://github.com/engineyard/core-client-rb/compare/v3.6.1...develop)
6
6
 
7
7
  **Merged pull requests:**
8
8
 
9
- - \[ENG-193\] Create untracked addresses via smithy [\#34](https://github.com/engineyard/core-client-rb/pull/34) ([omgitsads](https://github.com/omgitsads))
10
- - remove usage of hmac client in specs [\#33](https://github.com/engineyard/core-client-rb/pull/33) ([lanej](https://github.com/lanej))
9
+ ## [v3.6.1](https://github.com/engineyard/core-client-rb/tree/v3.6.1) (2020-06-11)
10
+
11
+ [Full Changelog](https://github.com/engineyard/core-client-rb/compare/v3.5.0...v3.6.1)
12
+
13
+ **Merged pull requests:**
14
+
15
+ - Adds support for Docker credentials [\#106](https://github.com/engineyard/core-client-rb/pull/106) ([nodecarter](https://github.com/nodecarter))
16
+ - Adds support for container discovery [\#107](https://github.com/engineyard/core-client-rb/pull/107) ([thorn](https://github.com/thorn))
17
+ - Fixes `get_deployment` request parameters [\#108](https://github.com/engineyard/core-client-rb/pull/108) ([lucis-fluxum](https://github.com/lucis-fluxum))
18
+ - Adds server names to server list output [\#112](https://github.com/engineyard/core-client-rb/pull/112) ([glennr](https://github.com/glennr))
19
+ - Fixes the `--no-migrate` flag for `ey-core deploy` [\#114](https://github.com/engineyard/core-client-rb/pull/114) ([mushyy](https://github.com/mushyy))
20
+ - Upgrades dependencies and adds ruby-2.7 support for the gem [\#120](https://github.com/engineyard/core-client-rb/pull/120) ([ssuttner](https://github.com/ssuttner))
21
+ - Adds a bit of CLI documentation [\#121](https://github.com/engineyard/core-client-rb/pull/121) ([ess](https://github.com/ess))
22
+
23
+ ## [v3.5.0](https://github.com/engineyard/core-client-rb/tree/v3.5.0) (2018-04-04)
24
+ [Full Changelog](https://github.com/engineyard/core-client-rb/compare/v3.4.4...v3.5.0)
25
+
26
+ **Merged pull requests:**
27
+
28
+ - Add support for autoscaling policies [\#110](https://github.com/engineyard/core-client-rb/pull/101) ([thorn](https://github.com/thorn))
29
+ - Add support for environment variables [\#90](https://github.com/engineyard/core-client-rb/pull/90) ([rzaharenkov](https://github.com/rzaharenkov))
30
+ - Add ability to send configuration options together with blueprint [\#104](https://github.com/engineyard/core-client-rb/pull/104) ([ramonpm](https://github.com/ramonpm))
31
+ - Add support for address.scope parameter for EIP [\#102](https://github.com/engineyard/core-client-rb/pull/102) ([thorn](https://github.com/thorn))
32
+ - Various fixes for `servers` command [\#103](https://github.com/engineyard/core-client-rb/pull/103) ([binarypaladin](https://github.com/binarypaladin))
11
33
 
12
34
  ## [v2.8.4](https://github.com/engineyard/core-client-rb/tree/v2.8.4) (2015-08-12)
13
35
  [Full Changelog](https://github.com/engineyard/core-client-rb/compare/v2.8.3...v2.8.4)
@@ -164,4 +186,4 @@
164
186
 
165
187
 
166
188
 
167
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
189
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/Gemfile CHANGED
@@ -13,7 +13,6 @@ end
13
13
  group :test do
14
14
  gem 'codeclimate-test-reporter', '~> 0.3'
15
15
  gem 'faker'
16
- gem 'hashie'
17
16
  gem 'rack-test'
18
17
  gem 'rspec', '~> 3.1'
19
18
  gem 'simplecov'
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # Ey::Core
1
+ # Ey::Core #
2
2
 
3
- Official Ruby Engine Yard Core API Client.
3
+ Official Engine Yard Core API Ruby client and CLI utility.
4
4
 
5
- ## Installation
5
+ ## Installation ##
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
@@ -12,11 +12,68 @@ And then execute:
12
12
 
13
13
  $ bundle
14
14
 
15
- Or install it yourself as:
15
+ Or install it yourself for ad-hoc or CLI usage:
16
16
 
17
17
  $ gem install ey-core
18
18
 
19
- ## Usage
19
+ ## Usage ##
20
+
21
+ There are two ways to use this gem: you can install it to use as a client library for writing your own Engine Yard Cloud integrations, or you can use the `ey-core` CLi app to use our curated integrations.
22
+
23
+ ### CLI Usage ###
24
+
25
+ The CLI app, `ey-core`, is the replacement for the `ey` command that was provided by the now mostly deprecated`engineyard` gem. The old gem is still updated as need be, but is effectively just a slightly different UI for the `ey-core` command.
26
+ Like the `git` command, `ey-core` is like a gateway to other commands.
27
+
28
+ Rather than attempting to provide an exhaustive writeup of all of the commands provided by `ey-core`, this document will instead describe what are likely the most common use cases and leave you to read up on the remainder via the `help` command.
29
+
30
+ #### Use Case: Getting Help ####
31
+
32
+ Arguably the most important command in the app is `ey-core help`. Given no arguments, it provides the list of second-level commands avaiable for use. From that point, each argument is expected to be a command from the next level of the hierarchy.
33
+
34
+ For example, if one wishes to learn about the `servers` second-level command, they would do `ey-core help servers`.
35
+
36
+ For commands in even deeper levels, one just adds each level of chain after the `help` command. Try this in your terminal: `ey-core help recipes apply`
37
+
38
+ #### Use Case: Deploying An App ####
39
+
40
+ The `ey-core deploy` command allows one to deploy a new revision of an existing application in an existing environment. The command itself has several options, some of which may or may not be required depending on several factors. To guarantee the best result and remove a good deal of uncertainty in the process, we've opted to describe a somewhat verbose invocation of the command in this document.
41
+
42
+ Let's start with some assumptions:
43
+
44
+ * The name of our Engine Yard account is `MyAwesomeCompany` (you can get a real account name with `ey-core accounts`)
45
+ * That account has an environment named `awesome_production` (you can get a real environment name with `ey-core environments`)
46
+ * That account has an application named `awesome_app` (you can get a real application name with `ey-core applications`)
47
+ * The aforementioned application is already associated with the environment
48
+
49
+ As mentioned, some of the options for the `deploy` command are optional, and all of the topics discussed in our assumptions are effectively optional. That said, we suggest specifying *all* of these options to ensure absolutely that the proper application is deployed to the proper environment in the proper account.
50
+
51
+ All that said, to deploy the application to its latest git ref and the same migration command as the last deployment, you would issue the following command:
52
+
53
+ `$ ey-core deploy --account MyAwesomeCompany --environment awesome_production --app awesome_app`
54
+
55
+ You can also specify a git ref to use if you'd like to deploy a specific version or branch of the app:
56
+
57
+ `$ ey-core deploy --account MyAwesomeCompany --environment awesome_production --app awesome_app --ref feature/new-ui`
58
+
59
+ Say that you want to change the way your migrations are run during the deploy. You can specify the migration command:
60
+
61
+ `$ ey-core deploy --account MyAwesomeCompany --environment awesome_production --app awesome_app --migrate 'bundle exec rake db:migrate:new_hotness'`
62
+
63
+ Additionally, if you wish to skip migrations for the deployment, you can do that, too:
64
+
65
+ `$ ey-core deploy --account MyAwesomeCompany --environment awesome_production --app awesome_app --no-migrate`
66
+
67
+ Any of the invocations that we've talked about so far will stream the deployment log as it runs. If you'd rather do a fire-and-forget style deployment and check in on it later, you can add the `--no-wait` flag. If, however, you'd like to see even more information spit out during the deploy, you can add the `--verbose` flag.
68
+
69
+ That's about all there is to deployment so long as you consider the application, environment, and account to be required options. You can read more about any of the commands that we've mentioned in this use case by running the following in your terminal:
70
+
71
+ * `ey-core help accounts`
72
+ * `ey-core help applications`
73
+ * `ey-core help deploy`
74
+ * `ey-core help environments`
75
+
76
+ ### Client Library Usage ###
20
77
 
21
78
  Uses [cistern](https://github.com/lanej/cistern) to wrap RESTful resources nicely.
22
79
 
@@ -30,7 +87,7 @@ client.users.current # =>
30
87
  >
31
88
  ```
32
89
 
33
- ### Authentication
90
+ #### Authentication ####
34
91
 
35
92
  * Via Token
36
93
 
@@ -48,7 +105,7 @@ Ey::Core::Client.new(
48
105
  )
49
106
  ```
50
107
 
51
- ### Mock
108
+ #### Mock ####
52
109
 
53
110
  Mock is disabled by default.
54
111
 
@@ -64,7 +121,7 @@ Reset the mock
64
121
  Ey::Core::Client.reset!
65
122
  ```
66
123
 
67
- ### Testing
124
+ #### Testing ####
68
125
 
69
126
  By default, specs are run against the core mock. In order to run them against awsm mocked mode instead, run `MOCK_CORE=false bundle exec rspec`
70
127
 
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env rake
2
2
  require "bundler/gem_tasks"
3
+ require 'cucumber/rake/task'
3
4
 
4
5
  namespace :spec do
5
6
  task :mocked do
@@ -12,4 +13,6 @@ end
12
13
 
13
14
  task :spec => ["spec:mocked", "spec:unmocked"]
14
15
 
15
- task default: "spec:mocked"
16
+ Cucumber::Rake::Task.new
17
+
18
+ task default: ["spec:mocked", :cucumber]
@@ -18,22 +18,23 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ["lib"]
19
19
  gem.licenses = ["MIT"]
20
20
 
21
- gem.required_ruby_version = ">= 2.2.2"
21
+ gem.required_ruby_version = ">= 2.5"
22
22
 
23
23
  gem.add_dependency "addressable"
24
24
 
25
- gem.add_dependency "awesome_print"
25
+ gem.add_dependency "amazing_print", "~> 1.1.0"
26
26
  gem.add_dependency "belafonte"
27
27
  gem.add_dependency "cistern", "~> 0.12.3"
28
28
  gem.add_dependency "colorize"
29
29
  gem.add_dependency "ey-hmac", "~> 2.0"
30
30
  gem.add_dependency "escape"
31
- gem.add_dependency "faraday", "~> 0.9"
32
- gem.add_dependency "faraday_middleware", "~> 0.9"
31
+ gem.add_dependency "hashie", "~> 4.1.0"
32
+ gem.add_dependency "faraday", "~> 1.0.1"
33
+ gem.add_dependency "faraday_middleware", "~> 1.0.0"
33
34
  gem.add_dependency "rack"
34
35
  gem.add_dependency "faye"
35
36
  gem.add_dependency "highline"
36
- gem.add_dependency "json", "< 2.0"
37
+ gem.add_dependency "json", "~> 2.3.0"
37
38
  gem.add_dependency "mime-types"
38
39
  gem.add_dependency "oj"
39
40
  gem.add_dependency "oj_mimic_json"
@@ -45,4 +46,7 @@ Gem::Specification.new do |gem|
45
46
  gem.add_development_dependency "rspec", "~> 3.0"
46
47
  gem.add_development_dependency "ffaker"
47
48
  gem.add_development_dependency "rake"
49
+ gem.add_development_dependency "aruba", "~> 0.11"
50
+ gem.add_development_dependency "cucumber", "~> 2.1"
51
+ gem.add_development_dependency "factis", "~> 1.0"
48
52
  end
@@ -0,0 +1,13 @@
1
+ Feature: Accounts
2
+ In order to know what Engine Yard accounts I can access
3
+ As a User
4
+ I want to be able to list the accounts with which I'm associated
5
+
6
+ Background:
7
+ Given I'm an Engine Yard user
8
+ And ey-core is configured with my cloud token
9
+ And I'm associated with several accounts
10
+
11
+ Scenario: Listing my accounts
12
+ When I run `ey-core accounts`
13
+ Then I see the name and ID of each of my accounts
@@ -0,0 +1,29 @@
1
+ Feature: Applications
2
+ In order to determine what I can work with
3
+ As a User
4
+ I want to be able to list the applications that live in my accounts
5
+
6
+ Background:
7
+ Given I'm an Engine Yard user
8
+ And ey-core is configured with my cloud token
9
+ And I have the following accounts:
10
+ | Account Name |
11
+ | one |
12
+ | two |
13
+ | three |
14
+ And each of my accounts has several applications
15
+
16
+ Scenario: Listing all of my applications
17
+ When I run `ey-core applications`
18
+ Then I see the name and ID for all of my applications
19
+
20
+ Scenario Outline: Listing applications for a specific account
21
+ When I run `ey-core applications <Account Flag> one`
22
+ Then I see the applications in the one account
23
+ But I do not see applications from other accounts
24
+
25
+ Examples:
26
+ | Account Flag |
27
+ | -a |
28
+ | --account |
29
+
@@ -0,0 +1,14 @@
1
+ Feature: Current User
2
+ In order to ensure that I'm logged into the right account
3
+ As a User
4
+ I want to be able to see my user information
5
+
6
+ Background:
7
+ Given I'm an Engine Yard user
8
+ And ey-core is configured with my cloud token
9
+
10
+ Scenario: Getting the current user information
11
+ When I run `ey-core current_user`
12
+ Then I should see my user ID
13
+ And I should see my email address
14
+ And I should see my name
@@ -0,0 +1,21 @@
1
+ Feature: Docker Registry Credentials
2
+ In order to authorize the Docker Engine with the AWS ECR registry
3
+ As a User
4
+ I want to be able to retrieve the Docker authorization credentials
5
+
6
+ Background:
7
+ Given I'm an Engine Yard user
8
+ And ey-core is configured with my cloud token
9
+ And I have the following accounts:
10
+ | Account Name |
11
+ | one |
12
+ | two |
13
+
14
+ Scenario Outline: Retrieving Docker authorization credentials
15
+ When I run `ey-core get-docker-registry-login <Account Flag> one <Location Flag> us-east-1`
16
+ Then I see the docker login command
17
+
18
+ Examples:
19
+ | Account Flag | Location Flag |
20
+ | -c | -l |
21
+ | --account | --location |
@@ -0,0 +1,54 @@
1
+ Feature: Environment Variables
2
+ In order to know current values of environment variables assigned to my Engine Yard environments
3
+ As a User
4
+ I want to be able to list the environment variables for environments which I'm associated
5
+
6
+ Background:
7
+ Given I'm an Engine Yard user
8
+ And ey-core is configured with my cloud token
9
+ And I have the following accounts:
10
+ | Account Name |
11
+ | one |
12
+ | two |
13
+ | three |
14
+ And I have the following applications:
15
+ | Account Name | Application Name |
16
+ | one | blog_app |
17
+ | two | todo_app |
18
+ And I have the following environments:
19
+ | Application Name | Environment Name |
20
+ | blog_app | staging |
21
+ | blog_app | production |
22
+ | todo_app | staging |
23
+ And I have the following environment variables:
24
+ | Name | Value | Application Name | Environment Name | Sensitive |
25
+ | SECRET_BASE | abc= | blog_app | staging | false |
26
+ | DB_PASSWORD | 123qweasd!! | blog_app | staging | true |
27
+ | SECRET_BASE | qwe= | blog_app | production | false |
28
+ | DB_PASSWORD | 987qweasd!! | blog_app | production | true |
29
+ | DB_PASSWORD | my_secure_password | todo_app | staging | true |
30
+
31
+ Scenario: Listing all of my environment variables
32
+ When I run `ey-core environment_variables`
33
+ Then I see the name and value for all of my environments as well as name of associated environment and application
34
+
35
+ Scenario Outline: Listing environment variables for a specific environment
36
+ When I run `ey-core environment_variables <Environment Flag> staging`
37
+ Then I see the environment variables associated with `staging` environment
38
+ But I do not see environment variables associated with any other environments different from `staging`
39
+
40
+ Examples:
41
+ | Environment Flag |
42
+ | -e |
43
+ | --environment |
44
+
45
+ Scenario Outline: Listing environment variables for a specific application
46
+ When I run `ey-core environment_variables <Application Flag> blog_app`
47
+ Then I see the environment variables associated with `blog_app` application
48
+ But I do not see environment variables associated with any other applications different from `blog_app`
49
+
50
+ Examples:
51
+ | Application Flag |
52
+ | -a |
53
+ | --application |
54
+
@@ -0,0 +1,30 @@
1
+ Feature: Environments
2
+ In order to know what Engine Yard environments I can access
3
+ As a User
4
+ I want to be able to list the environments with which I'm associated
5
+
6
+ Background:
7
+ Given I'm an Engine Yard user
8
+ And ey-core is configured with my cloud token
9
+ And I have the following accounts:
10
+ | Account Name |
11
+ | one |
12
+ | two |
13
+ | three |
14
+ And each of my accounts has several applications
15
+ And each of my applications has an environment
16
+
17
+ Scenario: Listing all of my environments
18
+ When I run `ey-core environments`
19
+ Then I see the name and ID for all of my environments
20
+
21
+ Scenario Outline: Listing environments for a specific account
22
+ When I run `ey-core environments <Account Flag> one`
23
+ Then I see the environments in the one account
24
+ But I do not see environments from other accounts
25
+
26
+ Examples:
27
+ | Account Flag |
28
+ | -a |
29
+ | --account |
30
+
@@ -0,0 +1,6 @@
1
+ Feature: Init
2
+ This command is deprecated
3
+
4
+ Scenario: Running init
5
+ When I run `ey-core init`
6
+ Then I am advised that this command has been deprecated
@@ -0,0 +1,6 @@
1
+ Feature: Login
2
+ In order to interact with Engine Yard Cloud
3
+ As a User
4
+ I want to be able to log into the Cloud API
5
+
6
+
@@ -0,0 +1,6 @@
1
+ Feature: Scp
2
+ This command is deprecated
3
+
4
+ Scenario: Running init
5
+ When I run `ey-core init`
6
+ Then I am advised that this command has been deprecated
@@ -0,0 +1,37 @@
1
+ Given %(I'm an Engine Yard user) do
2
+ memorize_fact(:me, create_user(client: client))
3
+ true
4
+ end
5
+
6
+ Given %(ey-core is configured with my cloud token) do
7
+ add_config_option(
8
+ 'https://api.engineyard.com/' => current_user_hash['token']
9
+ )
10
+ end
11
+
12
+ Given %(I'm associated with several accounts) do
13
+ account1 = create_account(client: client, owner: current_user)
14
+ account2 = create_account(client: client, owner: current_user)
15
+ memorize_fact(:accounts, [account1, account2])
16
+ end
17
+
18
+ Given %r(^I have the following accounts:$) do |account_names|
19
+ account_names.hashes.each do |account_hash|
20
+ known_accounts.push(
21
+ create_account(
22
+ client: client,
23
+ owner: current_user,
24
+ account: {
25
+ name: account_hash['Account Name']
26
+ }
27
+ )
28
+ )
29
+ end
30
+ end
31
+
32
+ Then %(I see the name and ID of each of my accounts) do
33
+ recall_fact(:accounts).each do |account|
34
+ expect(output_text).to include(account.id)
35
+ expect(output_text).to include(account.name)
36
+ end
37
+ end