Created
August 21, 2012 10:37
-
-
Save dcarley/3414366 to your computer and use it in GitHub Desktop.
Upload Play modules to Artifactory Ivy repo
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
import re | |
import os | |
import pycurl | |
URL="http://xxx:8080/artifactory/play-release-local/xxx" | |
AUTH="play:xxx" | |
for local_file in os.listdir("."): | |
module, version = re.sub('\.(zip|dependencies\.yml)$', '', local_file).split("-", 1) | |
remote_file = re.sub('\.dependencies\.yml$', '-dependencies.yml', local_file) | |
c = pycurl.Curl() | |
c.setopt(pycurl.URL, "%s/%s/%s/%s" % (URL, module, version, remote_file)) | |
c.setopt(pycurl.PUT, 1) | |
c.setopt(pycurl.USERPWD, AUTH) | |
c.setopt(pycurl.READFUNCTION, open(local_file, 'rb').read) | |
c.setopt(pycurl.INFILESIZE, os.path.getsize(local_file)) | |
c.perform() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment