dpl 1.9.1.travis.2660.5 → 1.9.1.travis.2666.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +5 -31
  3. data/Rakefile +103 -7
  4. data/lib/dpl/version.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7494a96a838bdb9db9a0b0042cb001e9fd1a0ac1fbdb2c7ae97fcbb19986155e
4
- data.tar.gz: a5ab9c1124ea55f1d4af111b983896904591041bd2bb01653dfa8ce380fe2565
3
+ metadata.gz: 8997fbbf6eb43dcb503cf4a1bf17e09f100a932ece178c0b5b060a09ba142b2d
4
+ data.tar.gz: 21d597381e3b2ba19c5c58905e6abecb28a96f60d16ca587dccb6e2e9fbd2cc4
5
5
  SHA512:
6
- metadata.gz: c1eac4ca1809c551e8a576cba99f7fffd25097bdafa187fc81be660cd15a369848b0fe714f53dfb4c55479a6e956d24c9fadedf19f9009122103d9aec85ca69d
7
- data.tar.gz: 8e23bda53945418170fd2132c2b6d23ebf944d528d6244d4dd2cabb1938f8e8865ef339546052d73126c7c5996d7736e52228d8670015bffb83dae31150b5830
6
+ metadata.gz: 6f0634b3006d58f72dd5ffe9da623f5a7c279efda96f2d535ff33dee527deae92eb6e48de24ce17aa35e50cd8199fb146dc803f8caccf85510f95714b72fa987
7
+ data.tar.gz: fc0822828ec9e4cc9bbb22e9f7fbf3856610fabda0d57fe42b147f91233b7e916a4079bbb017489ac98f381b8c71556e18b8dcc6b449ea86611a98c2a05e291b
@@ -38,6 +38,7 @@ sudo: false
38
38
 
39
39
  before_cache:
40
40
  - rm -rf $GEM_HOME/cache/dpl-*.travis.*.gem $GEM_HOME/gems/dpl-*.travis.* $GEM_HOME/specifications/dpl-*.travis.*
41
+ - git checkout bin/dpl
41
42
 
42
43
  cache:
43
44
  directories:
@@ -48,38 +49,11 @@ cache:
48
49
  before_install:
49
50
  - gem update bundler
50
51
 
