summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Pretorius <jesse.pretorius@rackspace.co.uk>2018-11-02 15:01:35 +0000
committerJesse Pretorius <jesse.pretorius@rackspace.co.uk>2018-11-02 15:01:35 +0000
commitecff328ed6fdf683ff3eba807b7f50be8ae7103b (patch)
tree42f5c77ed08741b3f252105512decdc38ff61227
parent420b98ead4e0d0102f5e6608bff3f20a0dd5e7a7 (diff)
Ensure pip/setuptools/wheel are up to date in the wheel build venv
To ensure consistency, we make sure that the venv used for the wheel build has an up to date and the right versions of pip/setuptools/wheel. Change-Id: Iac3e5054b5ef482bba2954e40c2c4d32a7f863df
Notes
Notes (review): Code-Review+2: Markos Chandras (hwoarang) <mchandras@suse.de> Code-Review+2: Mohammed Naser <mnaser@vexxhost.com> Workflow+1: Mohammed Naser <mnaser@vexxhost.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Sat, 03 Nov 2018 12:14:54 +0000 Reviewed-on: https://review.openstack.org/615205 Project: openstack/openstack-ansible-repo_build Branch: refs/heads/master
-rw-r--r--tasks/repo_build_prepare.yml45
1 files changed, 43 insertions, 2 deletions
diff --git a/tasks/repo_build_prepare.yml b/tasks/repo_build_prepare.yml
index 1651e5c..ab68b4a 100644
--- a/tasks/repo_build_prepare.yml
+++ b/tasks/repo_build_prepare.yml
@@ -73,6 +73,11 @@
73 (_wheel_build_constraints | changed) or 73 (_wheel_build_constraints | changed) or
74 (repo_build_wheel_rebuild | bool) 74 (repo_build_wheel_rebuild | bool)
75 75
76- name: Create the virtualenv (if it does not exist)
77 command: "virtualenv --never-download --no-site-packages {{ repo_build_bin | dirname }}"
78 args:
79 creates: "{{ repo_build_bin }}/activate"
80
76# Note(odyssey4me): 81# Note(odyssey4me):
77# To cater for a situation where the pip packages are changing, but the repo 82# To cater for a situation where the pip packages are changing, but the repo
78# does not yet have the package built, we need to ensure that this task can 83# does not yet have the package built, we need to ensure that this task can
@@ -82,6 +87,23 @@
82 tags: 87 tags:
83 - repo-build-install 88 - repo-build-install
84 block: 89 block:
90 - name: Upgrade pip/setuptools/wheel to the versions we want (from repo)
91 pip:
92 name:
93 - pip
94 - setuptools
95 - wheel
96 state: "{{ repo_build_pip_package_state }}"
97 virtualenv: "{{ repo_build_bin | dirname }}"
98 virtualenv_site_packages: "no"
99 extra_args: >-
100 --constraint {{ repo_build_release_path }}/requirements_constraints.txt
101 {{ pip_install_options | default('') }}
102 register: install_packages
103 until: install_packages is success
104 retries: 5
105 delay: 2
106
85 - name: Install pip packages (from repo) 107 - name: Install pip packages (from repo)
86 pip: 108 pip:
87 name: "{{ repo_pip_packages }}" 109 name: "{{ repo_pip_packages }}"
@@ -90,12 +112,31 @@
90 virtualenv_site_packages: "no" 112 virtualenv_site_packages: "no"
91 extra_args: >- 113 extra_args: >-
92 --constraint {{ repo_build_release_path }}/requirements_constraints.txt 114 --constraint {{ repo_build_release_path }}/requirements_constraints.txt
93 {{ pip_install_options }} 115 {{ pip_install_options | default('') }}
94 register: install_packages 116 register: install_packages
95 until: install_packages is success 117 until: install_packages is success
96 retries: 5 118 retries: 5
97 delay: 5 119 delay: 5
98 rescue: 120 rescue:
121 - name: Upgrade pip/setuptools/wheel to the versions we want (from pypi mirror)
122 pip:
123 name:
124 - pip
125 - setuptools
126 - wheel
127 state: "{{ repo_build_pip_package_state }}"
128 virtualenv: "{{ repo_build_bin | dirname }}"
129 virtualenv_site_packages: "no"
130 extra_args: >-
131 --index-url {{ repo_build_pip_default_index }}
132 --trusted-host {{ repo_build_pip_default_index | netloc_no_port }}
133 --constraint {{ repo_build_release_path }}/requirements_constraints.txt
134 {{ pip_install_options | default('') }}
135 register: install_packages
136 until: install_packages is success
137 retries: 5
138 delay: 2
139
99 - name: Install pip packages (from pypi mirror) 140 - name: Install pip packages (from pypi mirror)
100 pip: 141 pip:
101 name: "{{ repo_pip_packages }}" 142 name: "{{ repo_pip_packages }}"
@@ -106,7 +147,7 @@
106 --index-url {{ repo_build_pip_default_index }} 147 --index-url {{ repo_build_pip_default_index }}
107 --trusted-host {{ repo_build_pip_default_index | netloc_no_port }} 148 --trusted-host {{ repo_build_pip_default_index | netloc_no_port }}
108 --constraint {{ repo_build_release_path }}/requirements_constraints.txt 149 --constraint {{ repo_build_release_path }}/requirements_constraints.txt
109 {{ pip_install_options }} 150 {{ pip_install_options | default('') }}
110 register: install_packages 151 register: install_packages
111 until: install_packages is success 152 until: install_packages is success
112 retries: 5 153 retries: 5