dawn-cli 0.9.1 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -3
  3. data/bin/dawni +15 -0
  4. data/lib/dawn/cli/commands.rb +9 -8
  5. data/lib/dawn/cli/commands/app.rb +35 -6
  6. data/lib/dawn/cli/commands/auth.rb +9 -7
  7. data/lib/dawn/cli/commands/base_commands.rb +31 -0
  8. data/lib/dawn/cli/commands/domain.rb +15 -5
  9. data/lib/dawn/cli/commands/drain.rb +15 -5
  10. data/lib/dawn/cli/commands/env.rb +25 -14
  11. data/lib/dawn/cli/commands/key.rb +20 -7
  12. data/lib/dawn/cli/commands/local.rb +13 -3
  13. data/lib/dawn/cli/commands/release.rb +6 -4
  14. data/lib/dawn/cli/helpers.rb +3 -5
  15. data/lib/dawn/cli/output_formatter.rb +15 -2
  16. data/lib/dawn/cli/parser.rb +58 -36
  17. data/lib/dawn/cli/version.rb +2 -2
  18. data/spec/api.log +45272 -0
  19. data/spec/cli/commands/app_spec.rb +71 -0
  20. data/spec/cli/commands/auth_spec.rb +13 -0
  21. data/spec/cli/commands/domain_spec.rb +25 -0
  22. data/spec/cli/commands/drain_spec.rb +25 -0
  23. data/spec/cli/commands/env_spec.rb +26 -0
  24. data/spec/cli/commands/key_spec.rb +30 -0
  25. data/spec/cli/commands/local_spec.rb +15 -0
  26. data/spec/cli/commands/release_spec.rb +19 -0
  27. data/spec/cli/parser_spec.rb +262 -0
  28. data/spec/cli_spec_helper.rb +13 -0
  29. data/spec/support/vcr.rb +11 -0
  30. data/spec/vcr/Dawn_CLI_App/_create/should_create_a_new_app_with_a_name.yml +51 -0
  31. data/spec/vcr/Dawn_CLI_App/_create/should_create_a_new_app_without_a_name.yml +51 -0
  32. data/spec/vcr/Dawn_CLI_App/_delete/should_delete_current_app.yml +98 -0
  33. data/spec/vcr/Dawn_CLI_App/_list/should_list_all_available_apps.yml +65 -0
  34. data/spec/vcr/Dawn_CLI_App/_list_gears/should_list_all_gears_for_current_app.yml +98 -0
  35. data/spec/vcr/Dawn_CLI_App/_logs/should_trail_the_current_app_s_logs.yml +98 -0
  36. data/spec/vcr/Dawn_CLI_App/_scale/should_modify_the_formation_for_the_current_app.yml +98 -0
  37. data/spec/vcr/Dawn_CLI_Auth/_login/should_login_using_proper_credentials.yml +48 -0
  38. data/spec/vcr/Dawn_CLI_Auth/_login/should_not_login_using_invalid_credentials.yml +46 -0
  39. data/spec/vcr/Dawn_CLI_Domain/_add/should_add_a_domain_to_the_current_app.yml +96 -0
  40. data/spec/vcr/Dawn_CLI_Domain/_delete/should_delete_a_domain_to_the_current_app.yml +97 -0
  41. data/spec/vcr/Dawn_CLI_Domain/_list/should_list_all_domains_for_current_app.yml +102 -0
  42. data/spec/vcr/Dawn_CLI_Drain/_add/should_add_a_drain_to_the_current_app.yml +359 -0
  43. data/spec/vcr/Dawn_CLI_Drain/_delete/should_remove_a_drain_from_current_app.yml +476 -0
  44. data/spec/vcr/Dawn_CLI_Drain/_list/should_list_all_drains_for_current_app.yml +98 -0
  45. data/spec/vcr/Dawn_CLI_Env/_get/should_retrieve_an_ENV_variable_given_a_key.yml +51 -0
  46. data/spec/vcr/Dawn_CLI_Env/_set/should_set_an_ENV_variable_given_a_Hash.yml +424 -0
  47. data/spec/vcr/Dawn_CLI_Env/_unset/should_remove_an_ENV_variable_given_a_key.yml +275 -0
  48. data/spec/vcr/Dawn_CLI_Key/_add/should_add_existing_id_rsa.yml +52 -0
  49. data/spec/vcr/Dawn_CLI_Key/_delete/should_delete_a_key_by_id.yml +101 -0
  50. data/spec/vcr/Dawn_CLI_Key/_get/should_retrieve_a_key_by_id.yml +102 -0
  51. data/spec/vcr/Dawn_CLI_Key/_list/should_list_all_keys_deployed.yml +53 -0
  52. data/spec/vcr/Dawn_CLI_Local/_health_check/should_verify_that_server_is_running.yml +50 -0
  53. data/spec/vcr/Dawn_CLI_Local/_whoami/should_print_current_user_to_console.yml +51 -0
  54. metadata +43 -4
