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 ChefSupermarket < Provider
@@ -8,17 +10,17 @@ module Dpl
8
10
 
9
11
  full_name 'Chef Supermarket'
10
12
 
11
- description sq(<<-str)
13
+ description sq(<<-STR)
12
14
  tbd
13
- str
15
+ STR
14
16
 
15
- gem 'chef', '~> 12.0', require: %w(
17
+ gem 'chef', '~> 18', require: %w[
16
18
  chef/cookbook/cookbook_version_loader
17
- chef/cookbook_site_streaming_uploader
18
19
  chef/cookbook_uploader
19
- )
20
+ ]
21
+
20
22
  gem 'json'
21
- gem 'mime-types', '~> 3.2.2'
23
+ gem 'mime-types', '~> 3.4.1'
22
24
  gem 'net-telnet', '~> 0.1.0' if ruby_pre?('2.3')
23
25
  gem 'rack'
24
26
 
@@ -30,12 +32,12 @@ module Dpl
30
32
  opt '--client_key KEY', 'Client API key file name', default: 'client.pem'
31
33
  opt '--dir DIR', 'Directory containing the cookbook', default: '.'
32
34
 
33
- URL = "https://supermarket.chef.io/api/v1/cookbooks"
35
+ URL = 'https://supermarket.chef.io/api/v1/cookbooks'
34
36
 
35
- msgs validate: 'Validating cookbook',
36
- upload: 'Uploading cookbook %{name} to %{url}',
37
- missing_file: 'Missing file: %s',
38
- unknown_error: 'Unknown error while sharing cookbook: %s',
37
+ msgs validate: 'Validating cookbook',
38
+ upload: 'Uploading cookbook %{name} to %{url}',
39
+ missing_file: 'Missing file: %s',
40
+ unknown_error: 'Unknown error while sharing cookbook: %s',
39
41
  version_exists: 'The same version of this cookbook already exists on the Opscode Cookbook Site.'
40
42
 
41
43
  def setup
@@ -56,75 +58,75 @@ module Dpl
56
58
 
57
59
  private
58
60
 
59
- def upload
60
- res = Chef::CookbookSiteStreamingUploader.post(URL, user_id, client_key, params)
61
- handle_error(res.body) if res.code.to_i != 201
62
- end
63
-
64
- def params
65
- { cookbook: json(category: category), tarball: tarball }
66
- end
67
-
68
- def tarball
69
- shell "tar -czf /tmp/#{name}.tgz -C #{build_dir} ."
70
- shell "tar -tvf /tmp/#{name}.tgz"
71
- open "/tmp/#{name}.tgz"
72
- end
73
-
74
- def name
75
- @name ||= name_from_json || name_from_rb || error(:missing_file, 'metadata.json or metadata.rb')
76
- end
77
-
78
- def name_from_json
79
- JSON.load(read('metadata.json'))['name'] if file?('metadata.json')
80
- end
81
-
82
- def name_from_rb
83
- Chef::Cookbook::Metadata.new.from_file('metadata.rb') if file?('metadata.rb')
84
- end
85
-
86
- def cookbook
87
- @cookbook ||= loader.cookbook_version
88
- end
89
-
90
- def loader
91
- Chef::Cookbook::CookbookVersionLoader.new('.').tap(&:load!)
92
- end
93
-
94
- def uploader
95
- Chef::CookbookUploader.new(cookbook)
96
- end
97
-
98
- def build_dir
99
- @build_dir ||= Chef::CookbookSiteStreamingUploader.create_build_dir(cookbook)
100
- end
101
-
102
- def validate_file(path)
103
- error :missing_file, path unless file?(path)
104
- end
105
-
106
- def url
107
- URL
108
- end
109
-
110
- def handle_error(res)
111
- res = JSON.parse(res)
112
- unknown_error(res) unless res['error_messages']
113
- version_exists if res['error_messages'][0].include?('Version already exists')
114
- error "#{res['error_messages'][0]}"
115
- end
116
-
117
- def unknown_error(msg)
118
- error :unknown_error, msg
119
- end
120
-
121
- def version_exists
122
- error :version_exists
123
- end
124
-
125
- def json(obj)
126
- JSON.dump(obj)
127
- end
61
+ def upload
62
+ res = Chef::Knife::Core::CookbookSiteStreamingUploader.post(URL, user_id, client_key, params)
63
+ handle_error(res.body) if res.code.to_i != 201
64
+ end
65
+
66
+ def params
67
+ { cookbook: json(category: category), tarball: tarball}
68
+ end
69
+
70
+ def tarball
71
+ shell "tar -czf /tmp/#{name}.tgz -C #{build_dir} ."
72
+ shell "tar -tvf /tmp/#{name}.tgz"
73
+ open "/tmp/#{name}.tgz"
74
+ end
75
+
76
+ def name
77
+ @name ||= name_from_json || name_from_rb || error(:missing_file, 'metadata.json or metadata.rb')
78
+ end
79
+
80
+ def name_from_json
81
+ JSON.parse(read('metadata.json'))['name'] if file?('metadata.json')
82
+ end
83
+
84
+ def name_from_rb
85
+ Chef::Cookbook::Metadata.new.from_file('metadata.rb') if file?('metadata.rb')
86
+ end
87
+
88
+ def cookbook
89
+ @cookbook ||= loader.cookbook_version
90
+ end
91
+
92
+ def loader
93
+ Chef::Cookbook::CookbookVersionLoader.new('.').tap(&:load!)
94
+ end
95
+
96
+ def uploader
97
+ Chef::CookbookUploader.new(cookbook)
98
+ end
99
+
100
+ def build_dir
101
+ @build_dir ||= Chef::Knife::Core::CookbookSiteStreamingUploader.create_build_dir(cookbook)
102
+ end
103
+
104
+ def validate_file(path)
105
+ error :missing_file, path unless file?(path)
106
+ end
107
+
108
+ def url
109
+ URL
110
+ end
111
+
112
+ def handle_error(res)
113
+ res = JSON.parse(res)
114
+ unknown_error(res) unless res['error_messages']
115
+ version_exists if res['error_messages'][0].include?('Version already exists')
116
+ error (res['error_messages'][0]).to_s
117
+ end
118
+
119
+ def unknown_error(msg)
120
+ error :unknown_error, msg
121
+ end
122
+
123
+ def version_exists
124
+ error :version_exists
125
+ end
126
+
127
+ def json(obj)
128
+ JSON.dump(obj)
129
+ end
128
130
  end
129
131
  end
130
132
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dpl
2
4
  module Providers
3
5
  class Cloud66 < 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 :cloud66
13
15
 
@@ -22,23 +24,23 @@ module Dpl
22
24
 
23
25
  private
24
26
 
25
- def client
26
- Net::HTTP.new(uri.host, uri.port).tap do |client|
27
- client.use_ssl = use_ssl?
28
- end
27
+ def client
28
+ Net::HTTP.new(uri.host, uri.port).tap do |client|
29
+ client.use_ssl = use_ssl?
29
30
  end
31
+ end
30
32
 
31
- def request
32
- Net::HTTP::Post.new(uri.path)
33
- end
33
+ def request
34
+ Net::HTTP::Post.new(uri.path)
35
+ end
34
36
 
35
- def uri
36
- @uri ||= URI.parse(redeployment_hook)
37
- end
37
+ def uri
38
+ @uri ||= URI.parse(redeployment_hook)
39
+ end
38
40
 
39
- def use_ssl?
40
- uri.scheme.downcase == 'https'
41
- end
41
+ def use_ssl?
42
+ uri.scheme.downcase == 'https'
43
+ end
42
44
  end
43
45
  end
44
46
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dpl
2
4
  module Providers
3
5
  class Cloudfiles < Provider
@@ -7,19 +9,19 @@ module Dpl
7
9
 
8
10
  full_name 'Cloud Files'
9
11
 
10
- description sq(<<-str)
12
+ description sq(<<-STR)
11
13
  tbd
12
- str
14
+ STR
13
15
 
14
- gem 'nokogiri', '< 1.10'
15
- gem 'fog-core', '= 2.1.0', require: 'fog/core'
16
- gem 'fog-rackspace', '~> 0.1.6', require: 'fog/rackspace'
16
+ gem 'nokogiri', '~> 1.15'
17
+ gem 'fog-core', '~> 2.3', require: 'fog/core'
18
+ gem 'fog-rackspace', '~> 0.1.6', git: 'https://github.com/travis-oss/fog-rackspace', require: 'fog/rackspace'
17
19
 
18
20
  env :cloudfiles
19
21
 
20
22
  opt '--username USER', 'Rackspace username', required: true
21
23
  opt '--api_key KEY', 'Rackspace API key', required: true, secret: true
22
- opt '--region REGION', 'Cloudfiles region', required: true, enum: %w(ord dfw syd iad hkg)
24
+ opt '--region REGION', 'Cloudfiles region', required: true, enum: %w[ord dfw syd iad hkg]
23
25
  opt '--container NAME', 'Name of the container that files will be uploaded to', required: true
24
26
  opt '--glob GLOB', 'Paths to upload', default: '**/*'
25
27
  opt '--dot_match', 'Upload hidden files starting a dot'