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 --always-copy
--extra-search-dir {{ repo_build_release_path }}/{{ repo_build_release_tag }} --extra-search-dir {{ repo_build_release_path }}/{{ repo_build_release_tag }}
--never-download --never-download
repo_pip_packages: repo_pip_packages:
- wheel - wheel
- virtualenv - virtualenv

View File

@ -14,41 +14,41 @@
# limitations under the License. # limitations under the License.
- name: Create OpenStack global requirements wheels - name: Create OpenStack global requirements wheels
shell: | shell: >
pip wheel --timeout {{ repo_build_timeout }} \ pip wheel --timeout {{ repo_build_timeout }}
--wheel-dir {{ repo_build_output }} \ --wheel-dir {{ repo_build_output }}
--find-links {{ repo_build_global_links_path }} \ --find-links {{ repo_build_global_links_path }}
--find-links {{ repo_build_output }} \ --find-links {{ repo_build_output }}
--constraint {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_constraints.txt \ --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 }} \ {% 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 %} --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 }} \ {% 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 %} --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 ') }} \ {% 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 %} --trusted-host {{ repo_build_pip_extra_indexes | map('netloc_no_port') | join(' --trusted-host ') }} {% endif %}
--build {{ repo_build_dir }} \ --build {{ repo_build_dir }}
--log /var/log/repo/repo_builder.log \ --log /var/log/repo/repo_builder.log
--requirement {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_global_requirements.txt --requirement {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_global_requirements.txt
tags: tags:
- repo-build-global-requirement-wheels - repo-build-global-requirement-wheels
- repo-build-openstack-ansible-requirement-wheels - repo-build-openstack-ansible-requirement-wheels
- name: Create OpenStack-Ansible requirement wheels - name: Create OpenStack-Ansible requirement wheels
shell: | shell: >
pip wheel --timeout {{ repo_build_timeout }} \ pip wheel --timeout {{ repo_build_timeout }}
--wheel-dir {{ repo_build_output }} \ --wheel-dir {{ repo_build_output }}
--find-links {{ repo_build_global_links_path }} \ --find-links {{ repo_build_global_links_path }}
--find-links {{ repo_build_output }} \ --find-links {{ repo_build_output }}
--constraint {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_constraints.txt \ --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 }} \ {% 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 %} --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 }} \ {% 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 %} --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 ') }} \ {% 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 %} --trusted-host {{ repo_build_pip_extra_indexes | map('netloc_no_port') | join(' --trusted-host ') }} {% endif %}
--build {{ repo_build_dir }} \ --build {{ repo_build_dir }}
--log /var/log/repo/repo_builder.log \ --log /var/log/repo/repo_builder.log
--requirement {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_local_filtered.txt --requirement {{ repo_build_release_path }}/{{ repo_build_release_tag }}/requirements_local_filtered.txt
tags: tags:
- repo-build-local-requirement-wheels - repo-build-local-requirement-wheels
- repo-build-openstack-ansible-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}" [[ -d "/tmp/${VENV_FILE}" ]] && rm -rf "/tmp/${VENV_FILE}"
# Create the virtualenv shell # 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 # Create the pip build directory
mkdir -p "/tmp/${VENV_FILE}" 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 # Run the pip install within the venv and specify a specific build directory which
# resolves pip locking issues when run in parallel. # 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 the venv for good measure
deactivate deactivate