I discovered the problem. Sometimes, sleep is the best solution form some problems
I was doing:
for artifact in artifacts:
if not artifact.name in contents:
contents.append(artifact.name)
with ZipFile('deploy.zip', 'w') as deploy:
if os.path.isfile(artifact.source):
deploy.write(artifact.source, artifact.target)
else:
for base, dirs, files in os.walk(artifact.source):
for file_ in files:
source = os.path.join(base, file_)
target = os.path.join(base[base.index(artifact.target):], file_)
deploy.write(source, target)
But for every iteration in the artifacts close and open a new deploy.zip
file.
The right way to do this is:
with ZipFile('deploy.zip', 'w') as deploy:
for artifact in artifacts:
if not artifact.name in contents:
contents.append(artifact.name)
if os.path.isfile(artifact.source):
deploy.write(artifact.source, artifact.target)
else:
for base, dirs, files in os.walk(artifact.source):
for file_ in files:
source = os.path.join(base, file_)
target = os.path.join(base[base.index(artifact.target):], file_)
deploy.write(source, target)
And everything works as expected.
Thank you very much for everyone that tried to help. Next time i will post the full source code or at last, some lines more. :)