dpl 2.0.3.beta.4 → 2.0.3.beta.5

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/Gemfile +15 -3
  3. data/Gemfile.lock +444 -211
  4. data/Rakefile +36 -34
  5. data/bin/dpl +3 -1
  6. data/dpl.gemspec +25 -0
  7. data/lib/dpl/cli.rb +19 -14
  8. data/lib/dpl/ctx/bash.rb +18 -12
  9. data/lib/dpl/ctx/test.rb +21 -15
  10. data/lib/dpl/ctx.rb +2 -0
  11. data/lib/dpl/helper/assets.rb +4 -2
  12. data/lib/dpl/helper/cmd.rb +20 -18
  13. data/lib/dpl/helper/config_file.rb +5 -3
  14. data/lib/dpl/helper/cookbook_site_streaming_uploader.rb +249 -0
  15. data/lib/dpl/helper/env.rb +26 -22
  16. data/lib/dpl/helper/github.rb +2 -0
  17. data/lib/dpl/helper/interpolate.rb +8 -4
  18. data/lib/dpl/helper/memoize.rb +4 -1
  19. data/lib/dpl/helper/squiggle.rb +3 -1
  20. data/lib/dpl/helper/transliterate.rb +3 -1
  21. data/lib/dpl/helper/wrap.rb +3 -1
  22. data/lib/dpl/helper/zip.rb +3 -1
  23. data/lib/dpl/provider/dsl.rb +18 -4
  24. data/lib/dpl/provider/examples.rb +6 -2
  25. data/lib/dpl/provider/status.rb +26 -24
  26. data/lib/dpl/providers/anynines.rb +22 -20
  27. data/lib/dpl/providers/azure_web_apps.rb +21 -19
  28. data/lib/dpl/providers/bintray.rb +44 -37
  29. data/lib/dpl/providers/bluemixcloudfoundry.rb +38 -36
  30. data/lib/dpl/providers/boxfuse.rb +12 -10
  31. data/lib/dpl/providers/cargo.rb +7 -5
  32. data/lib/dpl/providers/chef_supermarket.rb +82 -80
  33. data/lib/dpl/providers/cloud66.rb +17 -15
  34. data/lib/dpl/providers/cloudfiles.rb +8 -6
  35. data/lib/dpl/providers/cloudformation.rb +191 -187
  36. data/lib/dpl/providers/cloudfoundry.rb +32 -30
  37. data/lib/dpl/providers/codedeploy.rb +35 -33
  38. data/lib/dpl/providers/convox.rb +32 -25
  39. data/lib/dpl/providers/datica.rb +30 -28
  40. data/lib/dpl/providers/ecr.rb +66 -64
  41. data/lib/dpl/providers/elasticbeanstalk.rb +14 -12
  42. data/lib/dpl/providers/engineyard.rb +60 -58
  43. data/lib/dpl/providers/firebase.rb +6 -4
  44. data/lib/dpl/providers/flynn.rb +8 -6
  45. data/lib/dpl/providers/gae.rb +28 -25
  46. data/lib/dpl/providers/gcs.rb +59 -57
  47. data/lib/dpl/providers/git_push.rb +199 -195
  48. data/lib/dpl/providers/gleis.rb +19 -17
  49. data/lib/dpl/providers/hackage.rb +15 -13
  50. data/lib/dpl/providers/hephy.rb +18 -16
  51. data/lib/dpl/providers/heroku/api.rb +72 -70
  52. data/lib/dpl/providers/heroku/git.rb +15 -13
  53. data/lib/dpl/providers/heroku.rb +40 -38
  54. data/lib/dpl/providers/lambda.rb +134 -134
  55. data/lib/dpl/providers/launchpad.rb +45 -43
  56. data/lib/dpl/providers/netlify.rb +7 -5
  57. data/lib/dpl/providers/npm.rb +61 -58
  58. data/lib/dpl/providers/nuget.rb +8 -6
  59. data/lib/dpl/providers/openshift.rb +8 -6
  60. data/lib/dpl/providers/opsworks.rb +23 -21
  61. data/lib/dpl/providers/pages/api.rb +14 -14
  62. data/lib/dpl/providers/pages/git.rb +53 -47
  63. data/lib/dpl/providers/pages.rb +3 -1
  64. data/lib/dpl/providers/puppetforge.rb +6 -4
  65. data/lib/dpl/providers/pypi.rb +55 -54
  66. data/lib/dpl/providers/releases.rb +30 -23
  67. data/lib/dpl/providers/rubygems.rb +35 -31
  68. data/lib/dpl/providers/s3.rb +148 -142
  69. data/lib/dpl/providers/scalingo.rb +18 -16
  70. data/lib/dpl/providers/script.rb +4 -2
  71. data/lib/dpl/providers/snap.rb +12 -9
  72. data/lib/dpl/providers/surge.rb +7 -5
  73. data/lib/dpl/providers/testfairy.rb +47 -43
  74. data/lib/dpl/providers/transifex.rb +20 -18
  75. data/lib/dpl/providers.rb +3 -1
  76. data/lib/dpl/string_ext.rb +3 -1
  77. data/lib/dpl/support/aws_sdk_patch.rb +4 -1
  78. data/lib/dpl/support/gems.rb +7 -3
  79. data/lib/dpl/support/gstore_patch.rb +3 -1
  80. data/lib/dpl/support/version.rb +13 -12
  81. data/lib/dpl/version.rb +3 -1
  82. data/lib/dpl.rb +2 -0
  83. data/status.json +237 -0
  84. metadata +32 -15
  85. /data/lib/dpl/providers/{packagecloud.rb → packagecloud.rb_} +0 -0
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dpl
2
4
  module Providers
3
5
  class GitPush < Provider
@@ -7,25 +9,25 @@ module Dpl
7
9
 
8
10
  full_name 'Git (push)'
9
11
 
10
- description sq(<<-str)
12
+ description sq(<<-STR)
11
13
  Experimental, generic provider for updating a Git remote branch with
12
14
  changes produced by the build, and optionally opening a pull request.
13
- str
15
+ STR
14
16
 
15
- gem 'octokit', '~> 4.15.0'
16
- gem 'public_suffix', '~> 3.0.3'
17
+ gem 'octokit', '~> 7'
18
+ gem 'public_suffix', '~> 5'
17
19
 
18
20
  env :github, :git
19
21
 
20
- required :token, [:deploy_key, :name, :email]
22
+ required :token, %i[deploy_key name email]
21
23
 
22
24
  opt '--repo SLUG', 'Repo slug', default: :repo_slug
23
25
  opt '--token TOKEN', 'GitHub token with repo permission', secret: true, alias: :github_token
24
26
  opt '--deploy_key PATH', 'Path to a file containing a private deploy key with write access to the repository', see: 'https://developer.github.com/v3/guides/managing-deploy-keys/#deploy-keys'
25
27
  opt '--branch BRANCH', 'Target branch to push to', required: true
26
28
  opt '--base_branch BRANCH', 'Base branch to branch off initially, and (optionally) create a pull request for', default: 'master'
27
- opt '--name NAME', 'Committer name', note: 'defaults to the GitHub name or login associated with the GitHub token' #, default: :user_name
28
- opt '--email EMAIL', 'Committer email', note: 'defaults to the GitHub email associated with the GitHub token' #, default: :user_email
29
+ opt '--name NAME', 'Committer name', note: 'defaults to the GitHub name or login associated with the GitHub token' # , default: :user_name
30
+ opt '--email EMAIL', 'Committer email', note: 'defaults to the GitHub email associated with the GitHub token' # , default: :user_email
29
31
  opt '--commit_message MSG', default: 'Update %{base_branch}', interpolate: true
30
32
  opt '--allow_empty_commit', 'Allow an empty commit to be created'
31
33
  opt '--force', 'Whether to push --force', default: false
@@ -37,38 +39,38 @@ module Dpl
37
39
 
38
40
  needs :git
39
41
 
40
- msgs login: 'Authenticated as %s',
41
- invalid_token: 'The provided GitHub token is invalid (error: %s)',
42
+ msgs login: 'Authenticated as %s',
43
+ invalid_token: 'The provided GitHub token is invalid (error: %s)',
42
44
  insufficient_scopes: 'Dpl does not have permission to access %{url} using the provided GitHub token. Please make sure the token have the repo or public_repo scope.',
43
- same_branch: 'Prevented from pushing to the same branch as the current build branch %{git_branch}. This is meant to prevent infinite build loops. If you do need to push back to the same branch enable `allow_same_branch` and take precautions to prevent infinite loops as needed, for example using conditional builds.',
44
- setup_deploy_key: 'Moving deploy key %{deploy_key} to %{path}',
45
- check_deploy_key: 'Checking deploy key',
46
- setup: 'Source dir: %{src_dir}, branch: %{branch}, base branch: %{base_branch}',
47
- git_clone: 'Cloning the branch %{branch} to %{work_dir}',
48
- git_branch: 'Switching to branch %{branch}',
49
- copy_files: 'Copying %{src_dir} contents to %{work_dir}',
50
- git_config: 'Configuring git committer to be: %{name} <%{email}>',
51
- git_push: 'Pushing to %{url} HEAD:%{branch}',
52
- pr_exists: 'Pull request exists.',
53
- pr_created: 'Pull request #%{number} created.',
54
- stop: 'There are no changes to commit, stopping.'
55
-
56
- cmds git_clone: 'git clone --quiet --branch="%{clone_branch}" "%{remote_url}" . > /dev/null 2>&1',
57
- git_branch: 'git checkout -b "%{branch}"',
58
- check_deploy_key: 'ssh -i %{key} -T git@github.com 2>&1 | grep successful > /dev/null',
59
- copy_files: 'rsync -rl --exclude .git --delete "%{src_dir}/" .',
60
- git_config_email: 'git config user.email %{quoted_email}',
61
- git_config_name: 'git config user.name %{quoted_name}',
62
- git_add: 'git add -A .',
63
- git_commit_hook: 'cp %{path} .git/hooks/pre-commit',
64
- git_commit: 'git commit %{git_commit_opts} -q %{git_commit_msg_opts}',
65
- git_show: 'git show --stat-count=10 HEAD',
66
- git_push: 'git push %{git_push_opts} --quiet "%{remote_url}" HEAD:"%{branch}" > /dev/null 2>&1'
67
-
68
- errs copy_files: 'Failed to copy %{src_dir}.',
69
- check_deploy_key: 'Failed to authenticate using the deploy key',
70
- git_init: 'Failed to create new git repo',
71
- git_push: 'Failed to push the build to %{url}:%{branch}'
45
+ same_branch: 'Prevented from pushing to the same branch as the current build branch %{git_branch}. This is meant to prevent infinite build loops. If you do need to push back to the same branch enable `allow_same_branch` and take precautions to prevent infinite loops as needed, for example using conditional builds.',
46
+ setup_deploy_key: 'Moving deploy key %{deploy_key} to %{path}',
47
+ check_deploy_key: 'Checking deploy key',
48
+ setup: 'Source dir: %{src_dir}, branch: %{branch}, base branch: %{base_branch}',
49
+ git_clone: 'Cloning the branch %{branch} to %{work_dir}',
50
+ git_branch: 'Switching to branch %{branch}',
51
+ copy_files: 'Copying %{src_dir} contents to %{work_dir}',
52
+ git_config: 'Configuring git committer to be: %{name} <%{email}>',
53
+ git_push: 'Pushing to %{url} HEAD:%{branch}',
54
+ pr_exists: 'Pull request exists.',
55
+ pr_created: 'Pull request #%{number} created.',
56
+ stop: 'There are no changes to commit, stopping.'
57
+
58
+ cmds git_clone: 'git clone --quiet --branch="%{clone_branch}" "%{remote_url}" . > /dev/null 2>&1',
59
+ git_branch: 'git checkout -b "%{branch}"',
60
+ check_deploy_key: 'ssh -i %{key} -T git@github.com 2>&1 | grep successful > /dev/null',
61
+ copy_files: 'rsync -rl --exclude .git --delete "%{src_dir}/" .',
62
+ git_config_email: 'git config user.email %{quoted_email}',
63
+ git_config_name: 'git config user.name %{quoted_name}',
64
+ git_add: 'git add -A .',
65
+ git_commit_hook: 'cp %{path} .git/hooks/pre-commit',
66
+ git_commit: 'git commit %{git_commit_opts} -q %{git_commit_msg_opts}',
67
+ git_show: 'git show --stat-count=10 HEAD',
68
+ git_push: 'git push %{git_push_opts} --quiet "%{remote_url}" HEAD:"%{branch}" > /dev/null 2>&1'
69
+
70
+ errs copy_files: 'Failed to copy %{src_dir}.',
71
+ check_deploy_key: 'Failed to authenticate using the deploy key',
72
+ git_init: 'Failed to create new git repo',
73
+ git_push: 'Failed to push the build to %{url}:%{branch}'
72
74
 
