Skip to content

Commit

Permalink
Merge pull request #1305 from john-westcott-iv/no_jmes
Browse files Browse the repository at this point in the history
Modifying stage playbook to not need jmespath
  • Loading branch information
john-westcott-iv authored Mar 28, 2023
2 parents d853e05 + f1512e9 commit aa673de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 0 additions & 1 deletion .github/workflows/promote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
- name: Release Helm chart
run: |
pip install jmespath
ansible-playbook ansible/helm-release.yml -v \
-e operator_image=quay.io/${{ github.repository }} \
-e chart_owner=${{ github.repository_owner }} \
Expand Down
17 changes: 11 additions & 6 deletions ansible/helm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@
Release must exist before running this playbook
when: release is not success

- name: See if file is already attached
- name: Set helm filename and commit message
set_fact:
asset_already_attached: "{{ (file_name in release.json | community.general.json_query(jmes_query)) | ternary(True, False) }}"
helm_file_name: "{{ file_name }}"
asset_already_attached: False
helm_file_name: "awx-operator-{{ tag }}.tgz"
commit_message: "Updated index.yaml for release {{ release.json.tag_name }}"
vars:
jmes_query: 'assets[*].name'
file_name: "awx-operator-{{ tag }}.tgz"

- name: See if file is already attached
set_fact:
asset_already_attached: True
loop: "{{ release.json.get('assets', []) }}"
loop_control:
label: "{{ item.name }}"
when: item.name == helm_file_name

- when: not asset_already_attached
block:
Expand Down

0 comments on commit aa673de

Please sign in to comment.