This repository has been archived by the owner on Feb 29, 2024. It is now read-only.
/
get-dlrn-hash.yml
119 lines (104 loc) · 4.22 KB
/
get-dlrn-hash.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
- name: Check DLRN hash format
fail:
msg: "The DLRN hash or tag is not recognized. The hash or tag should not contain path slashes."
when:
- not dlrn_hash_tag is match(expected_commit_distro_hash_regex)
- not dlrn_hash_tag is match(expected_aggregate_hash_regex)
- dlrn_hash_tag not in known_hash_tags
- name: Check DLRN hash - passed ready hash
set_fact:
dlrn_hash: "{{ dlrn_hash_tag }}"
cacheable: true
when: dlrn_hash_tag is match(expected_commit_distro_hash_regex) or dlrn_hash_tag is match(expected_aggregate_hash_regex)
- name: print out the release name
debug:
msg: "the tq release is: {{ release }}"
# full_hash_result is used to help find the
# correctly tagged containers and images
# components for OSP will be built on OSP-16, 17 # TO-DO
- when:
- dlrn_hash_tag in known_hash_tags
- ansible_distribution_major_version is version(8, '<')
block:
- name: Get DLRN hash - passed tag - non-component
shell: |
set -euo pipefail
dlrn_base={{ dlrn_baseurl }}
if [ -e /etc/ci/mirror_info.sh ]; then
source /etc/ci/mirror_info.sh
NODEPOOL_RDO_PROXY=${NODEPOOL_RDO_PROXY:-https://trunk.rdoproject.org}
dlrn_base=${dlrn_base/https:\/\/trunk.rdoproject.org/$NODEPOOL_RDO_PROXY}
fi
curl -s --fail --show-error ${dlrn_base}/{{ dlrn_hash_tag }}/delorean.repo \
| grep baseurl | grep -Eo {{ expected_commit_distro_hash_regex | quote }}
register: full_hash_result
retries: 5
- name: Set fact for dlrn_hash
set_fact:
dlrn_hash: "{{ full_hash_result.stdout }}"
cacheable: true
# when running a component job, the containers and images
# come from a promoted current-tripleo pin. Therefore the md5
# of the known hash_tag (e..g. current tripleo) is the cricital hash to know.
# components for OSP will be built on OSP-16, 17 # TO-DO
- when:
- dlrn_hash_tag in known_hash_tags
- ansible_distribution_major_version is version(8, '>=')
block:
- name: Get DLRN hash - passed tag - component-based
shell: |
set -euo pipefail
dlrn_base={{ dlrn_baseurl }}
if [ -e /etc/ci/mirror_info.sh ]; then
source /etc/ci/mirror_info.sh
NODEPOOL_RDO_PROXY=${NODEPOOL_RDO_PROXY:-https://trunk.rdoproject.org}
dlrn_base=${dlrn_base/https:\/\/trunk.rdoproject.org/$NODEPOOL_RDO_PROXY}
fi
curl -s --fail --show-error ${dlrn_base}/{{ dlrn_hash_tag }}/delorean.repo.md5
register: full_hash_result
retries: 5
- name: Set fact for dlrn_hash
set_fact:
dlrn_hash: "{{ full_hash_result.stdout }}"
cacheable: true
# TODO: Fix for fedora
- when: overcloud_release is defined and (overcloud_release | length != 0)
block:
- name: Get DLRN overcloud hash
shell: |
set -euo pipefail
dlrn_base=https://trunk.rdoproject.org/centos7-{{ overcloud_release }}
if [ -e /etc/ci/mirror_info.sh ]; then
source /etc/ci/mirror_info.sh
NODEPOOL_RDO_PROXY=${NODEPOOL_RDO_PROXY:-https://trunk.rdoproject.org}
dlrn_base=${dlrn_base/https:\/\/trunk.rdoproject.org/$NODEPOOL_RDO_PROXY}
fi
curl -s --fail --show-error ${dlrn_base}/{{ dlrn_hash_tag }}/delorean.repo \
| grep baseurl | grep -Eo {{ expected_commit_distro_hash_regex }}
register: full_overcloud_hash_result
retries: 5
- name: Set fact for overcloud dlrn_hash
set_fact:
overcloud_dlrn_hash: "{{ full_overcloud_hash_result.stdout }}"
cacheable: true
- name: Set fact for overcloud dlrn_hash path
set_fact:
overcloud_dlrn_hash_path: "{{ overcloud_dlrn_hash[:2] }}/{{ overcloud_dlrn_hash[2:4] }}/{{ overcloud_dlrn_hash }}"
cacheable: true
- name: Set fact for the overcloud Docker image tag
set_fact:
overcloud_docker_image_tag: "{{ overcloud_dlrn_hash }}"
cacheable: true
- name: Set fact for dlrn_hash path
set_fact:
dlrn_hash_path: "{{ dlrn_hash[:2] }}/{{ dlrn_hash[2:4] }}/{{ dlrn_hash }}"
cacheable: true
- name: Set fact for the Docker image tag
set_fact:
docker_image_tag: "{{ dlrn_hash }}"
cacheable: true
- name: Set fact for task already run
set_fact:
dlrn_task_run: true
cacheable: true