travis_dpl_test 2.0.3.beta.4.ror

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +172 -0
  3. data/CODE_OF_CONDUCT.md +74 -0
  4. data/CONTRIBUTING.md +392 -0
  5. data/Gemfile +32 -0
  6. data/Gemfile.lock +611 -0
  7. data/LICENSE +19 -0
  8. data/README.md +2744 -0
  9. data/Rakefile +210 -0
  10. data/bin/dpl +11 -0
  11. data/config/transliterate.yml +733 -0
  12. data/dpl.gemspec +23 -0
  13. data/lib/dpl/assets/atlas/install +19 -0
  14. data/lib/dpl/assets/convox/install +11 -0
  15. data/lib/dpl/assets/dpl/README.erb.md +138 -0
  16. data/lib/dpl/assets/dpl/git_ssh +8 -0
  17. data/lib/dpl/assets/git/detect_private_key +8 -0
  18. data/lib/dpl/assets/hephy/filter_log +3 -0
  19. data/lib/dpl/assets/pypi/install +4 -0
  20. data/lib/dpl/assets/scalingo/install +6 -0
  21. data/lib/dpl/cli.rb +100 -0
  22. data/lib/dpl/ctx/bash.rb +549 -0
  23. data/lib/dpl/ctx/test.rb +255 -0
  24. data/lib/dpl/ctx.rb +4 -0
  25. data/lib/dpl/helper/assets.rb +38 -0
  26. data/lib/dpl/helper/cmd.rb +169 -0
  27. data/lib/dpl/helper/config_file.rb +49 -0
  28. data/lib/dpl/helper/cookbook_site_streaming_uploader.rb +249 -0
  29. data/lib/dpl/helper/env.rb +92 -0
  30. data/lib/dpl/helper/github.rb +22 -0
  31. data/lib/dpl/helper/interpolate.rb +160 -0
  32. data/lib/dpl/helper/memoize.rb +23 -0
  33. data/lib/dpl/helper/squiggle.rb +24 -0
  34. data/lib/dpl/helper/transliterate.rb +13 -0
  35. data/lib/dpl/helper/wrap.rb +11 -0
  36. data/lib/dpl/helper/zip.rb +71 -0
  37. data/lib/dpl/provider/dsl.rb +410 -0
  38. data/lib/dpl/provider/examples.rb +132 -0
  39. data/lib/dpl/provider/status.rb +61 -0
  40. data/lib/dpl/provider.rb +651 -0
  41. data/lib/dpl/providers/anynines.rb +71 -0
  42. data/lib/dpl/providers/azure_web_apps.rb +63 -0
  43. data/lib/dpl/providers/bintray.rb +324 -0
  44. data/lib/dpl/providers/bluemixcloudfoundry.rb +98 -0
  45. data/lib/dpl/providers/boxfuse.rb +52 -0
  46. data/lib/dpl/providers/cargo.rb +32 -0
  47. data/lib/dpl/providers/chef_supermarket.rb +132 -0
  48. data/lib/dpl/providers/cloud66.rb +46 -0
  49. data/lib/dpl/providers/cloudfiles.rb +62 -0
  50. data/lib/dpl/providers/cloudformation.rb +281 -0
  51. data/lib/dpl/providers/cloudfoundry.rb +89 -0
  52. data/lib/dpl/providers/codedeploy.rb +190 -0
  53. data/lib/dpl/providers/convox.rb +130 -0
  54. data/lib/dpl/providers/datica.rb +64 -0
  55. data/lib/dpl/providers/ecr.rb +129 -0
  56. data/lib/dpl/providers/elasticbeanstalk.rb +207 -0
  57. data/lib/dpl/providers/engineyard.rb +113 -0
  58. data/lib/dpl/providers/firebase.rb +45 -0
  59. data/lib/dpl/providers/flynn.rb +35 -0
  60. data/lib/dpl/providers/gae.rb +78 -0
  61. data/lib/dpl/providers/gcs.rb +132 -0
  62. data/lib/dpl/providers/git_push.rb +273 -0
  63. data/lib/dpl/providers/gleis.rb +74 -0
  64. data/lib/dpl/providers/hackage.rb +53 -0
  65. data/lib/dpl/providers/hephy.rb +107 -0
  66. data/lib/dpl/providers/heroku/api.rb +123 -0
  67. data/lib/dpl/providers/heroku/git.rb +54 -0
  68. data/lib/dpl/providers/heroku.rb +111 -0
  69. data/lib/dpl/providers/lambda.rb +211 -0
  70. data/lib/dpl/providers/launchpad.rb +80 -0
  71. data/lib/dpl/providers/netlify.rb +38 -0
  72. data/lib/dpl/providers/npm.rb +130 -0
  73. data/lib/dpl/providers/nuget.rb +41 -0
  74. data/lib/dpl/providers/openshift.rb +52 -0
  75. data/lib/dpl/providers/opsworks.rb +146 -0
  76. data/lib/dpl/providers/packagecloud.rb_ +194 -0
  77. data/lib/dpl/providers/pages/api.rb +106 -0
  78. data/lib/dpl/providers/pages/git.rb +262 -0
  79. data/lib/dpl/providers/pages.rb +18 -0
  80. data/lib/dpl/providers/puppetforge.rb +50 -0
  81. data/lib/dpl/providers/pypi.rb +125 -0
  82. data/lib/dpl/providers/releases.rb +234 -0
  83. data/lib/dpl/providers/rubygems.rb +97 -0
  84. data/lib/dpl/providers/s3.rb +251 -0
  85. data/lib/dpl/providers/scalingo.rb +69 -0
  86. data/lib/dpl/providers/script.rb +32 -0
  87. data/lib/dpl/providers/snap.rb +68 -0
  88. data/lib/dpl/providers/surge.rb +59 -0
  89. data/lib/dpl/providers/testfairy.rb +101 -0
  90. data/lib/dpl/providers/transifex.rb +72 -0
  91. data/lib/dpl/providers.rb +48 -0
  92. data/lib/dpl/string_ext.rb +23 -0
  93. data/lib/dpl/support/aws_sdk_patch.rb +26 -0
  94. data/lib/dpl/support/gems.rb +73 -0
  95. data/lib/dpl/support/gstore_patch.rb +8 -0
  96. data/lib/dpl/support/version.rb +84 -0
  97. data/lib/dpl/version.rb +5 -0
  98. data/lib/dpl.rb +23 -0
  99. data/status.json +237 -0
  100. metadata +161 -0
