gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r583043 - /gump/trunk/python/gump/actor/mvnrepoproxy/proxycontrol.py
Date Tue, 09 Oct 2007 04:26:46 GMT
Author: bodewig
Date: Mon Oct  8 21:26:43 2007
New Revision: 583043

URL: http://svn.apache.org/viewvc?rev=583043&view=rev
Log:
publish artifacts to mvn repository proxy

Modified:
    gump/trunk/python/gump/actor/mvnrepoproxy/proxycontrol.py

Modified: gump/trunk/python/gump/actor/mvnrepoproxy/proxycontrol.py
URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/actor/mvnrepoproxy/proxycontrol.py?rev=583043&r1=583042&r2=583043&view=diff
==============================================================================
--- gump/trunk/python/gump/actor/mvnrepoproxy/proxycontrol.py (original)
+++ gump/trunk/python/gump/actor/mvnrepoproxy/proxycontrol.py Mon Oct  8 21:26:43 2007
@@ -35,11 +35,33 @@
             % (run.getWorkspace().mvnRepoProxyPort)
         self.java = javaCommand
 
+    def processProject(self,project):
+        """
+        Process a project (i.e. publish it's artifacts to the proxy)
+        """
+
+        if project.okToPerformWork() and project.hasOutputs():
+            groupId = project.getArtifactGroup()
+            for output in project.getOutputs():
+                fileName = os.path.abspath(output.getPath())
+                try:
+                    log.info('Publishing \'%s\' to proxy' % (fileName))
+                    self.publish(groupId, output.getId(), fileName)
+                except:
+                    log.error('Failed to publish \'%s\' to proxy' % (fileName),
+                              exc_info=1)
+
     def processOtherEvent(self, event):
         if isinstance(event, InitializeRunEvent):
             self.spawnProxy()
         elif isinstance(event, FinalizeRunEvent):
             self.saveLogAndStop()
+
+    def publish(self, groupId, artifactId, fileName):
+        urllib.urlopen(self.proxyURL + 'addartifact',
+                       urllib.urlencode({'groupId': groupId,
+                                         'artifactId': artifactId,
+                                         'file': fileName}))
 
     def spawnProxy(self):
         log.info('Starting mvn repository proxy')



Mime
View raw message