From 74df19df6b5c93ae3d951f461b937709e083484c Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Wed, 4 Oct 2017 13:24:56 -0400 Subject: [PATCH] Refactor tox to use the role This patch switches tox usage to use the new role as well uses Ansible to move build output. Change-Id: Ie01e96edac1e1fd9e7f0a3e2d6b39f813a561aa2 --- roles/build-releasenotes/tasks/main.yaml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/roles/build-releasenotes/tasks/main.yaml b/roles/build-releasenotes/tasks/main.yaml index 517fc9f7..76e57308 100644 --- a/roles/build-releasenotes/tasks/main.yaml +++ b/roles/build-releasenotes/tasks/main.yaml @@ -1,4 +1,3 @@ -# TODO(mordred) This needs to be reworked to use the tox role # TODO(mordred) Put the translations logic into a sphinx plugin? - name: Build releasenotes contents shell: @@ -11,8 +10,6 @@ DOCNAME=releasenotes DIRECTORY=releasenotes - script_path=/usr/local/jenkins/slave_scripts - # Mapping of language codes to language names declare -A LANG_NAME=( ["de"]="German" @@ -30,12 +27,6 @@ ["zh_CN"]="Chinese (China)" ) - # This file always exists in OpenStack CI jobs, check for it so that - # it can be used manually as well. - if [ -e "$HOME/src/git.openstack.org/openstack/requirements/upper-constraints.txt" ]; then - export UPPER_CONSTRAINTS_FILE=$HOME/src/git.openstack.org/openstack/requirements/upper-constraints.txt - fi - if [ -e ${DIRECTORY}/source/locale/ ]; then # Check that locale_dirs is really set, otherwise translations # will not work. @@ -119,8 +110,14 @@ rm -f ${DIRECTORY}/source/locale/*.pot fi - # Now build releasenotes with reference to translations - $script_path/run-tox.sh releasenotes +- name: Build release notes + include_role: + name: tox + vars: + tox_constraints_file: "{{ ansible_user_dir }}/src/git.openstack.org/openstack/requirements/upper-constraints.txt" + tox_envlist: releasenotes - # Move the built output into doc/build so that other roles can work well - mv ${DIRECTORY}/build doc +- name: Move build output to correct path for publishers + command: mv releasenotes/build doc + args: + chdir: "{{ zuul_work_dir }}"