73
75
  def validate
74
76
  error :same_branch if same_branch? && !allow_same_branch?
@@ -91,6 +93,7 @@ module Dpl
91
93
  git_clone
92
94
  copy_files
93
95
  return info :stop unless git_dirty?
96
+
94
97
  push
95
98
  pull_request if pull_request?
96
99
  end
@@ -107,163 +110,164 @@ module Dpl
107
110
 
108
111
  private
109
112
 
110
- def same_branch?
111
- git_branch == branch
112
- end
113
-
114
- def login_token
115
- return unless github?
116
- info :login, user.login
117
- error :insufficient_scopes unless sufficient_scopes?
118
- rescue Octokit::Unauthorized => e
119
- error :invalid_token, e.message
120
- end
121
-
122
- def setup_deploy_key
123
- path = '~/.dpl/deploy_key'
124
- info :setup_deploy_key, path: path
125
- mv deploy_key, path
126
- chmod 0600, path
127
- setup_git_ssh path
128
- shell :check_deploy_key, key: path
129
- end
130
-
131
- def git_clone
132
- shell :git_clone, echo: false
133
- shell :git_branch unless branch_exists?
134
- end
135
-
136
- def clone_branch
137
- branch_exists? ? branch : base_branch
138
- end
139
-
140
- def copy_files
141
- shell :copy_files
142
- end
143
-
144
- def git_config
145
- shell :git_config_name, echo: false
146
- shell :git_config_email, echo: false
147
- end
148
-
149
- def branch_exists?
150
- git_ls_remote?(remote_url, branch)
151
- end
152
-
153
- def git_commit
154
- shell :git_commit_hook, path: asset(:git, :detect_private_key).path, echo: false if deploy_key?
155
- shell :git_add
156
- shell :git_commit
157
- shell :git_show
158
- end
159
-
160
- def git_push
161
- shell :git_push, echo: false
162
- end
163
-
164
- def git_push_opts
165
- '--force' if force?
166
- end
167
-
168
- def git_commit_opts
169
- ' --allow-empty' if allow_empty_commit?
170
- end
171
-
172
- def git_commit_msg_opts
173
- msg = interpolate(commit_message, vars: vars)
174
- msg.split("\n").reject(&:empty?).map { |msg| %(-m #{quote(msg)}) }
175
- end
176
-
177
- def name
178
- str = super if name?
179
- str ||= user_name
180
- str = "#{str} (via Travis CI)" if ENV['TRAVIS'] && !name?
181
- str
182
- end
183
- memoize :name
184
-
185
- def email
186
- str = super if email?
187
- str || user_email
188
- end
189
- memoize :email
190
-
191
- def project_name
192
- super || repo_slug
193
- end
194
-
195
- def remote_url
196
- token? ? https_url_with_token : git_url
197
- end
198
-
199
- def https_url_with_token
200
- "https://#{token}@#{url}"
201
- end
202
-
203
- def git_url
204
- "git@#{host}:#{slug}.git"
205
- end
206
-
207
- def url
208
- "#{host}/#{slug}.git"
209
- end
210
-
211
- def slug
212
- repo || repo_slug
213
- end
214
-
215
- def src_dir
216
- @src_dir ||= expand(local_dir)
217
- end
218
-
219
- def work_dir
220
- @work_dir ||= tmp_dir
221
- end
222
-
223
- def sufficient_scopes?
224
- scopes.include?('public_repo') || scopes.include?('repo')
225
- end
226
-
227
- def user
228
- @user ||= github.user
229
- end
230
-
231
- def user_name
232
- user.name || user.login
233
- end
234
-
235
- def user_email
236
- user.email
237
- end
238
-
239
- def scopes
240
- @scopes ||= github.scopes
241
- end
242
-
243
- def pr_exists?
244
- !!github.pulls(repo).detect { |pull| pull.head.ref == branch }
245
- end
246
-
247
- def create_pr
248
- pr = github.create_pull_request(repo, base_branch, branch, "Update #{base_branch}")
249
- info :pr_created, number: pr.number
250
- end
251
-
252
- def github?
253
- host.include?('github') || enterprise?
254
- end
255
-
256
- def github
257
- @github ||= Octokit::Client.new(access_token: token, api_endpoint: api_url, auto_paginate: true)
258
- end
259
-
260
- def api_url
261
- enterprise? ? "https://#{host}/api/v3/" : 'https://api.github.com/'
262
- end
263
-
264
- def now
265
- Time.now
266
- end
113
+ def same_branch?
114
+ git_branch == branch
115
+ end
116
+
117
+ def login_token
118
+ return unless github?
119
+
120
+ info :login, user.login
121
+ error :insufficient_scopes unless sufficient_scopes?
122
+ rescue Octokit::Unauthorized => e
123
+ error :invalid_token, e.message
124
+ end
125
+
126
+ def setup_deploy_key
127
+ path = '~/.dpl/deploy_key'
128
+ info(:setup_deploy_key, path:)
129
+ mv deploy_key, path
130
+ chmod 0600, path
131
+ setup_git_ssh path
132
+ shell :check_deploy_key, key: path
133
+ end
134
+
135
+ def git_clone
136
+ shell :git_clone, echo: false
137
+ shell :git_branch unless branch_exists?
138
+ end
139
+
140
+ def clone_branch
141
+ branch_exists? ? branch : base_branch
142
+ end
143
+
144
+ def copy_files
145
+ shell :copy_files
146
+ end
147
+
148
+ def git_config
149
+ shell :git_config_name, echo: false
150
+ shell :git_config_email, echo: false
151
+ end
152
+
153
+ def branch_exists?
154
+ git_ls_remote?(remote_url, branch)
155
+ end
156
+
157
+ def git_commit
158
+ shell :git_commit_hook, path: asset(:git, :detect_private_key).path, echo: false if deploy_key?
159
+ shell :git_add
160
+ shell :git_commit
161
+ shell :git_show
162
+ end
163
+
164
+ def git_push
165
+ shell :git_push, echo: false
166
+ end
167
+
168
+ def git_push_opts
169
+ '--force' if force?
170
+ end
171
+
172
+ def git_commit_opts
173
+ ' --allow-empty' if allow_empty_commit?
174
+ end
175
+
176
+ def git_commit_msg_opts
177
+ msg = interpolate(commit_message, vars:)
178
+ msg.split("\n").reject(&:empty?).map { |message| %(-m #{quote(message)}) }
179
+ end
180
+
181
+ def name
182
+ str = super if name?
183
+ str ||= user_name
184
+ str = "#{str} (via Travis CI)" if ENV['TRAVIS'] && !name?
185
+ str
186
+ end
187
+ memoize :name
188
+
189
+ def email
190
+ str = super if email?
191
+ str || user_email
192
+ end
193
+ memoize :email
194
+
195
+ def project_name
196
+ super || repo_slug
197
+ end
198
+
199
+ def remote_url
200
+ token? ? https_url_with_token : git_url
201
+ end
202
+
203
+ def https_url_with_token
204
+ "https://#{token}@#{url}"
205
+ end
206
+
207
+ def git_url
208
+ "git@#{host}:#{slug}.git"
209
+ end
210
+
211
+ def url
212
+ "#{host}/#{slug}.git"
213
+ end
214
+
215
+ def slug
216
+ repo || repo_slug
217
+ end
218
+
219
+ def src_dir
220
+ @src_dir ||= expand(local_dir)
221
+ end
222
+
223
+ def work_dir
224
+ @work_dir ||= tmp_dir
225
+ end
226
+
227
+ def sufficient_scopes?
228
+ scopes.include?('public_repo') || scopes.include?('repo')
229
+ end
230
+
231
+ def user
232
+ @user ||= github.user
233
+ end
234
+
235
+ def user_name
236
+ user.name || user.login
237
+ end
238
+
239
+ def user_email
240
+ user.email
241
+ end
242
+
243
+ def scopes
244
+ @scopes ||= github.scopes
245
+ end
246
+
247
+ def pr_exists?
248
+ !!github.pulls(repo).detect { |pull| pull.head.ref == branch }
249
+ end
250
+
251
+ def create_pr
252
+ pr = github.create_pull_request(repo, base_branch, branch, "Update #{base_branch}")
253
+ info :pr_created, number: pr.number
254
+ end
255
+
256
+ def github?
257
+ host.include?('github') || enterprise?
258
+ end
259
+
260
+ def github
261
+ @github ||= Octokit::Client.new(access_token: token, api_endpoint: api_url, auto_paginate: true)
262
+ end
263
+
264
+ def api_url
265
+ enterprise? ? "https://#{host}/api/v3/" : 'https://api.github.com/'
266
+ end
267
+
268
+ def now
269
+ Time.now
270
+ end
267
271
  end
268
272
  end
269
273
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dpl
2
4
  module Providers
3
5
  class Gleis < Provider
@@ -5,9 +7,9 @@ module Dpl
5
7
 
6
8
  status :alpha
7
9
 
8
- description sq(<<-str)
10
+ description sq(<<-STR)
9
11
  tbd
10
- str
12
+ STR
11
13
 
12
14
  gem 'gleis', '~> 0.8.0'
13
15
 
@@ -21,20 +23,20 @@ module Dpl
21
23
 
22
24
  needs :ssh_key
23
25
 
24
- cmds login: 'gleis auth login %{username} %{password} --skip-keygen',
25
- logout: 'gleis auth logout',
26
- validate: 'gleis app status -a %{app}',
27
- add_key: 'gleis auth key add %{file} %{key_name}',
26
+ cmds login: 'gleis auth login %{username} %{password} --skip-keygen',
27
+ logout: 'gleis auth logout',
28
+ validate: 'gleis app status -a %{app}',
29
+ add_key: 'gleis auth key add %{file} %{key_name}',
28
30
  remove_key: 'gleis auth key remove %{key_name}',
29
- git_url: 'gleis app git -a %{app} -q',
30
- deploy: 'git push %{push_opts} -f %{git_url} HEAD:refs/heads/master'
31
+ git_url: 'gleis app git -a %{app} -q',
32
+ deploy: 'git push %{push_opts} -f %{git_url} HEAD:refs/heads/master'
31
33
 
32
- errs login: 'Login failed',
33
- validate: 'Application not found',
34
- add_key: 'Adding SSH key failed',
34
+ errs login: 'Login failed',
35
+ validate: 'Application not found',
36
+ add_key: 'Adding SSH key failed',
35
37
  remove_key: 'Removing key failed',
36
- git_url: 'Failed to retrieve Git URL',
37
- deploy: 'Deploying application failed'
38
+ git_url: 'Failed to retrieve Git URL',
39
+ deploy: 'Deploying application failed'
38
40
 
39
41
  attr_reader :git_url
40
42
 
@@ -51,7 +53,7 @@ module Dpl
51
53
  end
52
54
 
53
55
  def add_key(file)
54
- shell :add_key, file: file
56
+ shell :add_key, file:
55
57
  end
56
58
 
57
59
  def deploy
@@ -64,9 +66,9 @@ module Dpl
64
66
 
65
67
  private
66
68
 
67
- def push_opts
68
- '-v' if verbose?
69
- end
69
+ def push_opts
70
+ '-v' if verbose?
71
+ end
70
72
  end
71
73
  end
72
74
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dpl
2
4
  module Providers
3
5
  class Hackage < Provider
@@ -5,9 +7,9 @@ module Dpl
5
7
 
6
8
  status :alpha
7
9
 
8
- description sq(<<-str)
10
+ description sq(<<-STR)
9
11
  tbd
10
- str
12
+ STR
11
13
 
12
14
  env :hackage
13
15
 
@@ -15,12 +17,12 @@ module Dpl
15
17
  opt '--password USER', 'Hackage password', required: true, secret: true
16
18
  opt '--publish', 'Whether or not to publish the package'
17
19
 
18
- cmds check: 'cabal check',
19
- sdist: 'cabal sdist',
20
+ cmds check: 'cabal check',
21
+ sdist: 'cabal sdist',
20
22
  upload: 'cabal upload %{upload_opts} %{path}'
21
23
 
22
- errs check: 'cabal check failed',
23
- sdist: 'cabal sdist failed',
24
+ errs check: 'cabal check failed',
25
+ sdist: 'cabal sdist failed',
24
26
  upload: 'cabal upload failed'
25
27
 
26
28
  def validate
@@ -33,19 +35,19 @@ module Dpl
33
35
 
34
36
  def deploy
35
37
  tar_files.each do |path|
36
- shell :upload, path: path
38
+ shell :upload, path:
37
39
  end
38
40
  end
39
41
 
40
42
  private
41
43
 
42
- def upload_opts
43
- opts_for(%i(publish username password))
44
- end
44
+ def upload_opts
45
+ opts_for(%i[publish username password])
46
+ end
45
47
 
46
- def tar_files
47
- Dir.glob('dist/*.tar.gz').sort
48
- end
48
+ def tar_files
49
+ Dir.glob('dist/*.tar.gz').sort
50
+ end
49
51
  end
50
52
  end
51
53
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dpl
2
4
  module Providers
3
5
  class Hephy < Provider
@@ -5,9 +7,9 @@ module Dpl
5
7
 
6
8
  status :beta
7
9
 
8
- description sq(<<-str)
10
+ description sq(<<-STR)
9
11
  tbd
10
- str
12
+ STR
11
13
 
12
14
  env :hephy
13
15
 
@@ -23,19 +25,19 @@ module Dpl
23
25
 
24
26
  INSTALL = 'https://raw.githubusercontent.com/teamhephy/workflow-cli/master/install-v2.sh'
25
27
 
26
- cmds install: 'curl -sSL %{INSTALL} | bash -x -s %{cli_version} && mv deis ~/.dpl',
27
- login: 'deis login %{controller} --username=%{username} --password=%{password}',
28
- add_key: 'deis keys:add %{key}',
29
- validate: 'deis apps:info --app=%{app}',
30
- deploy: 'filter_log git push %{verbose} %{url} HEAD:refs/heads/master -f',
31
- run: 'deis run -a %{app} -- %{cmd}',
28
+ cmds install: 'curl -sSL %{INSTALL} | bash -x -s %{cli_version} && mv deis ~/.dpl',
29
+ login: 'deis login %{controller} --username=%{username} --password=%{password}',
30
+ add_key: 'deis keys:add %{key}',
31
+ validate: 'deis apps:info --app=%{app}',
32
+ deploy: 'filter_log git push %{verbose} %{url} HEAD:refs/heads/master -f',
33
+ run: 'deis run -a %{app} -- %{cmd}',
32
34
  remove_key: 'deis keys:remove %{key_name}'
33
35
 
34
- errs login: 'Login failed.',
35
- add_key: 'Adding keys failed.',
36
- validate: 'Application could not be verified.',
37
- deploy: 'Deploying application failed.',
38
- run: 'Running command failed.',
36
+ errs login: 'Login failed.',
37
+ add_key: 'Adding keys failed.',
38
+ validate: 'Application could not be verified.',
39
+ deploy: 'Deploying application failed.',
40
+ run: 'Running command failed.',
39
41
  remove_key: 'Removing keys failed.'
40
42
 
41
43
  def install
@@ -51,7 +53,7 @@ module Dpl
51
53
  end
52
54
 
53
55
  def add_key(key)
54
- shell :add_key, key: key
56
+ shell(:add_key, key:)
55
57
  wait_for_ssh_access(host, port)
56
58
  end
57
59
 
@@ -64,7 +66,7 @@ module Dpl
64
66
  end
65
67
 
66
68
  def run_cmd(cmd)
67
- shell :run, app: app, cmd: cmd
69
+ shell :run, app:, cmd:
68
70
  end
69
71
 
70
72
  def remove_key
@@ -94,7 +96,7 @@ module Dpl
94
96
  end
95
97
 
96
98
  def host
97
- controller.gsub(/https?:\/\//, '').split(':')[0]
99
+ controller.gsub(%r{https?://}, '').split(':')[0]
98
100
  end
99
101
 
100
102
  def install_hephy_log_filter