ey-deploy 1.1.1 → 1.1.2
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.
- data/lib/ey-deploy/deploy.rb +1 -1
 - data/lib/ey-deploy/strategies/git.rb +15 -2
 - data/lib/ey-deploy/version.rb +1 -1
 - data/spec/integration_spec.rb +50 -0
 - metadata +6 -4
 
    
        data/lib/ey-deploy/deploy.rb
    CHANGED
    
    | 
         @@ -225,7 +225,7 @@ module EY 
     | 
|
| 
       225 
225 
     | 
    
         
             
                      cmd << " --framework-env '#{c.environment}'"
         
     | 
| 
       226 
226 
     | 
    
         
             
                      cmd << " --current-role '#{server.role}'"
         
     | 
| 
       227 
227 
     | 
    
         
             
                      cmd << " --current-name '#{server.name}'" if server.name
         
     | 
| 
       228 
     | 
    
         
            -
                      cmd << " --config '#{c 
     | 
| 
      
 228 
     | 
    
         
            +
                      cmd << " --config '#{c[:config]}'" if c.has_key?(:config)
         
     | 
| 
       229 
229 
     | 
    
         
             
                      cmd
         
     | 
| 
       230 
230 
     | 
    
         
             
                    end
         
     | 
| 
       231 
231 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -59,7 +59,12 @@ module EY 
     | 
|
| 
       59 
59 
     | 
    
         | 
| 
       60 
60 
     | 
    
         
             
                  def checkout
         
     | 
| 
       61 
61 
     | 
    
         
             
                    info "~> Deploying revision #{short_log_message(to_checkout)}"
         
     | 
| 
       62 
     | 
    
         
            -
                     
     | 
| 
      
 62 
     | 
    
         
            +
                    in_git_work_tree do
         
     | 
| 
      
 63 
     | 
    
         
            +
                      (logged_system("git checkout -q '#{to_checkout}'") ||
         
     | 
| 
      
 64 
     | 
    
         
            +
                        logged_system("git reset -q --hard '#{to_checkout}'")) &&
         
     | 
| 
      
 65 
     | 
    
         
            +
                        logged_system("git submodule update --init") &&
         
     | 
| 
      
 66 
     | 
    
         
            +
                        logged_system("git clean -dfq")
         
     | 
| 
      
 67 
     | 
    
         
            +
                    end
         
     | 
| 
       63 
68 
     | 
    
         
             
                  end
         
     | 
| 
       64 
69 
     | 
    
         | 
| 
       65 
70 
     | 
    
         
             
                  def to_checkout
         
     | 
| 
         @@ -81,8 +86,16 @@ module EY 
     | 
|
| 
       81 
86 
     | 
    
         
             
                  end
         
     | 
| 
       82 
87 
     | 
    
         | 
| 
       83 
88 
     | 
    
         
             
                private
         
     | 
| 
      
 89 
     | 
    
         
            +
                  def in_git_work_tree
         
     | 
| 
      
 90 
     | 
    
         
            +
                    Dir.chdir(git_work_tree) { yield }
         
     | 
| 
      
 91 
     | 
    
         
            +
                  end
         
     | 
| 
      
 92 
     | 
    
         
            +
             
     | 
| 
      
 93 
     | 
    
         
            +
                  def git_work_tree
         
     | 
| 
      
 94 
     | 
    
         
            +
                    opts[:repository_cache]
         
     | 
| 
      
 95 
     | 
    
         
            +
                  end
         
     | 
| 
      
 96 
     | 
    
         
            +
             
     | 
| 
       84 
97 
     | 
    
         
             
                  def git
         
     | 
| 
       85 
     | 
    
         
            -
                    "git --git-dir #{ 
     | 
| 
      
 98 
     | 
    
         
            +
                    "git --git-dir #{git_work_tree}/.git --work-tree #{git_work_tree}"
         
     | 
| 
       86 
99 
     | 
    
         
             
                  end
         
     | 
| 
       87 
100 
     | 
    
         | 
| 
       88 
101 
     | 
    
         
             
                  def branch?(ref)
         
     | 
    
        data/lib/ey-deploy/version.rb
    CHANGED
    
    
| 
         @@ -0,0 +1,50 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require File.dirname(__FILE__) + '/spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe "deploying an application" do
         
     | 
| 
      
 4 
     | 
    
         
            +
              module EY::Strategies::IntegrationSpec::Helpers
         
     | 
| 
      
 5 
     | 
    
         
            +
                def update_repository_cache
         
     | 
| 
      
 6 
     | 
    
         
            +
                end
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                def create_revision_file_command
         
     | 
| 
      
 9 
     | 
    
         
            +
                end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                def short_log_message(revision)
         
     | 
| 
      
 12 
     | 
    
         
            +
                  
         
     | 
| 
      
 13 
     | 
    
         
            +
                end
         
     | 
| 
      
 14 
     | 
    
         
            +
                
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              class FullTestDeploy < EY::Deploy
         
     | 
| 
      
 18 
     | 
    
         
            +
                def initialize(*)
         
     | 
| 
      
 19 
     | 
    
         
            +
                  super
         
     | 
| 
      
 20 
     | 
    
         
            +
                  @infos = []
         
     | 
| 
      
 21 
     | 
    
         
            +
                  @debugs = []
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                # stfu
         
     | 
| 
      
 25 
     | 
    
         
            +
                def info(msg)
         
     | 
| 
      
 26 
     | 
    
         
            +
                  @infos << msg
         
     | 
| 
      
 27 
     | 
    
         
            +
                end
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
                # no really, stfu
         
     | 
| 
      
 30 
     | 
    
         
            +
                def debug(msg)
         
     | 
| 
      
 31 
     | 
    
         
            +
                  @debugs << msg
         
     | 
| 
      
 32 
     | 
    
         
            +
                end
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                # passwordless sudo is neither guaranteed nor desired
         
     | 
| 
      
 35 
     | 
    
         
            +
                def sudo(cmd)
         
     | 
| 
      
 36 
     | 
    
         
            +
                  run(cmd)
         
     | 
| 
      
 37 
     | 
    
         
            +
                end
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
                def restart
         
     | 
| 
      
 40 
     | 
    
         
            +
                  # do nothing
         
     | 
| 
      
 41 
     | 
    
         
            +
                end
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
              end
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
              before(:each) do
         
     | 
| 
      
 46 
     | 
    
         
            +
                # set up EY::Server
         
     | 
| 
      
 47 
     | 
    
         
            +
                # run a deploy
         
     | 
| 
      
 48 
     | 
    
         
            +
              end
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,13 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: ey-deploy
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              hash:  
     | 
| 
      
 4 
     | 
    
         
            +
              hash: 23
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       6 
6 
     | 
    
         
             
              segments: 
         
     | 
| 
       7 
7 
     | 
    
         
             
              - 1
         
     | 
| 
       8 
8 
     | 
    
         
             
              - 1
         
     | 
| 
       9 
     | 
    
         
            -
              -  
     | 
| 
       10 
     | 
    
         
            -
              version: 1.1. 
     | 
| 
      
 9 
     | 
    
         
            +
              - 2
         
     | 
| 
      
 10 
     | 
    
         
            +
              version: 1.1.2
         
     | 
| 
       11 
11 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       12 
12 
     | 
    
         
             
            authors: 
         
     | 
| 
       13 
13 
     | 
    
         
             
            - EY Cloud Team
         
     | 
| 
         @@ -15,7 +15,7 @@ autorequire: 
     | 
|
| 
       15 
15 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       16 
16 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
            date: 2010-08- 
     | 
| 
      
 18 
     | 
    
         
            +
            date: 2010-08-11 00:00:00 -07:00
         
     | 
| 
       19 
19 
     | 
    
         
             
            default_executable: ey-deploy
         
     | 
| 
       20 
20 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
         @@ -240,6 +240,7 @@ files: 
     | 
|
| 
       240 
240 
     | 
    
         
             
            - spec/fixtures/invalid_hook.rb
         
     | 
| 
       241 
241 
     | 
    
         
             
            - spec/fixtures/valid_hook.rb
         
     | 
| 
       242 
242 
     | 
    
         
             
            - spec/git_strategy_spec.rb
         
     | 
| 
      
 243 
     | 
    
         
            +
            - spec/integration_spec.rb
         
     | 
| 
       243 
244 
     | 
    
         
             
            - spec/lockfile_parser_spec.rb
         
     | 
| 
       244 
245 
     | 
    
         
             
            - spec/spec_helper.rb
         
     | 
| 
       245 
246 
     | 
    
         
             
            - spec/support/lockfiles/0.9-no-bundler
         
     | 
| 
         @@ -289,6 +290,7 @@ test_files: 
     | 
|
| 
       289 
290 
     | 
    
         
             
            - spec/fixtures/invalid_hook.rb
         
     | 
| 
       290 
291 
     | 
    
         
             
            - spec/fixtures/valid_hook.rb
         
     | 
| 
       291 
292 
     | 
    
         
             
            - spec/git_strategy_spec.rb
         
     | 
| 
      
 293 
     | 
    
         
            +
            - spec/integration_spec.rb
         
     | 
| 
       292 
294 
     | 
    
         
             
            - spec/lockfile_parser_spec.rb
         
     | 
| 
       293 
295 
     | 
    
         
             
            - spec/spec_helper.rb
         
     | 
| 
       294 
296 
     | 
    
         
             
            - spec/support/lockfiles/0.9-no-bundler
         
     |