Add options to use local DLRN and CentOS mirrors
Add the dlrn_baseurl option that allows overriding the DLRN server, making possible to use a proxy upstream. Also add dlrn_use_local_mirrors option. When true, the package building will use the already defined CentOS and DLRN repos from the machine where the packages are built. Also move the rdoinfo repo fetching in the main part of the role to save time and bandwidth. Change-Id: I0b440895267fcd8027394504649372bd923128d6 Closes-bug: #1710678
This commit is contained in:
parent
92e924a875
commit
92a1bf7f05
|
@ -32,6 +32,10 @@ Role Variables
|
|||
to skip projects that DLRN cannot build.
|
||||
* `artg_repos_dir` -- Root directory which contains project directories with
|
||||
sources for build.
|
||||
* `dlrn_baseurl` -- URL used by DLRN to get the repo definitions when building
|
||||
packages
|
||||
* `dlrn_use_local_mirrors` -- use the local repo definitions from
|
||||
/etc/yum.repos.d/ for CentOS and DLRN while building packages; used upstream
|
||||
|
||||
```yaml
|
||||
artg_change_list:
|
||||
|
|
|
@ -6,6 +6,8 @@ artg_dlrn_repo_url: "https://github.com/openstack-packages/DLRN.git"
|
|||
artg_rdoinfo_repo_url: "https://github.com/redhat-openstack/rdoinfo"
|
||||
artg_compressed_gating_repo: "/home/stack/gating_repo.tar.gz"
|
||||
dlrn_cleanup: false
|
||||
dlrn_baseurl: "https://trunk.rdoproject.org/centos7-{{ artg_release }}"
|
||||
dlrn_use_local_mirrors: false
|
||||
|
||||
artg_skipped_projects:
|
||||
- openstack/puppet-openstack-integration
|
||||
|
|
|
@ -12,24 +12,23 @@
|
|||
artg_distro: "{{ artg_release }}-rdo"
|
||||
when: artg_release not in ['master', 'mitaka']
|
||||
|
||||
- name: Use local baseurl when using local mirrors
|
||||
set_fact:
|
||||
dlrn_baseurl: 'file:///tmp/fake-dlrn-repos'
|
||||
when: dlrn_use_local_mirrors|bool
|
||||
|
||||
- name: Override projects.ini settings
|
||||
lineinfile:
|
||||
dest: '{{ build_repo_dir }}/DLRN/projects.ini'
|
||||
regexp: '{{ project_item.regexp }}'
|
||||
line: '{{ project_item.line }}'
|
||||
with_items:
|
||||
- { regexp: 'baseurl=.*', line: 'baseurl=https://trunk.rdoproject.org/centos7-{{ artg_release }}' }
|
||||
- { regexp: 'baseurl=.*', line: 'baseurl={{ dlrn_baseurl }}' }
|
||||
- { regexp: 'distro=.*', line: 'distro={{ artg_distro }}' }
|
||||
- { regexp: 'source=.*', line: 'source={{ artg_change.branch }}' }
|
||||
loop_control:
|
||||
loop_var: project_item
|
||||
|
||||
- name: Fetch local rdoinfo copy
|
||||
git:
|
||||
repo: '{{ artg_rdoinfo_repo_url }}'
|
||||
dest: '{{ build_repo_dir }}/DLRN/rdoinfo'
|
||||
version: 'master'
|
||||
|
||||
- name: Map project name to DLRN project name
|
||||
register: project_name_mapped
|
||||
shell: >
|
||||
|
|
|
@ -48,6 +48,31 @@
|
|||
version: master
|
||||
when: not dlrn_cloned.stat.exists
|
||||
|
||||
- name: Fetch local rdoinfo copy
|
||||
git:
|
||||
repo: '{{ artg_rdoinfo_repo_url }}'
|
||||
dest: '{{ build_repo_dir }}/DLRN/rdoinfo'
|
||||
version: 'master'
|
||||
|
||||
- name: Use local CentOS mirror if available
|
||||
shell: >
|
||||
gawk '{ print $0 }; /^# repos$/ { exit }' {{ build_repo_dir }}/DLRN/scripts/centos.cfg
|
||||
> {{ build_repo_dir }}/DLRN/scripts/centos-local.cfg;
|
||||
cat /etc/yum.repos.d/quickstart-centos-*.repo >> {{ build_repo_dir }}/DLRN/scripts/centos-local.cfg;
|
||||
cat /etc/yum.repos.d/delorean*.repo >> {{ build_repo_dir }}/DLRN/scripts/centos-local.cfg;
|
||||
echo '"""' >> {{ build_repo_dir }}/DLRN/scripts/centos-local.cfg;
|
||||
mkdir -p /tmp/fake-dlrn-repos/current;
|
||||
touch /tmp/fake-dlrn-repos/delorean-deps.repo;
|
||||
touch /tmp/fake-dlrn-repos/current/delorean.repo;
|
||||
when: dlrn_use_local_mirrors|bool
|
||||
|
||||
- name: Use custom target for DLRN
|
||||
lineinfile:
|
||||
dest: '{{ build_repo_dir }}/DLRN/projects.ini'
|
||||
regexp: 'target=.*'
|
||||
line: 'target=centos-local'
|
||||
when: dlrn_use_local_mirrors|bool
|
||||
|
||||
#Remove the rpm install test to speed up delorean
|
||||
#TODO: add an option for this in delorean
|
||||
- name: Remove DLRN RPM install test
|
||||
|
|
Loading…
Reference in New Issue