depengine 3.0.14 → 3.0.15
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.
- checksums.yaml +4 -4
 - data/Gemfile.lock +10 -10
 - data/depengine.gemspec +1 -1
 - data/lib/depengine/dsl/helper.rb +5 -7
 - data/lib/depengine/version.rb +1 -1
 - data/spec/helper_spec.rb +21 -0
 - metadata +5 -33
 - data/README.md +0 -58
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 7856cb152ad82d60305dcf388ed32a9c716554a5
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: f9a1bfd52156af54a3bd2f992dcc093a662baac6
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 36a81c87f987d2cf4464c4ec067d376aeeb75f08081b38f104cb92988afc8413d39cf4e51f78a1c59b96c2d9ee33ea2389ada8113fd21025f4240ece6ebf5e76
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 3620ec7a1c7ef81884a0d3b92244111898a3e820519c40e6396a31b5272ea7ee0d686761c20c1b95fc35978dd8620bc4c6b8c1b9679c36c2349d2cf66c5e3dd0
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    | 
         @@ -16,7 +16,7 @@ GEM 
     | 
|
| 
       16 
16 
     | 
    
         
             
              remote: https://rubygems.org/
         
     | 
| 
       17 
17 
     | 
    
         
             
              specs:
         
     | 
| 
       18 
18 
     | 
    
         
             
                builder (3.2.2)
         
     | 
| 
       19 
     | 
    
         
            -
                diff-lcs (1. 
     | 
| 
      
 19 
     | 
    
         
            +
                diff-lcs (1.2.5)
         
     | 
| 
       20 
20 
     | 
    
         
             
                expect4r (0.0.10)
         
     | 
| 
       21 
21 
     | 
    
         
             
                  highline (>= 1.5.0)
         
     | 
| 
       22 
22 
     | 
    
         
             
                fakefs (0.5.2)
         
     | 
| 
         @@ -40,14 +40,14 @@ GEM 
     | 
|
| 
       40 
40 
     | 
    
         
             
                rack-protection (1.5.3)
         
     | 
| 
       41 
41 
     | 
    
         
             
                  rack
         
     | 
| 
       42 
42 
     | 
    
         
             
                radius (0.7.4)
         
     | 
| 
       43 
     | 
    
         
            -
                rspec (2. 
     | 
| 
       44 
     | 
    
         
            -
                  rspec-core (~> 2. 
     | 
| 
       45 
     | 
    
         
            -
                  rspec-expectations (~> 2. 
     | 
| 
       46 
     | 
    
         
            -
                  rspec-mocks (~> 2. 
     | 
| 
       47 
     | 
    
         
            -
                rspec-core (2. 
     | 
| 
       48 
     | 
    
         
            -
                rspec-expectations (2. 
     | 
| 
       49 
     | 
    
         
            -
                  diff-lcs ( 
     | 
| 
       50 
     | 
    
         
            -
                rspec-mocks (2. 
     | 
| 
      
 43 
     | 
    
         
            +
                rspec (2.14.1)
         
     | 
| 
      
 44 
     | 
    
         
            +
                  rspec-core (~> 2.14.0)
         
     | 
| 
      
 45 
     | 
    
         
            +
                  rspec-expectations (~> 2.14.0)
         
     | 
| 
      
 46 
     | 
    
         
            +
                  rspec-mocks (~> 2.14.0)
         
     | 
| 
      
 47 
     | 
    
         
            +
                rspec-core (2.14.8)
         
     | 
| 
      
 48 
     | 
    
         
            +
                rspec-expectations (2.14.5)
         
     | 
| 
      
 49 
     | 
    
         
            +
                  diff-lcs (>= 1.1.3, < 2.0)
         
     | 
| 
      
 50 
     | 
    
         
            +
                rspec-mocks (2.14.6)
         
     | 
| 
       51 
51 
     | 
    
         
             
                sinatra (1.4.5)
         
     | 
| 
       52 
52 
     | 
    
         
             
                  rack (~> 1.4)
         
     | 
| 
       53 
53 
     | 
    
         
             
                  rack-protection (~> 1.4)
         
     | 
| 
         @@ -64,5 +64,5 @@ DEPENDENCIES 
     | 
|
| 
       64 
64 
     | 
    
         
             
              builder (~> 3.2.0)
         
     | 
| 
       65 
65 
     | 
    
         
             
              depengine!
         
     | 
| 
       66 
66 
     | 
    
         
             
              fakefs (~> 0.5)
         
     | 
| 
       67 
     | 
    
         
            -
              rspec (~> 2)
         
     | 
| 
      
 67 
     | 
    
         
            +
              rspec (~> 2.14)
         
     | 
| 
       68 
68 
     | 
    
         
             
              sinatra (~> 1.4)
         
     | 
    
        data/depengine.gemspec
    CHANGED
    
    | 
         @@ -25,7 +25,7 @@ Gem::Specification.new do |s| 
     | 
|
| 
       25 
25 
     | 
    
         
             
              s.add_dependency "radius", '~> 0.7'
         
     | 
| 
       26 
26 
     | 
    
         
             
              s.add_dependency "expect4r", '~> 0.0'
         
     | 
| 
       27 
27 
     | 
    
         | 
| 
       28 
     | 
    
         
            -
              s.add_development_dependency "rspec", "~> 2"
         
     | 
| 
      
 28 
     | 
    
         
            +
              s.add_development_dependency "rspec", "~> 2.14"
         
     | 
| 
       29 
29 
     | 
    
         
             
              s.add_development_dependency "fakefs", '~> 0.5'
         
     | 
| 
       30 
30 
     | 
    
         
             
              s.add_development_dependency "sinatra", '~> 1.4'
         
     | 
| 
       31 
31 
     | 
    
         
             
              s.add_development_dependency "builder", '~> 3.2.0'
         
     | 
    
        data/lib/depengine/dsl/helper.rb
    CHANGED
    
    | 
         @@ -72,17 +72,15 @@ module Deployment 
     | 
|
| 
       72 
72 
     | 
    
         
             
                  #   * +:deploy_email_from+ - the senders address
         
     | 
| 
       73 
73 
     | 
    
         
             
                  #   * +:deploy_email_to+ - the recipiants address
         
     | 
| 
       74 
74 
     | 
    
         
             
                  def report_by_mail(options={})
         
     | 
| 
       75 
     | 
    
         
            -
                     
     | 
| 
       76 
     | 
    
         
            -
                     
     | 
| 
       77 
     | 
    
         
            -
             
     | 
| 
       78 
     | 
    
         
            -
                    status = options[:status] || "done"
         
     | 
| 
       79 
     | 
    
         
            -
                    message = options[:message] || ""
         
     | 
| 
      
 75 
     | 
    
         
            +
                    options = @cdb.merge($recipe_config).merge(options)
         
     | 
| 
      
 76 
     | 
    
         
            +
                    options[:status] ||= 'success'
         
     | 
| 
      
 77 
     | 
    
         
            +
                    options[:message] ||= ''
         
     | 
| 
       80 
78 
     | 
    
         | 
| 
       81 
79 
     | 
    
         
             
                    mail_options = {
         
     | 
| 
       82 
80 
     | 
    
         
             
                      :from => options[:deploy_email_from] || @cdb['deploy_email_from'],
         
     | 
| 
       83 
81 
     | 
    
         
             
                      :to => options[:deploy_email_to] || @cdb['deploy_email_to'],
         
     | 
| 
       84 
     | 
    
         
            -
                      :subject => " 
     | 
| 
       85 
     | 
    
         
            -
                      :body => " 
     | 
| 
      
 82 
     | 
    
         
            +
                      :subject => "#{options[:env]} #{options[:job_name]} #{options[:module_name]} #{options[:application_name]} #{options[:version]} #{options[:status]}",
         
     | 
| 
      
 83 
     | 
    
         
            +
                      :body => "Env: #{options[:env]}\nJob: #{options[:job_name]}\nModule: #{options[:module_name]}\nApplication: #{options[:application_name]}\nVersion: #{options[:version].to_json}\n#{options[:status]}.\n\n---\nx#{options[:message]}"
         
     | 
| 
       86 
84 
     | 
    
         
             
                    }
         
     | 
| 
       87 
85 
     | 
    
         
             
                    sendmail(mail_options)
         
     | 
| 
       88 
86 
     | 
    
         
             
                  end
         
     | 
    
        data/lib/depengine/version.rb
    CHANGED
    
    
    
        data/spec/helper_spec.rb
    CHANGED
    
    | 
         @@ -124,4 +124,25 @@ describe "the report_by_mail method" do 
     | 
|
| 
       124 
124 
     | 
    
         
             
                expect {worker.report_by_mail(h)}.to_not raise_error
         
     | 
| 
       125 
125 
     | 
    
         
             
              end
         
     | 
| 
       126 
126 
     | 
    
         | 
| 
      
 127 
     | 
    
         
            +
              it "does set a subject" do
         
     | 
| 
      
 128 
     | 
    
         
            +
                worker = Deployment::Worker.new
         
     | 
| 
      
 129 
     | 
    
         
            +
                h = {
         
     | 
| 
      
 130 
     | 
    
         
            +
                  :application_name => "testapplication",
         
     | 
| 
      
 131 
     | 
    
         
            +
                  :module_name => "testmodule",
         
     | 
| 
      
 132 
     | 
    
         
            +
                  :job_name => "testjob",
         
     | 
| 
      
 133 
     | 
    
         
            +
                  :status => "SUCCESS",
         
     | 
| 
      
 134 
     | 
    
         
            +
                  :message => "i dont know what could possibly go wrong",
         
     | 
| 
      
 135 
     | 
    
         
            +
                  :deploy_email_from => "#{ENV['USER']}@localhost",
         
     | 
| 
      
 136 
     | 
    
         
            +
                  :deploy_email_to   => "#{ENV['USER']}@localhost"
         
     | 
| 
      
 137 
     | 
    
         
            +
                }
         
     | 
| 
      
 138 
     | 
    
         
            +
                expect(worker).to receive(:sendmail).once.with(
         
     | 
| 
      
 139 
     | 
    
         
            +
                  {:to => h[:deploy_email_to],
         
     | 
| 
      
 140 
     | 
    
         
            +
                   :from => h[:deploy_email_from],
         
     | 
| 
      
 141 
     | 
    
         
            +
                   :subject => "TEST testjob testmodule testapplication 42.23.0 SUCCESS",
         
     | 
| 
      
 142 
     | 
    
         
            +
                   :body => kind_of(String)
         
     | 
| 
      
 143 
     | 
    
         
            +
                 }
         
     | 
| 
      
 144 
     | 
    
         
            +
                )
         
     | 
| 
      
 145 
     | 
    
         
            +
                worker.report_by_mail(h)
         
     | 
| 
      
 146 
     | 
    
         
            +
              end
         
     | 
| 
      
 147 
     | 
    
         
            +
             
     | 
| 
       127 
148 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: depengine
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 3.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 3.0.15
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Team Automatisierung
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-07-29 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: json
         
     | 
| 
         @@ -142,14 +142,14 @@ dependencies: 
     | 
|
| 
       142 
142 
     | 
    
         
             
                requirements:
         
     | 
| 
       143 
143 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       144 
144 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       145 
     | 
    
         
            -
                    version: '2'
         
     | 
| 
      
 145 
     | 
    
         
            +
                    version: '2.14'
         
     | 
| 
       146 
146 
     | 
    
         
             
              type: :development
         
     | 
| 
       147 
147 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       148 
148 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       149 
149 
     | 
    
         
             
                requirements:
         
     | 
| 
       150 
150 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       151 
151 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       152 
     | 
    
         
            -
                    version: '2'
         
     | 
| 
      
 152 
     | 
    
         
            +
                    version: '2.14'
         
     | 
| 
       153 
153 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       154 
154 
     | 
    
         
             
              name: fakefs
         
     | 
| 
       155 
155 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -205,7 +205,6 @@ extra_rdoc_files: [] 
     | 
|
| 
       205 
205 
     | 
    
         
             
            files:
         
     | 
| 
       206 
206 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       207 
207 
     | 
    
         
             
            - Gemfile.lock
         
     | 
| 
       208 
     | 
    
         
            -
            - README.md
         
     | 
| 
       209 
208 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       210 
209 
     | 
    
         
             
            - bin/cdb_crypt
         
     | 
| 
       211 
210 
     | 
    
         
             
            - bin/de
         
     | 
| 
         @@ -309,31 +308,4 @@ rubygems_version: 2.2.2 
     | 
|
| 
       309 
308 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       310 
309 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       311 
310 
     | 
    
         
             
            summary: Depengine generator
         
     | 
| 
       312 
     | 
    
         
            -
            test_files:
         
     | 
| 
       313 
     | 
    
         
            -
            - spec/cdb_spec.rb
         
     | 
| 
       314 
     | 
    
         
            -
            - spec/demo_recipe/bin/.gitkeep
         
     | 
| 
       315 
     | 
    
         
            -
            - spec/demo_recipe/cdb/.gitkeep
         
     | 
| 
       316 
     | 
    
         
            -
            - spec/demo_recipe/config/config.properties
         
     | 
| 
       317 
     | 
    
         
            -
            - spec/demo_recipe/recipes/demo.rb
         
     | 
| 
       318 
     | 
    
         
            -
            - spec/deployhelper_spec.rb
         
     | 
| 
       319 
     | 
    
         
            -
            - spec/fileops_spec.rb
         
     | 
| 
       320 
     | 
    
         
            -
            - spec/helper_spec.rb
         
     | 
| 
       321 
     | 
    
         
            -
            - spec/junit.rb
         
     | 
| 
       322 
     | 
    
         
            -
            - spec/log_spec.rb
         
     | 
| 
       323 
     | 
    
         
            -
            - spec/properties/source/config.properties
         
     | 
| 
       324 
     | 
    
         
            -
            - spec/properties/source/random.rb
         
     | 
| 
       325 
     | 
    
         
            -
            - spec/properties/target/.gitkeep
         
     | 
| 
       326 
     | 
    
         
            -
            - spec/properties_spec.rb
         
     | 
| 
       327 
     | 
    
         
            -
            - spec/recipe_spec.rb
         
     | 
| 
       328 
     | 
    
         
            -
            - spec/repository_spec.rb
         
     | 
| 
       329 
     | 
    
         
            -
            - spec/ssh_spec.rb
         
     | 
| 
       330 
     | 
    
         
            -
            - spec/template_spec.rb
         
     | 
| 
       331 
     | 
    
         
            -
            - spec/templates/base/sub1/single.tpl
         
     | 
| 
       332 
     | 
    
         
            -
            - spec/templates/base/sub2/multi1.tpl
         
     | 
| 
       333 
     | 
    
         
            -
            - spec/templates/base/sub2/multi2.tpl
         
     | 
| 
       334 
     | 
    
         
            -
            - spec/templates/base/sub2/multi3.tpl
         
     | 
| 
       335 
     | 
    
         
            -
            - spec/templates/single.tpl
         
     | 
| 
       336 
     | 
    
         
            -
            - spec/templates/single_hash.tpl
         
     | 
| 
       337 
     | 
    
         
            -
            - spec/watchr
         
     | 
| 
       338 
     | 
    
         
            -
            - spec/zip/source/dummy.zip
         
     | 
| 
       339 
     | 
    
         
            -
            - spec/zip_spec.rb
         
     | 
| 
      
 311 
     | 
    
         
            +
            test_files: []
         
     | 
    
        data/README.md
    DELETED
    
    | 
         @@ -1,58 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # the S2 deployment-engine
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            ## Buidling the gem
         
     | 
| 
       4 
     | 
    
         
            -
            `gem build depengine.gemspec`
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
            ## Usage
         
     | 
| 
       7 
     | 
    
         
            -
              1. rvm use 2.1.1
         
     | 
| 
       8 
     | 
    
         
            -
              2. bundle install
         
     | 
| 
       9 
     | 
    
         
            -
              3. bundle exec depengine
         
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
            ## Running specs
         
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
            To run the specs, your machine needs to fulfill some requirements:
         
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
              * **mail_spec.rb**: be able to send and receive mails on localhost (e.g. install postfix on linux and set it to "local only")
         
     | 
| 
       17 
     | 
    
         
            -
              * **repository_spec.rb**: be able to SSH into your own machine via public_key_auth (e.g. putting your .ssh/id_rsa_pub in your .ssh/authorized_keys)
         
     | 
| 
       18 
     | 
    
         
            -
              * **zip_spec.rb**: have a unzip programm installed (e.g. apt-get install zip)
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
            There is a somewhat simplistic script to get a suitable environment up and running. Have a look at *bin/spec_setup*.
         
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
            `rspec`
         
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
            ## Documentation
         
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
            To see a list of all currently supported methods in the DSL, run `rake doc` and browse to: doc/table_of_contents.html#methods
         
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
            ## Example recipe
         
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
            ```
         
     | 
| 
       31 
     | 
    
         
            -
            set :application_name,         "testapp"
         
     | 
| 
       32 
     | 
    
         
            -
            set :module_name,              "testmodule"
         
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
            set :cleanup_workspace_before, ["source", "tmp"]
         
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
            set :log_level,                "INFO"
         
     | 
| 
       37 
     | 
    
         
            -
            set :log_file,                 "deploy.log"
         
     | 
| 
       38 
     | 
    
         
            -
            set :log_file_level,           "DEBUG"
         
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
            Deployment.deliver do
         
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
       42 
     | 
    
         
            -
              config = get_all_config_parameters
         
     | 
| 
       43 
     | 
    
         
            -
              $log.writer.info "Got config parameters from cdb"
         
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
              $log.writer.info "date_unique: #{date_unique}"
         
     | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
       47 
     | 
    
         
            -
              config['test_app_hosts'].each do |test_app_host|
         
     | 
| 
       48 
     | 
    
         
            -
                $log.writer.info "doing something on #{test_app_host}"
         
     | 
| 
       49 
     | 
    
         
            -
                rsync("target/", "/srv/testapp/")
         
     | 
| 
       50 
     | 
    
         
            -
                remote_execute("export JAVA_HOME=/opt/java7; cd /srv/testapp/project_#{config['env'].downcase}/current/; . ./setantenv.sh; ant;", :remote_host => test_app_host)
         
     | 
| 
       51 
     | 
    
         
            -
              end
         
     | 
| 
       52 
     | 
    
         
            -
             
     | 
| 
       53 
     | 
    
         
            -
              report_by_mail
         
     | 
| 
       54 
     | 
    
         
            -
              $log.writer.info "Sent mail to deployment team #{config['deploy_email_to']}"
         
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
       56 
     | 
    
         
            -
              $log.writer.info "Deployment done!"
         
     | 
| 
       57 
     | 
    
         
            -
            end
         
     | 
| 
       58 
     | 
    
         
            -
            ```
         
     |