dpl 1.9.1.travis.2669.5 → 1.9.1.travis.2689.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4eb7250f5239fe35747ef65cec136e5a2ad9c4adbafc6abfb553f52eff321daf
4
- data.tar.gz: 069ff8003d2f263cd7d371c14d14f5451a99b7c48eff376d159b9392601d1f21
3
+ metadata.gz: 1d57a4757298450c261675de95dbfec3c872654f5a9254cb37421bee9bf2a90e
4
+ data.tar.gz: 65af2a43706237c712d1b49289691f1745dbcaa44c5155538a4835a7db287039
5
5
  SHA512:
6
- metadata.gz: c9d0d6debaaa1c977aaa02a577601737703f33eceb29ed746ba40209d1cab8093cbb3a2be7598b95b3ee51a38ee96e26dde8da1285843813fabf3b353deca09b
7
- data.tar.gz: c662ca678fca7543961f6abf1bda9c0f66142e2a741449054477910391c1b245a1305bfd6644914eb14c89b1a4c53899a8ae12be5ef773c3d0bb53301c0e9b04
6
+ metadata.gz: 19fcd00cec99be64611cc80b5edc507a829899c22355307335c3b2b375379cc3d243221fdb81f1e4d888da7e75931a7ceae461118bbad8d622f4b3e1b32ab19c
7
+ data.tar.gz: c82543adcf7c164777a9b40138e37dbb8882dd3f779e037fe3cb6a50d208f4bdf18f287da1078cb75d1c7f6ecb078b427f5324031f1fba9c0e06e4d911922799
data/.travis.yml CHANGED
@@ -8,8 +8,6 @@ rvm:
8
8
  jobs:
9
9
  include:
10
10
  - stage: deploy
11
- install: true
12
- script: true
13
11
  cache: false
14
12
  before_deploy:
15
13
  - sed -i.bak "s/VERSION = '.*'/VERSION = '${DPL_VERSION}'/g" lib/dpl/version.rb
@@ -19,16 +17,16 @@ jobs:
19
17
  - git commit -m "Update DPL::Version"
20
18
  deploy:
21
19
  - provider: rubygems
20
+ script: skip
21
+ edge:
22
+ branch: master
22
23
  api_key:
23
24
  secure: ZmZoDL1tilWvQrqRWDm2K4xQ5Grt9eRJzYVZPLANR0P1TM5BJBLk+UhWCWCPkkDVIBWMa5ANsiFYBxtH65Lw+uqMztSpVusk0l0LQXZGv9jMpT9445A8008U3vvfS0ke7IG8Q4bMAC7Sd6VGaiHDyZC7zmNvnqMpmVX7ShcgBME=
24
25
  gem: dpl
25
- edge:
26
- branch: v1.9
27
26
  gemspec_glob: 'dpl*.gemspec'
28
27
  on:
29
28
  repo: travis-ci/dpl
30
- branch: v1.9
31
- if: NOT type IN (pull_request)
29
+ if: branch = master AND NOT type IN (pull_request)
32
30
 
33
31
  env:
34
32
  global:
data/Rakefile CHANGED
@@ -3,9 +3,16 @@ require 'term/ansicolor'
3
3
  require 'pathname'
4
4
  require 'logger'
5
5
  require './lib/dpl/version'
6
+ require 'highline'
6
7
 
7
8
  include Term::ANSIColor
8
9
 
10
+ def cli
11
+ @cli ||= HighLine.new
12
+ end
13
+
14
+ @ready = false
15
+
9
16
  def logger
10
17
  @logger ||= Logger.new($stdout)
11
18
  end
@@ -18,29 +25,68 @@ def gem_version
18
25
  ENV['DPL_VERSION'] || DPL::VERSION
19
26
  end
20
27
 
28
+ def confirm(verb = "release")
29
+ unless @ready
30
+ answer = cli.ask "Ready to #{verb} `dpl` version #{gem_version}? (y/n)"
31
+ if answer !~ /^y/i
32
+ abort red("Aborting #{verb}")
33
+ end
34
+
35
+ @ready = true
36
+ end
37
+ end
38
+
21
39
  gemspecs = FileList[File.join(top, "dpl-*.gemspec")]
22
40
 
23
41
  providers = gemspecs.map { |f| /dpl-(?<provider>.*)\.gemspec/ =~ f && provider }
24
42
 