@@ -0,0 +1,98 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.dawn.dev/apps/app-test
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Content-Type:
13
+ - application/json
14
+ Accept-Encoding:
15
+ - gzip
16
+ User-Agent:
17
+ - dawn/0.10.1
18
+ X-Ruby-Version:
19
+ - 2.1.2
20
+ X-Ruby-Platform:
21
+ - x86_64-linux
22
+ Authorization:
23
+ - Basic SWNlRHJhZ29uOmFGM0VHM1hjdW16Sm1LcGFIeUI5
24
+ response:
25
+ status:
26
+ code: 200
27
+ message:
28
+ headers:
29
+ content-type:
30
+ - text/html
31
+ etag:
32
+ - '"d5f561456fce1e85587f20c72f7e3305"'
33
+ cache-control:
34
+ - max-age=0, private, must-revalidate
35
+ x-request-id:
36
+ - 05930a84-dff0-481b-97af-6cf6c670c353
37
+ x-runtime:
38
+ - '0.021922'
39
+ transfer-encoding:
40
+ - ''
41
+ connection:
42
+ - TE, close
43
+ Date:
44
+ - Tue, 24 Jun 2014 22:21:33 GMT
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"app":{"id":15,"created_at":"2014-06-24 19:08:41 UTC","updated_at":"2014-06-24
48
+ 19:08:41 UTC","name":"app-test","version":0,"env":{},"formation":{"web":"1"},"url":"app-test.dawnapp.dev"}}'
49
+ http_version:
50
+ recorded_at: Tue, 24 Jun 2014 22:21:53 GMT
51
+ - request:
52
+ method: post
53
+ uri: http://api.dawn.dev/apps/15/scale
54
+ body:
55
+ encoding: UTF-8
56
+ string: '{"app":{"formation":{"web":2}}}'
57
+ headers:
58
+ Accept:
59
+ - application/json
60
+ Content-Type:
61
+ - application/json
62
+ Accept-Encoding:
63
+ - gzip
64
+ User-Agent:
65
+ - dawn/0.10.1
66
+ X-Ruby-Version:
67
+ - 2.1.2
68
+ X-Ruby-Platform:
69
+ - x86_64-linux
70
+ Authorization:
71
+ - Basic SWNlRHJhZ29uOmFGM0VHM1hjdW16Sm1LcGFIeUI5
72
+ response:
73
+ status:
74
+ code: 200
75
+ message:
76
+ headers:
77
+ content-type:
78
+ - text/html
79
+ etag:
80
+ - '"c61ca4cc37cdd20e1ca0b6b0544c6993"'
81
+ cache-control:
82
+ - max-age=0, private, must-revalidate
83
+ x-request-id:
84
+ - c668f751-6fbd-4b5a-bcd5-150447af7220
85
+ x-runtime:
86
+ - '0.018060'
87
+ transfer-encoding:
88
+ - ''
89
+ connection:
90
+ - TE, close
91
+ Date:
92
+ - Tue, 24 Jun 2014 22:21:35 GMT
93
+ body:
94
+ encoding: UTF-8
95
+ string: '{"formation":{"web":"2"}}'
96
+ http_version:
97
+ recorded_at: Tue, 24 Jun 2014 22:21:55 GMT
98
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.dawn.dev/login
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"username":"IceDragon","password":"creampuff"}'
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Content-Type:
13
+ - application/json
14
+ Accept-Encoding:
15
+ - gzip
16
+ User-Agent:
17
+ - dawn/0.10.1
18
+ X-Ruby-Version:
19
+ - 2.1.2
20
+ X-Ruby-Platform:
21
+ - x86_64-linux
22
+ response:
23
+ status:
24
+ code: 200
25
+ message:
26
+ headers:
27
+ content-type:
28
+ - text/html
29
+ etag:
30
+ - '"85dab94e4ad2f2c0adb71a321eb104cc"'
31
+ cache-control:
32
+ - max-age=0, private, must-revalidate
33
+ x-request-id:
34
+ - b40f73aa-33aa-41ff-b5ed-ea270f21e912
35
+ x-runtime:
36
+ - '0.095278'
37
+ transfer-encoding:
38
+ - ''
39
+ connection:
40
+ - TE, close
41
+ Date:
42
+ - Tue, 24 Jun 2014 22:25:27 GMT
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"api_key":"aF3EG3XcumzJmKpaHyB9"}'
46
+ http_version:
47
+ recorded_at: Tue, 24 Jun 2014 22:25:47 GMT
48
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.dawn.dev/login
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"username":"SomeGuy","password":"withsomepassword"}'
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Content-Type:
13
+ - application/json
14
+ Accept-Encoding:
15
+ - gzip
16
+ User-Agent:
17
+ - dawn/0.10.1
18
+ X-Ruby-Version:
19
+ - 2.1.2
20
+ X-Ruby-Platform:
21
+ - x86_64-linux
22
+ response:
23
+ status:
24
+ code: 400
25
+ message:
26
+ headers:
27
+ content-type:
28
+ - application/json
29
+ cache-control:
30
+ - no-cache
31
+ x-request-id:
32
+ - f2a0562f-0acb-40b6-8c72-178d2106e774
33
+ x-runtime:
34
+ - '0.006512'
35
+ transfer-encoding:
36
+ - ''
37
+ connection:
38
+ - TE, close
39
+ Date:
40
+ - Tue, 24 Jun 2014 22:25:11 GMT
41
+ body:
42
+ encoding: UTF-8
43
+ string: " "
44
+ http_version:
45
+ recorded_at: Tue, 24 Jun 2014 22:25:32 GMT
46
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,96 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.dawn.dev/apps/domain-test
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Content-Type:
13
+ - application/json
14
+ Accept-Encoding:
15
+ - gzip
16
+ User-Agent:
17
+ - dawn/0.10.1
18
+ X-Ruby-Version:
19
+ - 2.1.2
20
+ X-Ruby-Platform:
21
+ - x86_64-linux
22
+ Authorization:
23
+ - Basic SWNlRHJhZ29uOmFGM0VHM1hjdW16Sm1LcGFIeUI5
24
+ response:
25
+ status:
26
+ code: 200
27
+ message:
28
+ headers:
29
+ content-type:
30
+ - text/html
31
+ etag:
32
+ - '"a50757e706fa2ae4b587f7cd0bc1b46d"'
33
+ cache-control:
34
+ - max-age=0, private, must-revalidate
35
+ x-request-id:
36
+ - 94b071cb-9d6b-44db-a456-de0ca4770994
37
+ x-runtime:
38
+ - '0.043556'
39
+ transfer-encoding:
40
+ - ''
41
+ connection:
42
+ - TE, close
43
+ Date:
44
+ - Tue, 24 Jun 2014 22:25:53 GMT
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"app":{"id":3,"created_at":"2014-06-24 18:36:06 UTC","updated_at":"2014-06-24
48
+ 18:36:06 UTC","name":"domain-test","version":0,"env":{},"formation":{"web":"1"},"url":"domain-test.dawnapp.dev"}}'
49
+ http_version:
50
+ recorded_at: Tue, 24 Jun 2014 22:26:13 GMT
51
+ - request:
52
+ method: post
53
+ uri: http://api.dawn.dev/apps/3/domains
54
+ body:
55
+ encoding: UTF-8
56
+ string: '{"domain":{"url":"itwasadomain.io"}}'
57
+ headers:
58
+ Accept:
59
+ - application/json
60
+ Content-Type:
61
+ - application/json
62
+ Accept-Encoding:
63
+ - gzip
64
+ User-Agent:
65
+ - dawn/0.10.1
66
+ X-Ruby-Version:
67
+ - 2.1.2
68
+ X-Ruby-Platform:
69
+ - x86_64-linux
70
+ Authorization:
71
+ - Basic SWNlRHJhZ29uOmFGM0VHM1hjdW16Sm1LcGFIeUI5
72
+ response:
73
+ status:
74
+ code: 409
75
+ message:
76
+ headers:
77
+ content-type:
78
+ - text/html
79
+ cache-control:
80
+ - no-cache
81
+ x-request-id:
82
+ - f7bacf89-fba1-481f-aa13-3c442caf7d77
83
+ x-runtime:
84
+ - '0.014082'
85
+ transfer-encoding:
86
+ - ''
87
+ connection:
88
+ - TE, close
89
+ Date:
90
+ - Tue, 24 Jun 2014 22:26:09 GMT
91
+ body:
92
+ encoding: UTF-8
93
+ string: '{"id":"domain.exists","message":"Domain exists"}'
94
+ http_version:
95
+ recorded_at: Tue, 24 Jun 2014 22:26:29 GMT
96
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,97 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.dawn.dev/apps/domain-test
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Content-Type:
13
+ - application/json
14
+ Accept-Encoding:
15
+ - gzip
16
+ User-Agent:
17
+ - dawn/0.10.1
18
+ X-Ruby-Version:
19
+ - 2.1.2
20
+ X-Ruby-Platform:
21
+ - x86_64-linux
22
+ Authorization:
23
+ - Basic SWNlRHJhZ29uOmFGM0VHM1hjdW16Sm1LcGFIeUI5
24
+ response:
25
+ status:
26
+ code: 200
27
+ message:
28
+ headers:
29
+ content-type:
30
+ - text/html
31
+ etag:
32
+ - '"a50757e706fa2ae4b587f7cd0bc1b46d"'
33
+ cache-control:
34
+ - max-age=0, private, must-revalidate
35
+ x-request-id:
36
+ - c275cd11-f696-4652-a138-d9f598105991
37
+ x-runtime:
38
+ - '0.023417'
39
+ transfer-encoding:
40
+ - ''
41
+ connection:
42
+ - TE, close
43
+ Date:
44
+ - Tue, 24 Jun 2014 22:26:10 GMT
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"app":{"id":3,"created_at":"2014-06-24 18:36:06 UTC","updated_at":"2014-06-24
48
+ 18:36:06 UTC","name":"domain-test","version":0,"env":{},"formation":{"web":"1"},"url":"domain-test.dawnapp.dev"}}'
49
+ http_version:
50
+ recorded_at: Tue, 24 Jun 2014 22:26:30 GMT
51
+ - request:
52
+ method: delete
53
+ uri: http://api.dawn.dev/domains/cc-rushers.io
54
+ body:
55
+ encoding: US-ASCII
56
+ string: ''
57
+ headers:
58
+ Accept:
59
+ - application/json
60
+ Content-Type:
61
+ - application/json
62
+ Accept-Encoding:
63
+ - gzip
64
+ User-Agent:
65
+ - dawn/0.10.1
66
+ X-Ruby-Version:
67
+ - 2.1.2
68
+ X-Ruby-Platform:
69
+ - x86_64-linux
70
+ Authorization:
71
+ - Basic SWNlRHJhZ29uOmFGM0VHM1hjdW16Sm1LcGFIeUI5
72
+ response:
73
+ status:
74
+ code: 404
75
+ message:
76
+ headers:
77
+ content-type:
78
+ - text/html
79
+ cache-control:
80
+ - no-cache
81
+ x-request-id:
82
+ - ff6fa81c-2e10-42a7-8b1f-5f4d94aa365d
83
+ x-runtime:
84
+ - '0.011046'
85
+ transfer-encoding:
86
+ - ''
87
+ connection:
88
+ - TE, close
89
+ Date:
90
+ - Tue, 24 Jun 2014 22:26:11 GMT
91
+ body:
92
+ encoding: UTF-8
93
+ string: '{"id":"domain.not_exist","message":"Domain (id: cc-rushers) does not
94
+ exist"}'
95
+ http_version:
96
+ recorded_at: Tue, 24 Jun 2014 22:26:31 GMT
97
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,102 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.dawn.dev/apps/domain-test
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Content-Type:
13
+ - application/json
14
+ Accept-Encoding:
15
+ - gzip
16
+ User-Agent:
17
+ - dawn/0.10.1
18
+ X-Ruby-Version:
19
+ - 2.1.2
20
+ X-Ruby-Platform:
21
+ - x86_64-linux
22
+ Authorization:
23
+ - Basic SWNlRHJhZ29uOmFGM0VHM1hjdW16Sm1LcGFIeUI5
24
+ response:
25
+ status:
26
+ code: 200
27
+ message:
28
+ headers:
29
+ content-type:
30
+ - text/html
31
+ etag:
32
+ - '"a50757e706fa2ae4b587f7cd0bc1b46d"'
33
+ cache-control:
34
+ - max-age=0, private, must-revalidate
35
+ x-request-id:
36
+ - 65a0246a-10cd-4c05-a539-e463a4102232
37
+ x-runtime:
38
+ - '0.018655'
39
+ transfer-encoding:
40
+ - ''
41
+ connection:
42
+ - TE, close
43
+ Date:
44
+ - Tue, 24 Jun 2014 22:25:43 GMT
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"app":{"id":3,"created_at":"2014-06-24 18:36:06 UTC","updated_at":"2014-06-24
48
+ 18:36:06 UTC","name":"domain-test","version":0,"env":{},"formation":{"web":"1"},"url":"domain-test.dawnapp.dev"}}'
49
+ http_version:
50
+ recorded_at: Tue, 24 Jun 2014 22:26:03 GMT
51
+ - request:
52
+ method: get
53
+ uri: http://api.dawn.dev/apps/3/domains
54
+ body:
55
+ encoding: US-ASCII
56
+ string: ''
57
+ headers:
58
+ Accept:
59
+ - application/json
60
+ Content-Type:
61
+ - application/json
62
+ Accept-Encoding:
63
+ - gzip
64
+ User-Agent:
65
+ - dawn/0.10.1
66
+ X-Ruby-Version:
67
+ - 2.1.2
68
+ X-Ruby-Platform:
69
+ - x86_64-linux
70
+ Authorization:
71
+ - Basic SWNlRHJhZ29uOmFGM0VHM1hjdW16Sm1LcGFIeUI5
72
+ response:
73
+ status:
74
+ code: 200
75
+ message:
76
+ headers:
77
+ content-type:
78
+ - text/html
79
+ etag:
80
+ - '"aa8fb4db7b75fe64de47fed7416c5a92"'
81
+ cache-control:
82
+ - max-age=0, private, must-revalidate
83
+ x-request-id:
84
+ - d61d362b-5645-4ca8-a137-0006dd4fccfb
85
+ x-runtime:
86
+ - '0.034401'
87
+ transfer-encoding:
88
+ - ''
89
+ connection:
90
+ - TE, close
91
+ Date:
92
+ - Tue, 24 Jun 2014 22:25:51 GMT
93
+ body:
94
+ encoding: UTF-8
95
+ string: '[{"domain":{"id":1,"created_at":"2014-06-24 18:36:08 UTC","updated_at":"2014-06-24
96
+ 18:36:08 UTC","url":"cc-rushers.io","app":{"app_id":3}}},{"domain":{"id":2,"created_at":"2014-06-24
97
+ 18:36:09 UTC","updated_at":"2014-06-24 18:36:09 UTC","url":"cookiecrushers.com","app":{"app_id":3}}},{"domain":{"id":3,"created_at":"2014-06-24
98
+ 18:36:10 UTC","updated_at":"2014-06-24 18:36:10 UTC","url":"cookie-crusher.net","app":{"app_id":3}}},{"domain":{"id":4,"created_at":"2014-06-24
99
+ 18:55:44 UTC","updated_at":"2014-06-24 18:55:44 UTC","url":"itwasadomain.io","app":{"app_id":3}}}]'
100
+ http_version:
101
+ recorded_at: Tue, 24 Jun 2014 22:26:11 GMT
102
+ recorded_with: VCR 2.9.2