Guest User

Untitled

a guest
Dec 14th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function processPackageList(tag, tagID, packageList){
  2. // We get a list of package objects for the tag, and we will construct a list of latest builds
  3.  
  4.   var packageName;
  5.  
  6.   console.log('Retrieved ' + packageList.length + ' packages for tag ' + tag);
  7.  
  8.   console.log('Building latest builds list...');
  9.  
  10.   function getLatestBuild(pkg){
  11.     packageName = pkg['package_name'];
  12.     console.log('Retrieving build for ' + packageName);
  13.     var client = xmlrpc.createClient({ host:  'someurl', port: 80, path: '/brewhub'});
  14.     client.methodCall('getLatestBuilds', [tag, {'__starstar': 1, 'package': packageName}], function (error, value){
  15.       if (value.length == 1){
  16.         latestPackages.push({'packageName': packageName, 'nvr': value[0]['nvr']});
  17.         console.log('Adding Build info for ' + packageName);
  18.       }
  19.     });
  20.   }
  21.   async.forEach(packageList, getLatestBuild, function(err){getBuilds()});    
  22. }
Add Comment
Please, Sign In to add comment