51
- script:
52
- - bundle exec rspec spec/cli_spec.rb spec/provider_spec.rb
53
- - gem build dpl.gemspec && gem install dpl-*.gem
54
- - echo -e "\n${ANSI_GREEN}Run specs${ANSI_RESET}"
55
- - |
56
- spec_errors=0
57
- for f in dpl-*.gemspec; do
58
- base=${f%*.gemspec}; name=${base#dpl-*}
59
- echo -e "\n${ANSI_GREEN}${base}${ANSI_RESET}\n"
60
- echo -e "source 'https://rubygems.org'\ngemspec :name => \"dpl-${name}\"" > Gemfile-${name}
61
- export BUNDLE_GEMFILE=Gemfile-${name}
62
- bundle install --gemfile Gemfile-${name} --path=vendor/cache/dpl-${name} --binstubs=bin && ./bin/rspec spec/provider/${name}_spec.rb
63
- if [[ $? -ne 0 ]]; then
64
- echo -e "${ANSI_RED}${name} specs failed${ANSI_RESET}" && let spec_errors=$spec_errors+1
65
- fi
66
- done
67
- test $spec_errors -eq 0
68
- - echo -e "\n${ANSI_GREEN}Install gem and invoke dpl${ANSI_RESET}"
69
- - |
70
- no_err=0
71
- export BUNDLE_GEMFILE=Gemfile
72
- for f in dpl-*.gemspec; do
73
- base=${f%*.gemspec}; name=${base#dpl-*}
74
- echo -e "\n${ANSI_GREEN}${base}${ANSI_RESET}\n"
75
- gem build --silent $f && gem install --no-post-install-message dpl-${name}-*.gem && ( dpl --provider=${name} --no-deploy )
76
- if [[ $? -ne 0 ]]; then
77
- echo -e "${ANSI_RED}${name} invocation failed${ANSI_RESET}" && let no_err=$no_err+1
78
- fi
79
- done
80
- test $no_err -eq 0
81
- # - bundle exec rake && gem build dpl.gemspec && gem install dpl-*.gem && dpl --provider=script --script='echo foo'
52
+ before_script:
53
+ - rm -f $(ruby -r rubygems -e "puts Gem.bindir")/dpl
82
54
 
55
+ script:
56
+ - rake
83
57
 
84
58
  notifications:
85
59
  webhooks: "http://requestb.in/1guaq7t1"
data/Rakefile CHANGED
@@ -1,12 +1,108 @@
1
1
  require 'bundler'
2
+ require 'term/ansicolor'
3
+ require 'pathname'
4
+ require 'logger'
5
+ require './lib/dpl/version'
2
6
 
3
- task(:default) { ruby '-S rspec' }
7
+ include Term::ANSIColor
4
8
 
5
- desc "Test provider"
6
- task :test_provider, [:provider] do |t, args|
7
- provider = args.provider
9
+ def logger
10
+ @logger ||= Logger.new($stdout)
11
+ end
8
12
 
9
- Bundler.setup(provider.to_sym)
13
+ def top
14
+ @top ||= Pathname.new File.expand_path(File.dirname(__FILE__))
15
+ end
16
+
17
+ def gem_version
18
+ ENV['DPL_VERSION'] || DPL::VERSION
19
+ end
20
+
21
+ gemspecs = FileList[File.join(top, "dpl-*.gemspec")]
22
+
23
+ providers = gemspecs.map { |f| /dpl-(?<provider>.*)\.gemspec/ =~ f && provider }
24
+
25
+ dpl_bin = File.join(Gem.bindir, "dpl")
26
+
27
+ task :default => [:spec, :install] do
28
+ Rake::Task["spec_providers"].invoke
29
+ Rake::Task["check_providers"].invoke
30
+ end
31
+
32
+ task :spec_providers do
33
+ providers.each do |provider|
34
+ Rake::Task["spec-#{provider}"].invoke
35
+ end
36
+ end
37
+
38
+ task :check_providers do
39
+ providers.each do |provider|
40
+ Rake::Task["check-#{provider}"].invoke
41
+ end
42
+ end
43
+
44
+ task :deep_clean do
45
+ Rake::Task[:clean].invoke
46
+ sh "git clean -dfx"
47
+ end
48
+
49
+ task :clean do
50
+ rm_rf "stubs"
51
+ rm_rf "vendor"
52
+ end
53
+
54
+ desc "Run dpl specs"
55
+ task :spec do
56
+ ruby '-S rspec spec/cli_spec.rb spec/provider_spec.rb'
57
+ end
58
+
59
+ desc "Build dpl gem"
60
+ file "dpl-#{gem_version}.gem" do
61
+ logger.info green("Building dpl gem")
62
+ ruby "-S gem build dpl.gemspec"
63
+ end
64
+
65
+ desc "Install dpl gem"
66
+ task :install => "dpl-#{gem_version}.gem" do
67
+ Rake::FileTask[dpl_bin].invoke
68
+ end
69
+
70
+ file dpl_bin do
71
+ logger.info green("Installing dpl gem")
72
+ ruby "-S gem install dpl-#{gem_version}.gem"
73
+ end
74
+
75
+ providers.each do |provider|
76
+ desc "Write Gemfile-#{provider}"
77
+ file "Gemfile-#{provider}" do |t|
78
+ gemfile = top + t.name
79
+ logger.info green("Writing #{gemfile}")
80
+ gemfile.write %Q(source 'https://rubygems.org'\ngemspec :name => "dpl-#{provider}"\n)
81
+ end
82
+
83
+ desc %Q(Run dpl-#{provider} specs)
84
+ task "spec-#{provider}" => [:install, "Gemfile-#{provider}"] do |t|
85
+ logger.info green("Running `bundle install` for #{provider}")
86
+ # rm_rf 'stubs'
87
+ # rm_rf '.bundle'
88
+ sh 'bash', '-cl', "bundle install --gemfile=Gemfile-#{provider} --path=vendor/cache/dpl-#{provider} --retry=3 --binstubs=stubs"
89
+ logger.info green("Running specs for #{provider}")
90
+ sh "env BUNDLE_GEMFILE=Gemfile-#{provider} ./stubs/rspec spec/provider/#{provider}_spec.rb"
91
+ end
92
+
93
+ desc "Build dpl-#{provider} gem"
94
+ file "dpl-#{provider}-#{gem_version}.gem" do
95
+ logger.info green("Building dpl-#{provider} gem")
96
+ ruby "-S gem build --silent dpl-#{provider}.gemspec"
97
+ end
98
+
99
+ desc "Test dpl-#{provider} gem"
100
+ task "check-#{provider}" => [:install, "dpl-#{provider}-#{gem_version}.gem"] do
101
+ logger.info green("Installing dpl-#{provider} gem")
102
+ sh "gem install --no-post-install-message dpl-#{provider}-#{gem_version}.gem"
103
+ logger.info green("Testing dpl-#{provider} loads correctly")
104
+ ruby "-S dpl --provider=#{provider} --skip-cleanup=true --no-deploy"
105
+ end
106
+
107
+ end
10
108
 
11
- `bundle exec rspec spec/provider/#{provider}_spec.rb`
12
- end
@@ -1,3 +1,3 @@
1
1
  module DPL
2
- VERSION = '1.9.1.travis.2660.5'
2
+ VERSION = '1.9.1.travis.2666.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1.travis.2660.5
4
+ version: 1.9.1.travis.2666.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase