1
votes

I'm trying to put a zip file on artifactory. I'm using 'repositorytools' package and this is how I'm doing it;

try:
    local_path = os.path.join(os.getcwd(), "sample-0.1.0.zip")

    artifact = repositorytools.LocalArtifact(local_path=local_path, 
    group='widgets', artifact='sample')

    client = repositorytools.repository_client_factory(user='user', 
    password='pw')

    remote_artifacts = client.upload_artifacts(local_artifacts=
    [artifact],repo_id='https://artifacts.zeki.com/zeki-development/')

    print(remote_artifacts)

except Exception as e:
    print colored(("Exception has occurred of type: {} with def: 
    {}".format(type(e), e)), 'red')

Well all I'm getting this annoying error;

Exception has occurred of type: with def: HTTPSConnectionPool(host='repository', port=443): Max retries exceeded with url: /service/local/artifact/maven/content (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))

So, i tried couple of ways to overcome like increasing retry count but nothing seemed to work. Any ideas?

Thx

1
What about the url itself- http vs https? - etemple1
It's working on browser. Also I've another script (written in gradle) and it's fine. There must be something wrong with the requests package. - stdout
Your other script successfully makes the request with the identical (https) url you have shared above? - etemple1

1 Answers

0
votes

repo_id should be only 'zeki-development'.

You need to export environment variable REPOSITORY_URL with value https://artifacts.zeki.com or better pass that value to repository_url parameter of repository_client_factor

``

so it can look like this:

client = repositorytools.repository_client_factory(repository_url='https://artifacts.zeki.com', user='user', password='pw')