sendgrid_webapi 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -0
  3. data/.rspec +0 -0
  4. data/.ruby-version +0 -0
  5. data/.tekton/Chart.lock +6 -0
  6. data/.tekton/Chart.yaml +14 -0
  7. data/.tekton/templates/pipelinerun.yaml +53 -0
  8. data/.tekton/values-main.yaml +14 -0
  9. data/.tekton/values-pr.yaml +8 -0
  10. data/.tekton/values.yaml +19 -0
  11. data/.tool-versions +0 -0
  12. data/Gemfile +0 -1
  13. data/MIT-LICENSE +20 -0
  14. data/README.rdoc +69 -18
  15. data/Rakefile +0 -0
  16. data/lib/api_key/management.rb +0 -0
  17. data/lib/api_key/modules.rb +0 -0
  18. data/lib/apikey_client.rb +0 -0
  19. data/lib/base.rb +7 -0
  20. data/lib/helper.rb +0 -0
  21. data/lib/middlewares/sendgrid_response.rb +0 -0
  22. data/lib/sendgrid_webapi.rb +0 -0
  23. data/lib/sub_user/apps.rb +0 -0
  24. data/lib/sub_user/auth.rb +0 -0
  25. data/lib/sub_user/bounces.rb +0 -0
  26. data/lib/sub_user/event_notification.rb +0 -0
  27. data/lib/sub_user/iframe.rb +0 -0
  28. data/lib/sub_user/invalid_emails.rb +0 -0
  29. data/lib/sub_user/ip_management.rb +0 -0
  30. data/lib/sub_user/limits.rb +0 -0
  31. data/lib/sub_user/management.rb +0 -0
  32. data/lib/sub_user/modules.rb +0 -0
  33. data/lib/sub_user/monitor_records.rb +0 -0
  34. data/lib/sub_user/parse.rb +0 -0
  35. data/lib/sub_user/spam.rb +0 -0
  36. data/lib/sub_user/stats.rb +0 -0
  37. data/lib/sub_user/unsubscribes.rb +0 -0
  38. data/lib/sub_user/white_label.rb +0 -0
  39. data/lib/subuser_client.rb +0 -0
  40. data/lib/version.rb +1 -1
  41. data/lib/web_api/blocks.rb +20 -7
  42. data/lib/web_api/bounces.rb +19 -6
  43. data/lib/web_api/event_notification.rb +0 -0
  44. data/lib/web_api/invalid_emails.rb +15 -5
  45. data/lib/web_api/mail.rb +0 -0
  46. data/lib/web_api/modules.rb +0 -0
  47. data/lib/web_api/parse.rb +0 -0
  48. data/lib/web_api/profile.rb +0 -0
  49. data/lib/web_api/spam.rb +14 -4
  50. data/lib/web_api/stats.rb +0 -0
  51. data/lib/web_api/unsubscribes.rb +19 -6
  52. data/lib/web_api/version.rb +0 -0
  53. data/lib/webapi_client.rb +0 -0
  54. data/sendgrid_webapi.gemspec +7 -1
  55. data/spec/cassettes/client/_modules/_block/should_get_block_emails.yml +1 -1
  56. data/spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml +2 -2
  57. data/spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml +2 -2
  58. data/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml +1 -1
  59. data/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails_using_params.yml +36 -0
  60. data/spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml +0 -0
  61. data/spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml +2 -2
  62. data/spec/cassettes/client/_modules/_event_notification/should_delete_event_notification_url.yml +0 -0
  63. data/spec/cassettes/client/_modules/_event_notification/should_get_event_notification_url.yml +0 -0
  64. data/spec/cassettes/client/_modules/_event_notification/should_set_event_notification_url.yml +0 -0
  65. data/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml +1 -1
  66. data/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_emails_using_params.yml +37 -0
  67. data/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_using_params.yml +36 -0
  68. data/spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml +2 -2
  69. data/spec/cassettes/client/_modules/_parse_email/should_delete_parse_email.yml +0 -0
  70. data/spec/cassettes/client/_modules/_parse_email/should_get_parse_email.yml +0 -0
  71. data/spec/cassettes/client/_modules/_parse_email/should_set_parse_email.yml +0 -0
  72. data/spec/cassettes/client/_modules/_profile/should_get_profile.yml +0 -0
  73. data/spec/cassettes/client/_modules/_profile/should_set_first_name.yml +0 -0
  74. data/spec/cassettes/client/_modules/_spam/should_get_spam_emails.yml +1 -1
  75. data/spec/cassettes/client/_modules/_spam/should_try_delete_not_existing_spam_emails.yml +2 -2
  76. data/spec/cassettes/client/_modules/_unsubscribe/should_add_unsubscribe_emails.yml +2 -2
  77. data/spec/cassettes/client/_modules/_unsubscribe/should_delete_unsubscribe_email.yml +2 -2
  78. data/spec/cassettes/client/_modules/_unsubscribe/should_get_unsubscribe_emails.yml +1 -1
  79. data/spec/cassettes/client/_modules/_unsubscribe/should_try_delete_not_existing_unsubscribe_emails.yml +3 -3
  80. data/spec/cassettes/helper/_create_sub_user_account/should_create_sub_user_account.yml +0 -0
  81. data/spec/cassettes/helper/_run_sendgrid_query/should_raise_with_unsucessfull_request.yml +0 -0
  82. data/spec/cassettes/helper/_run_sendgrid_query/should_run_sendgrid_request.yml +0 -0
  83. data/spec/cassettes/sub_user/_apps/should_activate_app.yml +0 -0
  84. data/spec/cassettes/sub_user/_apps/should_deactivate_app.yml +0 -0
  85. data/spec/cassettes/sub_user/_apps/should_get_current_setting_from_one_app.yml +0 -0
  86. data/spec/cassettes/sub_user/_apps/should_return_available_apps.yml +0 -0
  87. data/spec/cassettes/sub_user/_apps/should_set_current_app.yml +0 -0
  88. data/spec/cassettes/sub_user/_authentication/should_auth_a_sub_user.yml +0 -0
  89. data/spec/cassettes/sub_user/_authentication/should_return_error_with_a_bad_sub_user.yml +0 -0
  90. data/spec/cassettes/sub_user/_bounces/should_returns_bounce_emails.yml +0 -0
  91. data/spec/cassettes/sub_user/_bounces/should_tries_to_delete_unexisting_bounce_emails.yml +0 -0
  92. data/spec/cassettes/sub_user/_event_notification/should_add_event_notification_url.yml +0 -0
  93. data/spec/cassettes/sub_user/_event_notification/should_delete_event_notification_url.yml +0 -0
  94. data/spec/cassettes/sub_user/_event_notification/should_get_event_notification_url.yml +0 -0
  95. data/spec/cassettes/sub_user/_invalid_emails/should_return_invalid_emails.yml +0 -0
  96. data/spec/cassettes/sub_user/_invalid_emails/should_tries_to_delete_unexisting_invalid_mail.yml +0 -0
  97. data/spec/cassettes/sub_user/_ip_management/should_return_all_ips_available.yml +0 -0
  98. data/spec/cassettes/sub_user/_ip_management/should_show_ip_subuser.yml +0 -0
  99. data/spec/cassettes/sub_user/_limits/should_decrements_credits_for_a_sub_user.yml +0 -0
  100. data/spec/cassettes/sub_user/_limits/should_delete_all_limits_for_a_sub_user.yml +0 -0
  101. data/spec/cassettes/sub_user/_limits/should_increments_credits_for_a_sub_user.yml +0 -0
  102. data/spec/cassettes/sub_user/_limits/should_list_the_limits_for_a_sub_user.yml +0 -0
  103. data/spec/cassettes/sub_user/_limits/should_reset_all_limits_for_a_sub_user.yml +0 -0
  104. data/spec/cassettes/sub_user/_limits/should_returns_limits_for_a_sub_user.yml +0 -0
  105. data/spec/cassettes/sub_user/_limits/should_set_total_credits.yml +0 -0
  106. data/spec/cassettes/sub_user/_management/should_add_new_subuser.yml +0 -0
  107. data/spec/cassettes/sub_user/_management/should_disable_sub_user_for_send_email.yml +0 -0
  108. data/spec/cassettes/sub_user/_management/should_enable_sub_user_for_access_to_website.yml +0 -0
  109. data/spec/cassettes/sub_user/_management/should_enable_sub_user_for_send_email.yml +0 -0
  110. data/spec/cassettes/sub_user/_management/should_update_sub_user.yml +0 -0
  111. data/spec/cassettes/sub_user/_monitor_records/should_add_existing_sub_user_to_monitor_record.yml +0 -0
  112. data/spec/cassettes/sub_user/_monitor_records/should_create_a_new_monitor_record.yml +0 -0
  113. data/spec/cassettes/sub_user/_monitor_records/should_delete_a_monitor_record.yml +0 -0
  114. data/spec/cassettes/sub_user/_monitor_records/should_edit_a_monitor_record.yml +0 -0
  115. data/spec/cassettes/sub_user/_monitor_records/should_remove_existing_sub_user_from_monitor_record.yml +0 -0
  116. data/spec/cassettes/sub_user/_parse_email/should_delete_parse_email.yml +0 -0
  117. data/spec/cassettes/sub_user/_parse_email/should_get_parse_email.yml +0 -0
  118. data/spec/cassettes/sub_user/_parse_email/should_set_parse_email.yml +0 -0
  119. data/spec/cassettes/sub_user/_spam/should_return_spam_mails.yml +0 -0
  120. data/spec/cassettes/sub_user/_spam/should_tries_to_delete_unexisting_spam_mail.yml +0 -0
  121. data/spec/cassettes/sub_user/_unsubscribes/should_add_bounce_email.yml +0 -0
  122. data/spec/cassettes/sub_user/_unsubscribes/should_delete_existing_bounce_email.yml +0 -0
  123. data/spec/cassettes/sub_user/_unsubscribes/should_delete_unexisting_bounce_email.yml +0 -0
  124. data/spec/cassettes/sub_user/_unsubscribes/should_returns_bounce_emails.yml +0 -0
  125. data/spec/client_spec.rb +68 -52
  126. data/spec/helper_spec.rb +2 -3
  127. data/spec/internal/config/database-standard.yml +24 -0
  128. data/spec/spec_helper.rb +0 -4
  129. data/spec/sub_user_spec.rb +0 -0
  130. data/test.rb +0 -0
  131. metadata +20 -81
  132. data/.circleci/config.yml +0 -132
  133. data/.circleci/setup-rubygems.sh +0 -5
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendgrid_webapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kylejginavan
8
8
  - chebyte
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-04-28 00:00:00.000000000 Z
12
+ date: 2023-07-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -123,13 +123,18 @@ executables: []
123
123
  extensions: []
124
124
  extra_rdoc_files: []
125
125
  files:
126
- - ".circleci/config.yml"
127
- - ".circleci/setup-rubygems.sh"
128
126
  - ".gitignore"
129
127
  - ".rspec"
130
128
  - ".ruby-version"
129
+ - ".tekton/Chart.lock"
130
+ - ".tekton/Chart.yaml"
131
+ - ".tekton/templates/pipelinerun.yaml"
132
+ - ".tekton/values-main.yaml"
133
+ - ".tekton/values-pr.yaml"
134
+ - ".tekton/values.yaml"
131
135
  - ".tool-versions"
132
136
  - Gemfile
137
+ - MIT-LICENSE
133
138
  - README.rdoc
134
139
  - Rakefile
135
140
  - lib/api_key/management.rb
@@ -175,12 +180,15 @@ files:
175
180
  - spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml
176
181
  - spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml
177
182
  - spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml
183
+ - spec/cassettes/client/_modules/_bounce/should_get_bounce_emails_using_params.yml
178
184
  - spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml
179
185
  - spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml
180
186
  - spec/cassettes/client/_modules/_event_notification/should_delete_event_notification_url.yml
181
187
  - spec/cassettes/client/_modules/_event_notification/should_get_event_notification_url.yml
182
188
  - spec/cassettes/client/_modules/_event_notification/should_set_event_notification_url.yml
183
189
  - spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml
190
+ - spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_emails_using_params.yml
191
+ - spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_using_params.yml
184
192
  - spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml
185
193
  - spec/cassettes/client/_modules/_parse_email/should_delete_parse_email.yml
186
194
  - spec/cassettes/client/_modules/_parse_email/should_get_parse_email.yml
@@ -240,13 +248,15 @@ files:
240
248
  - spec/cassettes/sub_user/_unsubscribes/should_returns_bounce_emails.yml
241
249
  - spec/client_spec.rb
242
250
  - spec/helper_spec.rb
251
+ - spec/internal/config/database-standard.yml
243
252
  - spec/spec_helper.rb
244
253
  - spec/sub_user_spec.rb
245
254
  - test.rb
246
255
  homepage: https://github.com/kylejginavan/sendgrid_webapi
247
- licenses: []
256
+ licenses:
257
+ - MIT
248
258
  metadata: {}
249
- post_install_message:
259
+ post_install_message:
250
260
  rdoc_options: []
251
261
  require_paths:
252
262
  - lib
@@ -261,79 +271,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
261
271
  - !ruby/object:Gem::Version
262
272
  version: '0'
263
273
  requirements: []
264
- rubygems_version: 3.2.3
265
- signing_key:
274
+ rubygems_version: 3.2.22
275
+ signing_key:
266
276
  specification_version: 4
267
277
  summary: SendGrid WEB API gem fo Rails
268
- test_files:
269
- - spec/cassettes/client/_modules/_block/should_get_block_emails.yml
270
- - spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml
271
- - spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml
272
- - spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml
273
- - spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml
274
- - spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml
275
- - spec/cassettes/client/_modules/_event_notification/should_delete_event_notification_url.yml
276
- - spec/cassettes/client/_modules/_event_notification/should_get_event_notification_url.yml
277
- - spec/cassettes/client/_modules/_event_notification/should_set_event_notification_url.yml
278
- - spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml
279
- - spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml
280
- - spec/cassettes/client/_modules/_parse_email/should_delete_parse_email.yml
281
- - spec/cassettes/client/_modules/_parse_email/should_get_parse_email.yml
282
- - spec/cassettes/client/_modules/_parse_email/should_set_parse_email.yml
283
- - spec/cassettes/client/_modules/_profile/should_get_profile.yml
284
- - spec/cassettes/client/_modules/_profile/should_set_first_name.yml
285
- - spec/cassettes/client/_modules/_spam/should_get_spam_emails.yml
286
- - spec/cassettes/client/_modules/_spam/should_try_delete_not_existing_spam_emails.yml
287
- - spec/cassettes/client/_modules/_unsubscribe/should_add_unsubscribe_emails.yml
288
- - spec/cassettes/client/_modules/_unsubscribe/should_delete_unsubscribe_email.yml
289
- - spec/cassettes/client/_modules/_unsubscribe/should_get_unsubscribe_emails.yml
290
- - spec/cassettes/client/_modules/_unsubscribe/should_try_delete_not_existing_unsubscribe_emails.yml
291
- - spec/cassettes/helper/_create_sub_user_account/should_create_sub_user_account.yml
292
- - spec/cassettes/helper/_run_sendgrid_query/should_raise_with_unsucessfull_request.yml
293
- - spec/cassettes/helper/_run_sendgrid_query/should_run_sendgrid_request.yml
294
- - spec/cassettes/sub_user/_apps/should_activate_app.yml
295
- - spec/cassettes/sub_user/_apps/should_deactivate_app.yml
296
- - spec/cassettes/sub_user/_apps/should_get_current_setting_from_one_app.yml
297
- - spec/cassettes/sub_user/_apps/should_return_available_apps.yml
298
- - spec/cassettes/sub_user/_apps/should_set_current_app.yml
299
- - spec/cassettes/sub_user/_authentication/should_auth_a_sub_user.yml
300
- - spec/cassettes/sub_user/_authentication/should_return_error_with_a_bad_sub_user.yml
301
- - spec/cassettes/sub_user/_bounces/should_returns_bounce_emails.yml
302
- - spec/cassettes/sub_user/_bounces/should_tries_to_delete_unexisting_bounce_emails.yml
303
- - spec/cassettes/sub_user/_event_notification/should_add_event_notification_url.yml
304
- - spec/cassettes/sub_user/_event_notification/should_delete_event_notification_url.yml
305
- - spec/cassettes/sub_user/_event_notification/should_get_event_notification_url.yml
306
- - spec/cassettes/sub_user/_invalid_emails/should_return_invalid_emails.yml
307
- - spec/cassettes/sub_user/_invalid_emails/should_tries_to_delete_unexisting_invalid_mail.yml
308
- - spec/cassettes/sub_user/_ip_management/should_return_all_ips_available.yml
309
- - spec/cassettes/sub_user/_ip_management/should_show_ip_subuser.yml
310
- - spec/cassettes/sub_user/_limits/should_decrements_credits_for_a_sub_user.yml
311
- - spec/cassettes/sub_user/_limits/should_delete_all_limits_for_a_sub_user.yml
312
- - spec/cassettes/sub_user/_limits/should_increments_credits_for_a_sub_user.yml
313
- - spec/cassettes/sub_user/_limits/should_list_the_limits_for_a_sub_user.yml
314
- - spec/cassettes/sub_user/_limits/should_reset_all_limits_for_a_sub_user.yml
315
- - spec/cassettes/sub_user/_limits/should_returns_limits_for_a_sub_user.yml
316
- - spec/cassettes/sub_user/_limits/should_set_total_credits.yml
317
- - spec/cassettes/sub_user/_management/should_add_new_subuser.yml
318
- - spec/cassettes/sub_user/_management/should_disable_sub_user_for_send_email.yml
319
- - spec/cassettes/sub_user/_management/should_enable_sub_user_for_access_to_website.yml
320
- - spec/cassettes/sub_user/_management/should_enable_sub_user_for_send_email.yml
321
- - spec/cassettes/sub_user/_management/should_update_sub_user.yml
322
- - spec/cassettes/sub_user/_monitor_records/should_add_existing_sub_user_to_monitor_record.yml
323
- - spec/cassettes/sub_user/_monitor_records/should_create_a_new_monitor_record.yml
324
- - spec/cassettes/sub_user/_monitor_records/should_delete_a_monitor_record.yml
325
- - spec/cassettes/sub_user/_monitor_records/should_edit_a_monitor_record.yml
326
- - spec/cassettes/sub_user/_monitor_records/should_remove_existing_sub_user_from_monitor_record.yml
327
- - spec/cassettes/sub_user/_parse_email/should_delete_parse_email.yml
328
- - spec/cassettes/sub_user/_parse_email/should_get_parse_email.yml
329
- - spec/cassettes/sub_user/_parse_email/should_set_parse_email.yml
330
- - spec/cassettes/sub_user/_spam/should_return_spam_mails.yml
331
- - spec/cassettes/sub_user/_spam/should_tries_to_delete_unexisting_spam_mail.yml
332
- - spec/cassettes/sub_user/_unsubscribes/should_add_bounce_email.yml
333
- - spec/cassettes/sub_user/_unsubscribes/should_delete_existing_bounce_email.yml
334
- - spec/cassettes/sub_user/_unsubscribes/should_delete_unexisting_bounce_email.yml
335
- - spec/cassettes/sub_user/_unsubscribes/should_returns_bounce_emails.yml
336
- - spec/client_spec.rb
337
- - spec/helper_spec.rb
338
- - spec/spec_helper.rb
339
- - spec/sub_user_spec.rb
278
+ test_files: []
data/.circleci/config.yml DELETED
@@ -1,132 +0,0 @@
1
- # Ruby CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
- #
5
- defaults: &defaults
6
- working_directory: ~/repo
7
- docker:
8
- - image: circleci/ruby:2.3.6-stretch-node
9
- environment:
10
- # - DBHOST: localhost
11
- # - DBNAME: sendgrid_webapi_test
12
- # - DBPASSWORD: Vdm9omJt8Z3MCV4N
13
- # - DBUSER: test_user
14
- - RACK_ENV: test
15
- - RAILS_ENV: test
16
- # - image: circleci/postgres:10.3-alpine-ram
17
- # environment:
18
- # - POSTGRES_DB: sendgrid_webapi_test
19
- # - POSTGRES_USER: test_user
20
- # - POSTGRES_PASSWORD: Vdm9omJt8Z3MCV4N
21
-
22
- version: 2
23
- jobs:
24
- run_specs:
25
- <<: *defaults
26
-
27
- steps:
28
- - run:
29
- name: Set up environment
30
- command: |
31
- sudo apt-get update && sudo apt-get install -y apt-transport-https apt-utils
32
-
33
- - checkout
34
-
35
- - restore_cache:
36
- keys:
37
- - sendgrid_webapi-dependencies-v1-{{ checksum "sendgrid_webapi.gemspec" }}
38
- - sendgrid_webapi-dependencies-v1-
39
-
40
- - run:
41
- name: Install dependencies
42
- command: |
43
- # curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
44
- # echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
45
- # sudo apt-get update && sudo apt-get install postgresql-client-10
46
- bundle check --path=./vendor/bundle || bundle install --path=./vendor/bundle --jobs=4 --retry=3
47
-
48
- - save_cache:
49
- key: sendgrid_webapi-dependencies-v1-{{ checksum "sendgrid_webapi.gemspec" }}
50
- paths:
51
- - ./vendor/bundle
52
-
53
- # - run:
54
- # name: Set up database
55
- # command: |
56
- # cp spec/internal/config/database.docker.yml spec/internal/config/database.yml
57
-
58
- - run:
59
- name: Run tests
60
- command: |
61
- mkdir /tmp/test-results
62
- TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
63
- bundle exec rspec --format progress --format RspecJunitFormatter --out /tmp/test-results/rspec.xml $TEST_FILES
64
-
65
- - store_test_results:
66
- path: /tmp/test-results
67
-
68
- - store_artifacts:
69
- path: /tmp/test-results
70
- destination: test-results
71
-
72
- build_gem:
73
- <<: *defaults
74
-
75
- steps:
76
- - run:
77
- name: Set up environment
78
- command: |
79
- sudo apt-get update && sudo apt-get install -y apt-transport-https apt-utils
80
-
81
- - checkout
82
-
83
- - restore_cache:
84
- keys:
85
- - sendgrid_webapi-dependencies-v1-{{ checksum "sendgrid_webapi.gemspec" }}
86
- - sendgrid_webapi-dependencies-v1-
87
-
88
- - run:
89
- name: Install dependencies
90
- command: |
91
- gem install gemfury
92
- bundle check --path=./vendor/bundle || bundle install --path=./vendor/bundle --jobs=4 --retry=3
93
-
94
- - save_cache:
95
- key: sendgrid_webapi-dependencies-v1-{{ checksum "sendgrid_webapi.gemspec" }}
96
- paths:
97
- - ./vendor/bundle
98
-
99
- - run:
100
- name: Build gem
101
- command: |
102
- gem build sendgrid_webapi.gemspec
103
-
104
- - run:
105
- name: Push gem
106
- command: |
107
- if [[ "${CIRCLE_PROJECT_USERNAME}" == "OneHQ" && "${CIRCLE_BRANCH}" == "master" && -n "${RUBYGEMS_API_KEY}" ]]; then
108
- bash .circleci/setup-rubygems.sh
109
- version=$(ruby -e 'load "lib/version.rb"; puts SendGridWebApi::VERSION')
110
- grep -q "${version}" <(gem search sendgrid_api) || EXIT_CODE=$? && true
111
- if [[ $EXIT_CODE == 1 ]]; then
112
- gem push sendgrid_webapi-${version}.gem
113
- git tag ${version}
114
- git push --tags
115
-
116
- [[ -n "$SLACK_TOKEN" ]] && curl -s -d "sendgrid_webapi ($version) released." "https://onehq.slack.com/services/hooks/slackbot?token=${SLACK_TOKEN}&channel=%23machines"
117
- fi
118
- fi
119
-
120
- workflows:
121
- version: 2
122
- build-deploy:
123
- jobs:
124
- - run_specs
125
- - build_gem:
126
- requires:
127
- - run_specs
128
- filters:
129
- branches:
130
- only:
131
- - master
132
- - staging
@@ -1,5 +0,0 @@
1
- #!/bin/sh
2
-
3
- mkdir -p ~/.gem
4
- echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
5
- chmod 0600 /home/circleci/.gem/credentials