Created
          November 23, 2011 18:51 
        
      - 
      
 - 
        
Save commuterjoy/1389530 to your computer and use it in GitHub Desktop.  
    Rake task to list the latest test RPMs that can be deployed to stage
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | desc "list the latest test RPMs that can be deployed to stage" | |
| task :releasable do | |
| packages = ['bbc-pal-tabloid', 'bbc-pal-library-berliner', 'bbc-pal-library-news-core', 'bbc-pal-newspopular', 'bbc-pal-jibbajabba'] | |
| repo = 'bbc-test' | |
| info = `yum info #{packages.join(' ')} --verbose --enablerepo=#{repo} | egrep '(Name)|(^Version)|(Arch)|(Release)|(Buildtime)|(^$)'` | |
| rpm = {} | |
| info.split(/\n/).each do |line| | |
| tokens = line.split(/:/) | |
| rpm[tokens[0].strip!.downcase!] = tokens[1].strip! if tokens.length > 0 | |
| if line =~ /Release/ then | |
| puts "%s-%s-%s.%s.rpm" % [rpm['name'], rpm['version'], rpm['release'], rpm['arch']] | |
| rpm = {} | |
| end | |
| end | |
| puts "\n-----------\n#{info}" | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment