Skip to content

Commit

Permalink
Problem: pulp_file-client not being published to PyPI
Browse files Browse the repository at this point in the history
Solution: configure Travis to publish pulp_file-client to PyPI

This also limits how frequently the pulp_file_client Ruby Gem is published.

re: #4694
https://pulp.plan.io/issues/4694
  • Loading branch information
dkliban committed May 2, 2019
1 parent 885d41b commit 33fcaad
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,12 @@ jobs:
env:
- DB=postgres
- TEST=bindings
if: type = cron

- stage: publish-pulpcore-client-pypi
script: bash .travis/publish_pulp_file_client_pypi.sh
env:
- DB=postgres
- TEST=bindings
- secure: "yXuO+vGRukhx4MXOx/Hcy9nJ/pDeg1va4kRt0nOxhCQtF7199SBdE0hKSwLEmWg7Dy1eMo6ofeCdH28QnvQHz941Pg9iO42g9raq2hzzJ3OnJz0+vkwTNAbfHOy03mf9rRiA1tbdhrMVRgMnJAUNLG0QOqU0uPJvRMVZdCdKWBmMJXOPX8oaa4KFqQuM5X+Vb2YBnCoeS65KW9CcoLT4tkNE0DlxyZh5v4EDS5s0vTtbAXtsqAzXBo5f30PYZKmVnTmnV1nVjISRo1+j/06sI7LknyqP+8kHCaDlBRbOVCf017EcA85dowAq5lCzv9kpB5y5ZaaD78nVdyh9yyttEOI6J7c0JRIMlLlgk8H1D0xZv9M3Jy4OZ/6aSxFZVU4whOtdx9qQjCruUH7vLDgJVy/q4Dpham3WQPm0JGKSmZAqA+4bL/M76qOHgaSxOZ//ezhwMwCsMQp8WqC73WmAEPty/X9lJHFMAKjF7A78X0lC6S3bNdWr1oHLBSkGufHUFs3gxJepefLMQajXHU70jn7uXbo4g3O2oFE3zdvNB2CNH3cv8gO/Jqrkc1kv69ADh2fb23MJ/aIL1yRzbJm8lwVsdo3ey1WE0QWKGVXGOZXZ69CiDcBf0t/ulWk/hyT1yC0POVN/D1oZfukY7vreBcaNNqd9zJc5rJwiRR0PAZ8="
if: type != pull_request
22 changes: 22 additions & 0 deletions .travis/publish_pulp_file_client_pypi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

pip install twine

django-admin runserver 24817 >> ~/django_runserver.log 2>&1 &
sleep 5

cd /home/travis/build/pulp/pulp_file/
export REPORTED_VERSION=$(http :24817/pulp/api/v3/status/ | jq --arg plugin pulp_file -r '.versions[] | select(.component == $plugin) | .version')
export COMMIT_COUNT="$(git rev-list ${REPORTED_VERSION}^..HEAD | wc -l)"
export VERSION=${REPORTED_VERSION}.dev.${COMMIT_COUNT}

cd
git clone https://github.com/pulp/pulp-swagger-codegen.git
cd pulp-swagger-codegen

sudo ./generate.sh pulp_file python $VERSION
sudo chown -R travis:travis pulp_file-client
cd pulp_file-client
python setup.py sdist bdist_wheel --python-tag py3
twine upload dist/* -u pulp -p $PYPI_PASSWORD
exit $?

0 comments on commit 33fcaad

Please sign in to comment.