Skip to content

Commit

Permalink
Problem: python client publishes bad version string
Browse files Browse the repository at this point in the history
Solution: use commit count instead of hash

This patch also makes the same change for the Ruby Gem being published.

re: #4694
https://pulp.plan.io/issues/4694
  • Loading branch information
dkliban committed May 2, 2019
1 parent 088123c commit f0f01f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .travis/publish_pulpcore_client_gem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ django-admin runserver 24817 >> ~/django_runserver.log 2>&1 &
sleep 5

cd /home/travis/build/pulp/pulpcore/
COMMIT_SHA="$(git rev-parse HEAD | cut -c1-8)"
export COMMIT_SHA
export REPORTED_VERSION=$(http :24817/pulp/api/v3/status/ | jq --arg plugin pulpcore -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 pulpcore ruby $COMMIT_SHA
sudo ./generate.sh pulpcore ruby $VERSION
sudo chown travis:travis pulpcore-client
cd pulpcore-client
gem build pulpcore_client
Expand Down
7 changes: 4 additions & 3 deletions .travis/publish_pulpcore_client_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ django-admin runserver 24817 >> ~/django_runserver.log 2>&1 &
sleep 5

cd /home/travis/build/pulp/pulpcore/
COMMIT_SHA="$(git rev-parse HEAD | cut -c1-8)"
export COMMIT_SHA
export REPORTED_VERSION=$(http :24817/pulp/api/v3/status/ | jq --arg plugin pulpcore -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 pulpcore python $COMMIT_SHA
sudo ./generate.sh pulpcore python $VERSION
sudo chown -R travis:travis pulpcore-client
cd pulpcore-client
python setup.py sdist bdist_wheel --python-tag py3
Expand Down

0 comments on commit f0f01f0

Please sign in to comment.