project-config/playbooks/python-tarball/pre.yaml
Sean McGinnis bbd6698f7e Fix closing if block
If block using done instead of fi resulting in syntax error
on execution.

Change-Id: I31fee16fd1203c007000133b6996cf81320371f2
2018-02-13 12:35:19 -06:00

23 lines
814 B
YAML

- 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 does not exist then we leave it
# as we found it
if [ -n "$TARGET_BRANCH" ]; then
git checkout $TARGET_BRANCH || true
fi
executable: /bin/bash
chdir: "{{ zuul.projects['git.openstack.org/openstack/requirements'].src_dir }}"