Change logging for source downloads and wheel build
In I298dd45ada552b78ef7d6fcb79481035581bd77a timestamping for the wheel build process was added, but it wasn't added to the source download process. This patch adds timestamping to the source download process too, but also changes the log file used for each step so that they each have their own log files. The two tasks are also normalised to execute in the same way to make them a little easier to follow. It thereby removes the extra indirection of using yet another script for the execution. Change-Id: If571e9d290cbdd5ba02542b6bc19e4321b67ea6f Implements: blueprint python-build-install-simplification Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
This commit is contained in:
parent
b90897bcd2
commit
778ceee2cf
|
@ -31,34 +31,50 @@
|
|||
- "{{ repo_build_output }}"
|
||||
|
||||
- name: Download requirement pip sources
|
||||
shell: >
|
||||
shell: >-
|
||||
yes i | pip install --timeout {{ repo_build_timeout }}
|
||||
--download {{ repo_build_output }}
|
||||
--no-binary :all:
|
||||
--constraint {{ repo_build_release_path }}/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_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 -%}
|
||||
--log /var/log/repo/repo_builder.log
|
||||
--requirement {{ repo_build_release_path }}/requirements.txt
|
||||
when: repo_build_store_pip_sources | bool
|
||||
|
||||
- name: Create wheel build script
|
||||
template:
|
||||
src: "wheel-build-script.sh.j2"
|
||||
dest: "/opt/wheel-build-script.sh"
|
||||
mode: "0755"
|
||||
|
||||
- name: Create OpenStack-Ansible requirement wheels
|
||||
shell: "/opt/wheel-build-script.sh"
|
||||
--download {{ repo_build_output }}
|
||||
--no-binary :all:
|
||||
--constraint {{ repo_build_release_path }}/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_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 %}
|
||||
--requirement {{ repo_build_release_path }}/requirements.txt
|
||||
{{ pip_install_options }}
|
||||
2>&1 | ts > /var/log/repo/source_download.log
|
||||
args:
|
||||
executable: "/bin/bash"
|
||||
when: repo_build_store_pip_sources | bool
|
||||
|
||||
- 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 }}/requirements_constraints.txt
|
||||
{% if repo_build_pip_no_binary is defined %}
|
||||
--no-binary {{ repo_build_pip_no_binary | join(' --no-binary ') }}
|
||||
{% endif %}
|
||||
{% 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_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 }}
|
||||
--requirement {{ repo_build_release_path }}/requirements.txt
|
||||
{{ pip_install_options }}
|
||||
2>&1 | ts > /var/log/repo/wheel_build.log
|
||||
args:
|
||||
executable: "/bin/bash"
|
||||
changed_when: false
|
||||
tags:
|
||||
- skip_ansible_lint
|
||||
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Copyright 2017, Rackspace US, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
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 }}/requirements_constraints.txt \
|
||||
{% if repo_build_pip_no_binary is defined %}--no-binary {{ repo_build_pip_no_binary | join(' --no-binary ') }}{% endif %} \
|
||||
{% 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_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 }} \
|
||||
--requirement {{ repo_build_release_path }}/requirements.txt \
|
||||
{{ pip_install_options }} \
|
||||
2>&1 | ts > /var/log/repo/repo_builder.log
|
Loading…
Reference in New Issue