Skip to content

Commit

Permalink
Update testing and CI (#68)
Browse files Browse the repository at this point in the history
* update

* update

* update tests and fix ci
  • Loading branch information
sean-m-sullivan authored Jan 25, 2023
1 parent d750eec commit 98d85ac
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ use_default_rules: true
# https://github.com/ansible/ansible-lint/issues/808
# with verbosity set to 1, its dumping 'unknown file type messages'
# verbosity: 1
skip_list: []
skip_list:
- meta-unsupported-ansible
kinds:
- playbooks: "**/examples/*.{yml,yaml}"
- tasks: "**/examples/tasks/*.yml"
Expand Down
4 changes: 2 additions & 2 deletions .github/tests/ee_builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
ee_list:
- name: custom_ee
alt_name: Custom EE
ee_base_image: 1registry.redhat.io/ansible-automation-platform-23/ee-supported-rhel8:latest
ee_builder_image: 1registry.redhat.io/ansible-automation-platform-23/ansible-builder-rhel8:latest
ee_base_image: registry.redhat.io/ansible-automation-platform-23/ee-supported-rhel8:latest
ee_builder_image: registry.redhat.io/ansible-automation-platform-23/ansible-builder-rhel8:latest
tag: 1-11-21-2
# base_image
bindep:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: ansible-galaxy collection install containers.podman -f

- name: Docker login
run: docker login -u="redhat_cop+github_action" -p="${{ secrets.quay_token }}" quay.io
run: docker login -u="redhat_cop+github_action" -p=${{ secrets.QUAY_TOKEN }} quay.io

- name: Build EE
run: ansible-playbook .github/tests/build_ee.yml -e "ee_registry_username=redhat_cop+github_action" -e "ee_registry_password=${{ secrets.quay_token }}" --connection=local -e "ee_registry_dest=quay.io/redhat_cop/config_as_code_ee" -vvv
Expand Down
2 changes: 2 additions & 0 deletions roles/ee_builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ ansible-playbook playbook.yml
- awxkit # For import and export modules
collections:
- name: awx.awx
type: url
source: https://galaxy.ansible.com/download/awx-awx-21.11.0.tar.gz
- name: redhat_cop.controller_configuration
- name: redhat_cop.ah_configuration
prepend:
Expand Down
40 changes: 20 additions & 20 deletions roles/virtualenv_migrate/tasks/01_ee_diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
- name: Diff with EE requirements
delegate_to: localhost
block:
- name: Diff | Download the default EE on localhost
containers.podman.podman_image:
name: "{{ venv_migrate_default_ee_url }}"
username: "{{ venv_migrate_registry_username }}"
password: "{{ venv_migrate_registry_password }}"
- name: Diff | Download the default EE on localhost
containers.podman.podman_image:
name: "{{ venv_migrate_default_ee_url }}"
username: "{{ venv_migrate_registry_username }}"
password: "{{ venv_migrate_registry_password }}"

- name: Diff | Get pip list from Default EE
ansible.builtin.command: "podman run --rm -it {{ venv_migrate_default_ee_url }} bash -c \"/bin/pip3 freeze\""
register: __venv_migrate_ee_pip_list_output
changed_when: false
- name: Diff | Get pip list from Default EE
ansible.builtin.command: "podman run --rm -it {{ venv_migrate_default_ee_url }} bash -c \"/bin/pip3 freeze\""
register: __venv_migrate_ee_pip_list_output
changed_when: false

- name: Diff | Retain the EE pip list without package versions
ansible.builtin.set_fact:
__venv_migrate_ee_pip_list: "{{ __venv_migrate_ee_pip_list_output.stdout.split('\n') | map('regex_replace', '(\\w+)==([\\d+\\.]+).*', '\\1') | list }}"
- name: Diff | Retain the EE pip list without package versions
ansible.builtin.set_fact:
__venv_migrate_ee_pip_list: "{{ __venv_migrate_ee_pip_list_output.stdout.split('\n') | map('regex_replace', '(\\w+)==([\\d+\\.]+).*', '\\1') | list }}"

- name: Diff | Check what's extra in venv and create a requirement list for the new EE and set to ee_python variable
ansible.builtin.set_fact:
venv_migrate_ee_python_list: "{{ venv_migrate_ee_python_list | d([]) + [{item.item: (item.stdout_lines | difference(__venv_migrate_ee_pip_list))}] }}"
loop: "{{ __venv_migrate_combined_requirements_ser }}"
no_log: true
- name: Diff | Check what's extra in venv and create a requirement list for the new EE and set to ee_python variable
ansible.builtin.set_fact:
venv_migrate_ee_python_list: "{{ venv_migrate_ee_python_list | d([]) + [{item.item: (item.stdout_lines | difference(__venv_migrate_ee_pip_list))}] }}"
loop: "{{ __venv_migrate_combined_requirements_ser }}"
no_log: true

- name: Diff | Show the packages that are extra from default EEs in custom venvs.
ansible.builtin.debug:
msg: "{{ venv_migrate_ee_python_list }}"
- name: Diff | Show the packages that are extra from default EEs in custom venvs.
ansible.builtin.debug:
msg: "{{ venv_migrate_ee_python_list }}"
...

0 comments on commit 98d85ac

Please sign in to comment.