diff --git a/jenkins/jobs/pypi-jobs.yaml b/jenkins/jobs/pypi-jobs.yaml index c64dc5ba94..4c4e611806 100644 --- a/jenkins/jobs/pypi-jobs.yaml +++ b/jenkins/jobs/pypi-jobs.yaml @@ -23,3 +23,4 @@ - '{name}-tarball' - '{name}-tarball-signing' - '{name}-announce-release' + - '{name}-update-constraints' \ No newline at end of file diff --git a/jenkins/jobs/release-jobs.yaml b/jenkins/jobs/release-jobs.yaml index 523496975b..437ee79415 100644 --- a/jenkins/jobs/release-jobs.yaml +++ b/jenkins/jobs/release-jobs.yaml @@ -23,3 +23,32 @@ publishers: - console-log + + +# This job runs after a repository has been tagged to update the +# upper-constraints.txt list in the openstack/requirements repository. +- job-template: + name: '{name}-update-constraints' + node: signing + + builders: + - print-template-name: + template-name: "{template-name}" + - gerrit-git-prep + - revoke-sudo + - shell: | + #!/bin/bash + + set -x + + SERIES="blah" + + # Save the version that was just tagged by parsing + # ref/tags/VALUE to get VALUE. + VERSION=$(echo $ZUUL_REF | cut -f3 -d/) + + /usr/local/jenkins/slave_scripts/release-tools/update_constraints.sh $VERSION + + publishers: + - test-results + - console-log diff --git a/jenkins/scripts/release-tools/release.sh b/jenkins/scripts/release-tools/release.sh index bcfffdfcc0..8800491aec 100755 --- a/jenkins/scripts/release-tools/release.sh +++ b/jenkins/scripts/release-tools/release.sh @@ -100,47 +100,4 @@ else $BUGS fi -# Apply the PEP 503 rules to turn the dist name into a canonical form, -# in case that's the version that appears in upper-constraints.txt. We -# have to try substituting both versions because we have a mix in that -# file and if we rename projects we'll end up with bad references to -# existing build artifacts. -function pep503 { - echo $1 | sed -e 's/[-_.]\+/-/g' | tr '[:upper:]' '[:lower:]' -} - -# Try to propose a constraints update for libraries. -if [[ $INCLUDE_PYPI == "yes" ]]; then - echo "Proposing constraints update" - # NOTE(dhellmann): If the setup_requires dependencies are not - # installed yet, running setuptools commands will install - # them. Capturing the output of a setuptools command that includes - # the output from installing packages produces a bad dist_name, so - # we first ask for the name without saving the output and then we - # ask for it again and save the output to get a clean - # version. This is why we can't have nice things. - python setup.py --name - dist_name=$(python setup.py --name) - canonical_name=$(pep503 $dist_name) - if [[ -z "$dist_name" ]]; then - echo "Could not determine the name of the constraint to update" - else - cd $MYTMPDIR - clone_repo openstack/requirements stable/$SERIES - cd openstack/requirements - git checkout -b "$dist_name-$VERSION" - sed -e "s/^${dist_name}=.*/$dist_name===$VERSION/" --in-place upper-constraints.txt - sed -e "s/^${canonical_name}=.*/$canonical_name===$VERSION/" --in-place upper-constraints.txt - if git commit -a -m "update constraint for $dist_name to new release $VERSION - -$TAGMSG -"; then - git show - git review -t 'new-release' - else - echo "Skipping git review because there are no updates." - fi - fi -fi - exit 0 diff --git a/zuul/layout.yaml b/zuul/layout.yaml index b7fe84e4bb..d761cc41dc 100755 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -717,7 +717,8 @@ project-templates: pre-release: - '{name}-tarball': - '{name}-tarball-signing' - - '{name}-pypi-both-upload' + - '{name}-pypi-both-upload': + - '{name}-update-constraints' release: - '{name}-tarball': - '{name}-tarball-signing'