Skip to content

Commit

Permalink
Return proper full hash for component repos
Browse files Browse the repository at this point in the history
In Component repos, we dump current-podified hash. We need the same hash
needs to be set during hash info set_fact. So the content provider this
hash to dependendent job otherwise it will fail.

Signed-off-by: Chandan Kumar <[email protected]>
  • Loading branch information
raukadah committed Aug 1, 2024
1 parent d87ab21 commit d937006
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions roles/repo_setup/tasks/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,25 @@

- name: Dump current-podified hash when using with component repo
when: cifmw_repo_setup_component_name | length > 0
ansible.builtin.get_url:
url: "{{ cifmw_repo_setup_dlrn_uri }}/{{ cifmw_repo_setup_os_release }}{{ cifmw_repo_setup_dist_major_version }}-{{ cifmw_repo_setup_branch }}/current-podified/delorean.repo.md5"
dest: "{{ cifmw_repo_setup_basedir }}/artifacts/repositories/delorean.repo.md5"
block:
- name: Dump current-podified hash
ansible.builtin.get_url:
url: "{{ cifmw_repo_setup_dlrn_uri }}/{{ cifmw_repo_setup_os_release }}{{ cifmw_repo_setup_dist_major_version }}-{{ cifmw_repo_setup_branch }}/current-podified/delorean.repo.md5"
dest: "{{ cifmw_repo_setup_basedir }}/artifacts/repositories/delorean.repo.md5"

- name: Slurp current podified hash
ansible.builtin.slurp:
src: "{{ cifmw_repo_setup_basedir }}/artifacts/repositories/delorean.repo.md5"
register: _current_podified_hash

- name: Export hashes facts for further use
ansible.builtin.set_fact:
cifmw_repo_setup_full_hash: "{{ _repo_setup_json['full_hash'] }}"
cifmw_repo_setup_full_hash: >-
{% if cifmw_repo_setup_component_name | length > 0 -%}
"{{ _current_podified_hash['content'] | b64decode | trim }}"
{% else -%}
"{{ _repo_setup_json['full_hash'] }}"
{% endif -%}
cifmw_repo_setup_commit_hash: "{{ _repo_setup_json['commit_hash'] }}"
cifmw_repo_setup_distro_hash: "{{ _repo_setup_json['distro_hash'] }}"
cifmw_repo_setup_extended_hash: "{{ _repo_setup_json['extended_hash'] }}"
Expand Down

0 comments on commit d937006

Please sign in to comment.