update repo-build for ansible 2.1 compat

This change updates the repo-build process to be ansible2.1
compatible. The change is needed because the if statements in the
sting cause a \\ to exist if the variables are not used. To resolve
this issue the entry to the shell call has been changed to a folding
style instead of a literal style which will no longer generate the \\.

A change was also need in the op-venv script where we rely on a bash
script to build all of the venvs based on input provided by a folding
style string. Within Ansible 2.x the folding string type may have a \n
on the end which will break direct bash bash functions.

Change-Id: I394ab60f5505a45cf39b1efce1016dad9332be78
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2016-03-30 19:29:57 -05:00
parent c316b1ed52
commit d9154a3a9d
3 changed files with 32 additions and 33 deletions

View File

@ -74,7 +74,6 @@ repo_build_venv_command_options: >
--always-copy
--extra-search-dir {{ repo_build_release_path }}/{{ repo_build_release_tag }}
--never-download
repo_pip_packages:
- wheel
- virtualenv

View File

@ -14,41 +14,41 @@
# limitations under the License.
- name: Create OpenStack global requirements wheels
shell: |
pip wheel --timeout {{ repo_build_timeout }} \
--wheel-dir {{ repo_build_output }} \
--find-links {{ repo_build_global_links_path }} \
--find-links {{ repo_build_output }} \
--constraint {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_constraints.txt \
{% if repo_build_pip_default_index is defined %}--index-url {{ repo_build_pip_default_index }} \
--trusted-host {{ repo_build_pip_default_index | netloc_no_port }} \{% endif %}
{% if repo_build_pip_extra_index is defined %}--extra-index-url {{ repo_build_pip_extra_index }} \
--trusted-host {{ repo_build_pip_extra_index | netloc_no_port }} \{% endif %}
{% if repo_build_pip_extra_indexes is defined %}--extra-index-url {{ repo_build_pip_extra_indexes | join(' --extra-index-url ') }} \
--trusted-host {{ repo_build_pip_extra_indexes | map('netloc_no_port') | join(' --trusted-host ') }} \{% endif %}
--build {{ repo_build_dir }} \
--log /var/log/repo/repo_builder.log \
--requirement {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_global_requirements.txt
shell: >
pip wheel --timeout {{ repo_build_timeout }}
--wheel-dir {{ repo_build_output }}
--find-links {{ repo_build_global_links_path }}
--find-links {{ repo_build_output }}
--constraint {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_constraints.txt
{% if repo_build_pip_default_index is defined %}--index-url {{ repo_build_pip_default_index }}
--trusted-host {{ repo_build_pip_default_index | netloc_no_port }} {% endif %}
{% if repo_build_pip_extra_index is defined %}--extra-index-url {{ repo_build_pip_extra_index }}
--trusted-host {{ repo_build_pip_extra_index | netloc_no_port }} {% endif %}
{% if repo_build_pip_extra_indexes is defined %}--extra-index-url {{ repo_build_pip_extra_indexes | join(' --extra-index-url ') }}
--trusted-host {{ repo_build_pip_extra_indexes | map('netloc_no_port') | join(' --trusted-host ') }} {% endif %}
--build {{ repo_build_dir }}
--log /var/log/repo/repo_builder.log
--requirement {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_global_requirements.txt
tags:
- repo-build-global-requirement-wheels
- repo-build-openstack-ansible-requirement-wheels
- name: Create OpenStack-Ansible requirement wheels
shell: |
pip wheel --timeout {{ repo_build_timeout }} \
--wheel-dir {{ repo_build_output }} \
--find-links {{ repo_build_global_links_path }} \
--find-links {{ repo_build_output }} \
--constraint {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_constraints.txt \
{% if repo_build_pip_default_index is defined %}--index-url {{ repo_build_pip_default_index }} \
--trusted-host {{ repo_build_pip_default_index | netloc_no_port }} \{% endif %}
{% if repo_build_pip_extra_index is defined %}--extra-index-url {{ repo_build_pip_extra_index }} \
--trusted-host {{ repo_build_pip_extra_index | netloc_no_port }} \{% endif %}
{% if repo_build_pip_extra_indexes is defined %}--extra-index-url {{ repo_build_pip_extra_indexes | join(' --extra-index-url ') }} \
--trusted-host {{ repo_build_pip_extra_indexes | map('netloc_no_port') | join(' --trusted-host ') }} \{% endif %}
--build {{ repo_build_dir }} \
--log /var/log/repo/repo_builder.log \
--requirement {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_local_filtered.txt
shell: >
pip wheel --timeout {{ repo_build_timeout }}
--wheel-dir {{ repo_build_output }}
--find-links {{ repo_build_global_links_path }}
--find-links {{ repo_build_output }}
--constraint {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_constraints.txt
{% if repo_build_pip_default_index is defined %}--index-url {{ repo_build_pip_default_index }}
--trusted-host {{ repo_build_pip_default_index | netloc_no_port }} {% endif %}
{% if repo_build_pip_extra_index is defined %}--extra-index-url {{ repo_build_pip_extra_index }}
--trusted-host {{ repo_build_pip_extra_index | netloc_no_port }} {% endif %}
{% if repo_build_pip_extra_indexes is defined %}--extra-index-url {{ repo_build_pip_extra_indexes | join(' --extra-index-url ') }}
--trusted-host {{ repo_build_pip_extra_indexes | map('netloc_no_port') | join(' --trusted-host ') }} {% endif %}
--build {{ repo_build_dir }}
--log /var/log/repo/repo_builder.log
--requirement {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_local_filtered.txt
tags:
- repo-build-local-requirement-wheels
- repo-build-openstack-ansible-requirement-wheels

View File

@ -13,7 +13,7 @@ function venv_create {
[[ -d "/tmp/${VENV_FILE}" ]] && rm -rf "/tmp/${VENV_FILE}"
# Create the virtualenv shell
{{ repo_build_venv_command_options }} "${VENV_PATH}"
{{ repo_build_venv_command_options.split() | join(' ') }} "${VENV_PATH}"
# Create the pip build directory
mkdir -p "/tmp/${VENV_FILE}"
@ -23,7 +23,7 @@ function venv_create {
# Run the pip install within the venv and specify a specific build directory which
# resolves pip locking issues when run in parallel.
${VENV_PATH}/bin/pip install --build "/tmp/${VENV_FILE}" {{ repo_build_venv_pip_install_options }} $3
${VENV_PATH}/bin/pip install --build "/tmp/${VENV_FILE}" {{ repo_build_venv_pip_install_options.split() | join(' ') }} $3
# Deactivate the venv for good measure
deactivate