- hosts: all
  roles:
    - bindep
    - ensure-tox
    - revoke-sudo

- hosts: all
  roles:
    - bindep
    - ensure-tox
    - revoke-sudo
  tasks:
    - name: Checkout requirements branch for tag
      shell:
        cmd: |
          set -x
          # See if the tag appears on a stable branch
          TARGET_BRANCH=`git -C \
              {{ ansible_user_dir }}/{{ zuul.project.src_dir }} branch -a \
              --contains {{ zuul.ref }} | grep ' stable/' | sort | head -n1`
          # And if it does, then try to check out the same branch of the
          # requirements repo, but if that doesn't exist then we leave it
          # as we found it
          if [ -n "$TARGET_BRANCH" ]; then
              git checkout $TARGET_BRANCH || true
          done
        executable: /bin/bash
        chdir: "{{ zuul.projects['git.openstack.org/openstack/requirements'].src_dir }}"

Use correct requirements branch for tags
Use correct requirements branch for tags

When translating our release artifact jobs to Zuul v3, we missed the
bit from I806062dd24f9dbd2b98cafd32c08bb524e73c5ac where we used to
guess the matching branch for a given tag so we could apply the
correct version of the upper-constraints.txt file for stable point
releases. Add that back in so we stop building stable release
tarballs using master constraints.

Change-Id: I744d6db4a2f98647d071f7f3660dfa764ec046fc
