Improve performance for building

This makes sure the build is done with the local zuul mirror
cache.

Change-Id: Ie62335aa149b98fb4d1e6475dfeaf21bb492f9b2
This commit is contained in:
Jean-Philippe Evrard 2019-03-19 11:52:19 +01:00
parent 5b22bb50bc
commit fa7913fa45
2 changed files with 20 additions and 0 deletions

View File

@ -276,6 +276,10 @@
prep_docker_images:
- context: "dockerfiles/leap15"
repository: openstackhelm/base
build_args:
- "PACKAGE_MIRROR={{ opensuse_package_mirror | default('http://download.opensuse.org/') }}"
- "PIP_INDEX_URL={{ pip_index_url | default('https://pypi.python.org/simple/') }}"
- "PIP_TRUSTED_HOST={{ pip_trusted_host | default('pypi.python.org') }}"
tags:
- "{{ distroname }}"
- <<: *requirements_project

View File

@ -16,6 +16,22 @@
- hosts: all[0]
gather_facts: true
tasks:
- name: Export the right vars
shell: |
source /etc/ci/mirror_info.sh
echo ${NODEPOOL_OPENSUSE_MIRROR}/
echo ${NODEPOOL_PYPI_MIRROR}
echo ${NODEPOOL_MIRROR_HOST}
args:
executable: /bin/bash
changed_when: False
register: _zuul_mirrors
- name: Set fact with the exported variables
set_fact:
opensuse_package_mirror: "{{ _zuul_mirrors.stdout_lines[0] }}"
pip_index_url: "{{ _zuul_mirrors.stdout_lines[1] | default('https://pypi.python.org/simple/') }}"
pip_trusted_host: "{{ _zuul_mirrors.stdout_lines[2] | default('pypi.python.org') }}"
- name: Build base and requirements images
include_role:
name: build-docker-image