25
- dpl_bin = File.join(Gem.bindir, "dpl")
26
-
27
43
  task :default => [:spec, :install] do
28
44
  Rake::Task["spec_providers"].invoke
29
45
  Rake::Task["check_providers"].invoke
30
46
  end
31
47
 
48
+ desc "Run spec on all providers"
32
49
  task :spec_providers do
33
50
  providers.each do |provider|
34
51
  Rake::Task["spec-#{provider}"].invoke
35
52
  end
36
53
  end
37
54
 
55
+ desc "Check all provider gems install correctly"
38
56
  task :check_providers do
39
57
  providers.each do |provider|
40
58
  Rake::Task["check-#{provider}"].invoke
41
59
  end
42
60
  end
43
61
 
62
+ desc "Build all gems"
63
+ task :build => "dpl-#{gem_version}.gem" do
64
+ providers.each do |provider|
65
+ Rake::Task["dpl-#{provider}-#{gem_version}.gem"].invoke
66
+ end
67
+ end
68
+
69
+ desc "Release all gems"
70
+ task :release do
71
+ confirm
72
+ threads = []
73
+ providers.each { |provider| threads << Thread.new { Rake::Task["release-#{provider}"].invoke } }
74
+ threads.each { |thr| thr.join }
75
+ logger.info green("Pushing dpl-#{gem_version}.gem")
76
+ sh "gem push dpl-#{gem_version}.gem"
77
+ end
78
+
79
+ desc "Yank all gems"
80
+ task :yank, [:version] do |t, args|
81
+ version = args.version
82
+ confirm "yank"
83
+ logger.info green("Yanking `dpl` version #{version}")
84
+ sh "gem yank dpl -v #{version}"
85
+ threads = []
86
+ providers.each { |provider| threads << Thread.new { Rake::Task["yank-#{provider}"].invoke } }
87
+ threads.each { |thr| thr.join }
88
+ end
89
+
44
90
  task :deep_clean do
45
91
  Rake::Task[:clean].invoke
46
92
  sh "git clean -dfx"
@@ -64,10 +110,6 @@ end
64
110
 
65
111
  desc "Install dpl gem"
66
112
  task :install => "dpl-#{gem_version}.gem" do
67
- Rake::FileTask[dpl_bin].invoke
68
- end
69
-
70
- file dpl_bin do
71
113
  logger.info green("Installing dpl gem")
72
114
  ruby "-S gem install dpl-#{gem_version}.gem"
73
115
  end
@@ -81,10 +123,9 @@ providers.each do |provider|
81
123
  end
82
124
 
