knife-org-utils 1.1.1.beta.57.1 → 1.1.1.beta.58.1
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 +8 -8
 - data/bin/migrate +40 -0
 - metadata +2 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            !binary "U0hBMQ==":
         
     | 
| 
       3 
3 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
      
 4 
     | 
    
         
            +
                MTk1OTJlNmMwZmU4YjM0MjgyYzcxZGNmNzI4N2QzZmI0ZGRjMWZhNA==
         
     | 
| 
       5 
5 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                ZWY1ZWVmMGY5MmRhZWNjZDEzZjhhNGJhODgzOTVmYTQ2ODk1MzViNw==
         
     | 
| 
       7 
7 
     | 
    
         
             
            SHA512:
         
     | 
| 
       8 
8 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
      
 9 
     | 
    
         
            +
                MmFiZjQ5ZDI2NGExNDcwN2ZlOTM2ZjFkNTVjZGNmY2EwN2ZhNTJmMWEwMmE5
         
     | 
| 
      
 10 
     | 
    
         
            +
                ZmUzZmExMDdlYjEyMDg0ZGMyNjk5MGUyYzU5ZGRhZWE1NjI3YTQ1ZDdmOGZl
         
     | 
| 
      
 11 
     | 
    
         
            +
                ZGUyZjRhYjA4MWU0YjZhNzIxMzA1MjgxMWMyYWQ0NTk4MTYyNGY=
         
     | 
| 
       12 
12 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                 
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 13 
     | 
    
         
            +
                MmI1MjUzNDAyYjc1MmIzMzhiNzNkZDBiNTJjNzlmYzNhN2EyZWYzMGJlYWUz
         
     | 
| 
      
 14 
     | 
    
         
            +
                ZWJhMDI4YmMyN2ExNDAwNjEwNjUwMjk3MjllYTg5Zjk0YzhiMzNjMjBlYjAx
         
     | 
| 
      
 15 
     | 
    
         
            +
                NzdiYTUyY2Y3MDEyMTc5M2YwY2MxMDg2YmQ4ZWY4NjM1NjU4NGQ=
         
     | 
    
        data/bin/migrate
    ADDED
    
    | 
         @@ -0,0 +1,40 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #! /usr/bin/env ruby
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require 'git'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            def git
         
     | 
| 
      
 6 
     | 
    
         
            +
              Git.open( '/tmp/chef-repo/.chef' )
         
     | 
| 
      
 7 
     | 
    
         
            +
            end
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            def get_branches
         
     | 
| 
      
 10 
     | 
    
         
            +
              branches = git.branches.local.map do | branch |
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                branch.name
         
     | 
| 
      
 13 
     | 
    
         
            +
              end
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
              branches.reject do | branch |
         
     | 
| 
      
 16 
     | 
    
         
            +
                branch == 'master'
         
     | 
| 
      
 17 
     | 
    
         
            +
              end
         
     | 
| 
      
 18 
     | 
    
         
            +
            end
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            def backup
         
     | 
| 
      
 21 
     | 
    
         
            +
              src = File.expand_path( '~' )
         
     | 
| 
      
 22 
     | 
    
         
            +
              dest = '/tmp/chef-repo'
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
              fail "#{src}/.chef not found" unless File.directory? "#{src}/.chef"
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
              FileUtils.rm_rf dest
         
     | 
| 
      
 27 
     | 
    
         
            +
              FileUtils.mkpath dest
         
     | 
| 
      
 28 
     | 
    
         
            +
              FileUtils.mv( "#{src}/.chef", "#{dest}/.chef" )
         
     | 
| 
      
 29 
     | 
    
         
            +
            end
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            backup
         
     | 
| 
      
 32 
     | 
    
         
            +
            branches = get_branches
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
            branches.each do | branch |
         
     | 
| 
      
 35 
     | 
    
         
            +
              puts "Adding #{branch}"
         
     | 
| 
      
 36 
     | 
    
         
            +
              git.branch( branch ).checkout
         
     | 
| 
      
 37 
     | 
    
         
            +
              `knife switch add /tmp/chef-repo --overwrite`
         
     | 
| 
      
 38 
     | 
    
         
            +
            end
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
            `knife switch #{branches.first}`
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: knife-org-utils
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.1.1.beta. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.1.1.beta.58.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Venkat Venkataraju
         
     | 
| 
         @@ -82,6 +82,7 @@ extensions: [] 
     | 
|
| 
       82 
82 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       83 
83 
     | 
    
         
             
            files:
         
     | 
| 
       84 
84 
     | 
    
         
             
            - README.md
         
     | 
| 
      
 85 
     | 
    
         
            +
            - bin/migrate
         
     | 
| 
       85 
86 
     | 
    
         
             
            - lib/chef/knife/info.rb
         
     | 
| 
       86 
87 
     | 
    
         
             
            - lib/chef/knife/switch.rb
         
     | 
| 
       87 
88 
     | 
    
         
             
            - lib/chef/knife/switch_add.rb
         
     |