data/Rakefile ADDED
@@ -0,0 +1,210 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler'
4
+ require 'term/ansicolor'
5
+ require 'pathname'
6
+ require 'logger'
7
+ require './lib/dpl/version'
8
+ require 'highline'
9
+ require 'faraday'
10
+
11
+ include Term::ANSIColor
12
+
13
+ def cli
14
+ @cli ||= HighLine.new
15
+ end
16
+
17
+ @ready = false
18
+
19
+ def logger
20
+ @logger ||= Logger.new($stdout)
21
+ end
22
+
23
+ def top
24
+ @top ||= Pathname.new File.expand_path(File.dirname(__FILE__))
25
+ end
26
+
27
+ def gem_version
28
+ ENV['DPL_VERSION'] || Dpl::VERSION
29
+ end
30
+
31
+ def confirm(verb = 'release')
32
+ unless @ready
33
+ answer = cli.ask "Ready to #{verb} `dpl` version #{gem_version}? (y/n)"
34
+ if answer !~ /^y/i
35
+ abort red("Aborting #{verb}")
36
+ end
37
+
38
+ @ready = true
39
+ end
40
+ end
41
+
42
+ def dpl_bin
43
+ File.join(Gem.bindir, 'dpl')
44
+ end
45
+
46
+ gemspecs = FileList[File.join(top, 'dpl-*.gemspec')]
47
+
48
+ providers = gemspecs.map { |f| /dpl-(?<provider>.*)\.gemspec/ =~ f && provider }
49
+
50
+ desc 'Build dpl gem'
51
+ file "dpl-#{gem_version}.gem" do
52
+ logger.info green('Building dpl gem')
53
+ ruby '-S gem build dpl.gemspec'
54
+ end
55
+
56
+ desc 'Install dpl gem'
57
+ file dpl_bin => "dpl-#{gem_version}.gem" do
58
+ logger.info green('Installing dpl gem')
59
+ ruby "-S gem install dpl-#{gem_version}.gem"
60
+ end
61
+
62
+ task default: [:spec, Rake::FileTask[dpl_bin]] do
63
+ Rake::Task['spec_providers'].invoke
64
+ Rake::Task['check_providers'].invoke
65
+ end
66
+
67
+ desc 'Run spec on all providers'
68
+ task :spec_providers do
69
+ providers.each do |provider|
70
+ Rake::Task["spec-#{provider}"].invoke
71
+ end
72
+ end
73
+
74
+ desc 'Check all provider gems install correctly'
75
+ task :check_providers do
76
+ providers.each do |provider|
77
+ Rake::Task["check-#{provider}"].invoke
78
+ end
79
+ end
80
+
81
+ desc 'Build all gems'
82
+ task build: "dpl-#{gem_version}.gem" do
83
+ providers.each do |provider|
84
+ Rake::Task["dpl-#{provider}-#{gem_version}.gem"].invoke
85
+ end
86
+ end
87
+
88
+ desc 'Uninstall all gems'
89
+ task :uninstall do
90
+ providers.each do |provider|
91
+ Rake::Task["uninstall-#{provider}"].invoke
92
+ end
93
+ logger.info red('Uninstalling dpl')
94
+ sh 'gem uninstall -aIx dpl'
95
+ end
96
+
97
+ desc 'Release all gems'
98
+ task :release do
99
+ confirm
100
+ released = []
101
+ providers.each do |provider|
102
+ until released.include? provider
103
+ logger.info "checking dpl-#{provider}"
104
+
105
+ cli = Faraday.new url: 'https://rubygems.org'
106
+
107
+ begin
108
+ response = cli.get("/api/v2/rubygems/dpl-#{provider}/versions/#{gem_version}.json")
109
+ if response.success?
110
+ released << provider
111
+ logger.info green("dpl-#{provider} #{gem_version} exists")
112
+ next
113
+ else
114
+ begin
115
+ if Rake::Task["release-#{provider}"].invoke
116
+ released << provider
117
+ end
118
+ rescue StandardError
119
+ Rake::Task["release-#{provider}"].reenable
120
+ end
121
+ end
122
+ rescue Faraday::Error
123
+ logger.info yellow('connection failed. retrying')
124
+ retry
125
+ end
126
+ end
127
+ end
128
+ logger.info green("Pushing dpl-#{gem_version}.gem")
129
+ sh "gem push dpl-#{gem_version}.gem"
130
+ end
131
+
132
+ desc 'Yank all gems'
133
+ task :yank, [:version] do |_t, args|
134
+ version = args.version
135
+ confirm 'yank'
136
+ logger.info green("Yanking `dpl` version #{version}")
137
+ sh "gem yank dpl -v #{version}"
138
+ providers.each do |provider|
139
+ Rake::Task["yank-#{provider}"].invoke
140
+ end
141
+ end
142
+
143
+ task :deep_clean do
144
+ Rake::Task[:clean].invoke
145
+ sh 'git clean -dfx'
146
+ end
147
+
148
+ task :clean do
149
+ rm_rf 'stubs'
150
+ rm_rf 'vendor'
151
+ rm_rf 'dpl-*.gem'
152
+ Rake::Task[:uninstall].invoke
153
+ end
154
+
155
+ desc 'Run dpl specs'
156
+ task :spec do
157
+ ruby '-S rspec spec/cli_spec.rb spec/provider_spec.rb'
158
+ end
159
+
160
+ providers.each do |provider|
161
+ desc "Write Gemfile-#{provider}"
162
+ file "Gemfile-#{provider}" do |t|
163
+ gemfile = top + t.name
164
+ logger.info green("Writing #{gemfile}")
165
+ gemfile.write %(source 'https://rubygems.org'\ngemspec :name => "dpl-#{provider}"\n)
166
+ end
167
+
168
+ desc %(Run dpl-#{provider} specs)
169
+ task "spec-#{provider}", [:lines] => [Rake::FileTask[dpl_bin], "Gemfile-#{provider}"] do |_t, args|
170
+ tail = args.lines ? ":#{args.lines}" : ''
171
+ sh 'rm -f $HOME/.npmrc'
172
+ logger.info green("Running `bundle install` for #{provider}")
173
+ sh 'bash', '-cl', "bundle install --gemfile=Gemfile-#{provider} --path=vendor/cache/dpl-#{provider} --retry=3 --binstubs=stubs"
174
+ logger.info green("Running specs for #{provider}")
175
+ sh "env BUNDLE_GEMFILE=Gemfile-#{provider} ./stubs/rspec spec/provider/#{provider}_spec.rb#{tail}"
176
+ end
177
+
178
+ desc "Build dpl-#{provider} gem"
179
+ file "dpl-#{provider}-#{gem_version}.gem" do
180
+ logger.info green("Building dpl-#{provider} gem")
181
+ ruby "-S gem build --silent dpl-#{provider}.gemspec"
182
+ end
183
+
184
+ desc "Test dpl-#{provider} gem"
185
+ task "check-#{provider}" => [Rake::FileTask[dpl_bin], "dpl-#{provider}-#{gem_version}.gem"] do
186
+ logger.info green("Installing dpl-#{provider} gem")
187
+ sh "gem install --no-post-install-message dpl-#{provider}-#{gem_version}.gem"
188
+ logger.info green("Testing dpl-#{provider} loads correctly")
189
+ ruby "-S dpl --provider=#{provider} --stage=init"
190
+ end
191
+
192
+ desc "Uninstall dpl-#{provider}"
193
+ task "uninstall-#{provider}" do
194
+ logger.info red("Uninstalling dpl-#{provider}")
195
+ sh "gem uninstall -aIx dpl-#{provider}"
196
+ end
197
+
198
+ desc "Release dpl-#{provider} gem"
199
+ task "release-#{provider}" => "dpl-#{provider}-#{gem_version}.gem" do
200
+ confirm
201
+ logger.info green("Pushing dpl-#{provider}-#{gem_version}.gem")
202
+ sh "gem push dpl-#{provider}-#{gem_version}.gem"
203
+ end
204
+
205
+ desc "Yank dpl-#{provider}"
206
+ task "yank-#{provider}" do
207
+ logger.info green("Yanking dpl-#{provider} version #{gem_version}")
208
+ sh "gem yank dpl-#{provider} -v #{gem_version}"
209
+ end
210
+ end
data/bin/dpl ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ $LOAD_PATH << File.expand_path('../lib', __dir__)
5
+
6
+ $stdout.sync = true
7
+ $stderr.sync = true
8
+
9
+ require 'dpl'
10
+
11
+ Dpl::Cli.new.run(ARGV)