83
125
  desc %Q(Run dpl-#{provider} specs)
84
- task "spec-#{provider}" => [:install, "Gemfile-#{provider}"] do |t|
126
+ task "spec-#{provider}" => [:install, "Gemfile-#{provider}"] do
127
+ sh "rm -f $HOME/.npmrc"
85
128
  logger.info green("Running `bundle install` for #{provider}")
86
- # rm_rf 'stubs'
87
- # rm_rf '.bundle'
88
129
  sh 'bash', '-cl', "bundle install --gemfile=Gemfile-#{provider} --path=vendor/cache/dpl-#{provider} --retry=3 --binstubs=stubs"
89
130
  logger.info green("Running specs for #{provider}")
90
131
  sh "env BUNDLE_GEMFILE=Gemfile-#{provider} ./stubs/rspec spec/provider/#{provider}_spec.rb"
@@ -104,5 +145,16 @@ providers.each do |provider|
104
145
  ruby "-S dpl --provider=#{provider} --skip-cleanup=true --no-deploy"
105
146
  end
106
147
 
107
- end
148
+ desc "Release dpl-#{provider} gem"
149
+ task "release-#{provider}" => "dpl-#{provider}-#{gem_version}.gem" do
150
+ confirm
151
+ logger.info green("Pushing dpl-#{provider}-#{gem_version}.gem")
152
+ sh "gem push dpl-#{provider}-#{gem_version}.gem"
153
+ end
108
154
 
155
+ desc "Yank dpl-#{provider}"
156
+ task "yank-#{provider}" do
157
+ logger.info green("Yanking dpl-#{provider} version #{gem_version}")
158
+ sh "gem yank dpl-#{provider} -v #{gem_version}"
159
+ end
160
+ end
data/gemspec_helper.rb CHANGED
@@ -33,6 +33,7 @@ def gemspec_for(provider_name=nil, runtime_dependencies=[])
33
33
  s.add_development_dependency 'json_pure'
34
34
  s.add_development_dependency 'tins'
35
35
  s.add_development_dependency 'coveralls'
36
+ s.add_development_dependency 'highline'
36
37
 
37
38
  # set up files
38
39
  if provider_name
data/lib/dpl/provider.rb CHANGED
@@ -10,7 +10,7 @@ module DPL
10
10
  # file names. There is no simple rule to map them automatically
11
11
  # (camel-cases, snake-cases, call-caps, etc.), so we need an explicit
12
12
  # map.
13
- PROVIDERS = {
13
+ GEM_NAME_OF = {
14
14
  'Anynines' => 'anynines',
15
15
  'Appfog' => 'appfog',
16
16
  'Atlas' => 'atlas',
@@ -61,35 +61,35 @@ module DPL
61
61
  # when requiring the file corresponding to the provider name
62
62
  # given in the options, the general strategy is to normalize
63
63
  # the option to lower-case alphanumeric, then
64
- # use that key to find the file name using the PROVIDERS map.
64
+ # use that key to find the file name using the GEM_NAME_OF map.
65
65
 
66
66
  context.fold("Installing deploy dependencies") do
67
67
  begin
68
68
  opt_lower = super.option(:provider).to_s.downcase
69
69
  opt = opt_lower.gsub(/[^a-z0-9]/, '')
70
- class_name = PROVIDERS.keys.detect { |p| p.to_s.downcase == opt }
70
+ class_name = class_of(opt)
71
71
  raise Error, "could not find provider %p" % opt unless class_name
72
- require "dpl/provider/#{PROVIDERS[class_name]}"
72
+ require "dpl/provider/#{GEM_NAME_OF[class_name]}"
73
73
  provider = const_get(class_name).new(context, options)
74
74
  rescue NameError, LoadError => e
75
75
  if /uninitialized constant DPL::Provider::(?<provider_wanted>\S+)/ =~ e.message
76
- provider_gem_name = PROVIDERS[provider_wanted]
76
+ provider_gem_name = GEM_NAME_OF[provider_wanted]
77
77
  elsif %r(cannot load such file -- dpl/provider/(?<provider_file_name>\S+)) =~ e.message
78
- provider_gem_name = PROVIDERS[class_name]
78
+ provider_gem_name = GEM_NAME_OF[class_name]
79
79
  else
80
80
  # don't know what to do with this error
81
81
  raise e
82
82
  end
83
83
  install_cmd = "gem install dpl-#{provider_gem_name || opt} -v #{ENV['DPL_VERSION'] || DPL::VERSION}"
84
84
 
85
- if File.exist?(local_gem = File.join(Dir.pwd, "dpl-#{PROVIDERS[provider_gem_name] || opt_lower}-#{ENV['DPL_VERSION'] || DPL::VERSION}.gem"))
85
+ if File.exist?(local_gem = File.join(Dir.pwd, "dpl-#{GEM_NAME_OF[provider_gem_name] || opt_lower}-#{ENV['DPL_VERSION'] || DPL::VERSION}.gem"))
86
86
  install_cmd = "gem install #{local_gem}"
87
87
  end
88
88
 
89
89
  context.shell(install_cmd)
90
90
  Gem.clear_paths
91
91
 
92
- require "dpl/provider/#{PROVIDERS[class_name]}"
92
+ require "dpl/provider/#{GEM_NAME_OF[class_name]}"
93
93
  provider = const_get(class_name).new(context, options)
94
94
  rescue DPL::Error
95
95
  if opt_lower
@@ -149,6 +149,10 @@ module DPL
149
149
  context.shell("npm install -g #{name}", retry: true) if `which #{command}`.chop.empty?
150
150
  end
151
151
 
152
+ def self.class_of(filename)
153
+ GEM_NAME_OF.keys.detect { |p| p.to_s.downcase == filename }
154
+ end
155
+
152
156
  attr_reader :context, :options
153
157
 
154
158
  def initialize(context, options)
data/lib/dpl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DPL
2
- VERSION = '1.9.1.travis.2669.5'
2
+ VERSION = '1.9.1.travis.2689.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1.travis.2669.5
4
+ version: 1.9.1.travis.2689.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-02 00:00:00.000000000 Z
11
+ date: 2018-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: highline
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  description: deploy tool abstraction for clients
98
112
  email: konstantin.mailinglists@googlemail.com
99
113
  executables: