openstack-ansible-repo_build/tasks/repo_venv_build.yml
Kevin Carter baab4e2e7c
Updates to support ignored packages and external indexes
This change ensures that a venv create process can work when a
dependency is crafted outside of the OpenStack global requirements
system. The change keys off of the original package url setting the
isolated perameter should "withindex=True" be found.

The requirements.txt.j2 template file has been updated to allow
packages to be ignored from wheel building should the
`ignorerequirement=True` property be set within a given remote package.
This ability is important as some packages, generally external testing
repos, do not use requirement boundries and are known to break
given enough time.

Tagged tasks that MUST always be run have had tags set to "always".

Change-Id: I5d11aca84dcb74c77f3d0e3f31ce6546458a3e84
Closes-Bug: #1631992
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-10-27 01:42:53 -05:00

75 lines
2.0 KiB
YAML

---
# Copyright 2015, 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.
- name: Get venv command path
command: which virtualenv
register: virtualenv_path
tags:
- always
- name: Set virtualenv command path
set_fact:
virtualenv_bin: "{{ virtualenv_path.stdout }}"
tags:
- always
- name: Check for created venvs
command: >
ls -1 "{{ repo_build_venv_dir }}/{{ repo_build_release_tag }}/{{ ansible_distribution | lower }}/"
register: created_venvs
tags:
- repo-create-venv
- name: Set existing venv fact
set_fact:
existing_venvs: "{{ created_venvs.stdout_lines }}"
tags:
- repo-command-bin
- repo-create-venv
# This is removed so that virtual env is not installing unknown
# packages as assumed wheels, IE pip8
- name: Ensure virtualenv_support is absent
file:
path: "{{ item }}"
state: "absent"
with_items:
- "/usr/local/lib/python2.7/dist-packages/virtualenv_support"
- "/usr/local/lib/python2.7/site-packages/virtualenv_support"
tags:
- repo-create-venv
- name: Create venv process script
template:
src: "op-venv-script.sh.j2"
dest: "/opt/op-venv-script.sh"
tags:
- repo-create-venv
- name: Run venv process script
shell: "bash /opt/op-venv-script.sh"
tags:
- repo-create-venv
- repo-venv-compress-archive
- repo-create-venv-archive
- repo-create-venv-checksum
- name: Remove venv process script
file:
path: "/opt/op-venv-script.sh"
state: absent
tags:
- repo-create-venv