jazzband / django-hosts

Dynamic and static host resolving for Django. Maps hostnames to URLconfs.
http://django-hosts.rtfd.org
Other
982 stars 106 forks source link

Adjust travis configuration to make the deployment to PyPI happen only once per build #47

Closed bak1an closed 8 years ago

bak1an commented 8 years ago

At the moment every build in matrix (for tagged commits of course) attempts to do the deployment.

Example: https://travis-ci.org/jazzband/django-hosts/builds/96972410

As we can see #101.1 has deployed the release to PyPI, while other six builds in the matrix failed to do so with:

Uploading distributions to https://pypi.python.org/pypi
Uploading django_hosts-1.3-py2.py3-none-any.whl
HTTPError: 400 Client Error: A file named "django_hosts-1.3-py2.py3-none-any.whl" already exists for  django-hosts-1.3. To fix problems with that file you should create a new release. for url: https://pypi.python.org/pypi

This seems to be easy to fix using conditional releases. We just need to select one tox env that will be responsible for deploying.

More accurate solution would be to deploy only when all builds are finished. However, I have not found the solution for this yet.

The similar procedure can be done for other repositories under jazzband.

jezdez commented 8 years ago

Good catch!

jezdez commented 8 years ago

Sadly this seems to be a side effect of the way we use tox on Travis-CI and I'm not sure if they would ever add a "all-passed" condition since the conditions are evaluated per environment.

bak1an commented 8 years ago

Yeah, it seems that there are no easy solution to this. People are doing hacks for this but I am not sure if it is worth it in this particular case.

bak1an commented 8 years ago

Most likely the person that is about to push a new release is going to spin off the tox command locally before creating tag anyway.

jezdez commented 8 years ago

Ough, messy. I'd rather not have to maintain a big Travis config, to be honest, so we'll have to live with the imperfect. We can revisit when Travis-CI has fixed this.