diff --git a/playbooks/charm/charmhub-lp-tool-osci-sync.yaml b/playbooks/charm/charmhub-lp-tool-osci-sync.yaml new file mode 100644 index 0000000..cde5553 --- /dev/null +++ b/playbooks/charm/charmhub-lp-tool-osci-sync.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - charmhub-lp-tool-osci-sync diff --git a/roles/charmhub-lp-tool-osci-sync/defaults/main.yaml b/roles/charmhub-lp-tool-osci-sync/defaults/main.yaml new file mode 100644 index 0000000..3752006 --- /dev/null +++ b/roles/charmhub-lp-tool-osci-sync/defaults/main.yaml @@ -0,0 +1,3 @@ +# allow repos to use a different source to facilitate testing of new features +# in charmhub-lp-tools branches. +charmhub_lp_tools_pkg: "git+https://github.com/openstack-charmers/charmhub-lp-tools.git@main#egg=charmhub-lp-tools" diff --git a/roles/charmhub-lp-tool-osci-sync/tasks/main.yaml b/roles/charmhub-lp-tool-osci-sync/tasks/main.yaml new file mode 100644 index 0000000..10a24b3 --- /dev/null +++ b/roles/charmhub-lp-tool-osci-sync/tasks/main.yaml @@ -0,0 +1,20 @@ +- name: Sync charm recipe definitions to Launchpad + environment: + LP_CREDENTIALS: "{{ launchpad_token.value }}" + block: + - name: Install zosci-tools + become: true + ansible.builtin.pip: + name: "{{ charmhub_lp_tools_pkg }}" + register: result + until: result is not failed + retries: 10 + delay: 10 + - name: Run charmhub-lp-tool osci-sync + args: + executable: /bin/bash + chdir: "{{ zuul.project.src_dir }}" + shell: | + export LP_CREDENTIALS_FILE=$(mktemp) + echo "{{ LP_CREDENTIALS }}" > $LP_CREDENTIALS_FILE + charmhub-lp-tool osci-sync --repo-dir '{{ zuul.project.src_dir }}' --i-really-mean-it diff --git a/tox.ini b/tox.ini index c5a2cb6..ab8bb2d 100644 --- a/tox.ini +++ b/tox.ini @@ -24,6 +24,8 @@ deps = # production. # # https://github.com/ansible-community/ansible-lint/issues/1795 + # Warning: : Skipping plugin ([...]/ansible/plugins/filter/mathstuff.py) as it seems to be invalid: cannot import name 'environmentfilter' from 'jinja2.filters' + Jinja2<3.1 rich>=9.5.1,<11.0.0 ansible>=2.8,<=2.9 ansible-lint>=4.2.0,<5 diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 4142c0a..73fdb6b 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -804,6 +804,7 @@ nodes: - name: focal-medium label: focal-medium + - job: name: sqa-integration description: Sets up a sqalab connection for this test environment @@ -812,3 +813,20 @@ abstract: true secrets: - sqalab_environment + +- job: + name: charmhub-osci-sync + description: | + Run `charmhub-lp-tool osci-sync` to update the recipe's definition on + Launchpad. + timeout: 3600 + parent: tox + provides: charm + post-review: true + run: playbooks/charm/charmhub-lp-tool-osci-sync.yaml + nodeset: + nodes: + - name: focal-medium + label: focal-medium + secrets: + - launchpad_token diff --git a/zuul.d/project-templates.yaml b/zuul.d/project-templates.yaml index d46e50d..54e9412 100644 --- a/zuul.d/project-templates.yaml +++ b/zuul.d/project-templates.yaml @@ -330,6 +330,9 @@ # NOTE(icey) BUT REALLY, DO NOT ENABLE THE FOLLOWING UNTIL YOU KNOW WE CAN # RUN A 3.10 JOB ON ZOSCI. #- tox-py310 + promote: + jobs: + - charmhub-osci-sync - project-template: name: charm-publish-jobs description: | diff --git a/zuul.d/secrets.yaml b/zuul.d/secrets.yaml index 8b01474..5336d17 100644 --- a/zuul.d/secrets.yaml +++ b/zuul.d/secrets.yaml @@ -191,3 +191,18 @@ username: ZuulBot uuid: 0c00c563-7e9e-40ab-8db6-738d81aa1ce5 weebl_url: http://10.131.231.53:8080 + +- secret: + name: launchpad_token + data: + value: !encrypted/pkcs1-oaep + - lrEt4pm0PLOo3FrHEXTn3ny2U+vYgBDHumZ28Ehn8RIuPyeW7jzL/6weDoAjUPRH/Uz+d + rVswRrYvAhqM01fRyGFLCThsFZ5l1dOlDHKBLGfJDVYcxuWwo1FZ1kroQnYZwA3/t/epw + qc/oB74syFkgtfPweEEuTOLp6hTgZXt6Ifkv7k9pCkVBflnJScWBrJbUZfu0HljygWbVt + ih7VKMPoog0VACcdouQIhohLoOjTvNlLDzKK5RXUSMucAPuUpqIIASExKdftAMzzLURwO + Z9uJ28XMkfM1rtMZ4SR8VbeKPocitTYfGH3vsaHjR950/nB0eyT9NuRnCM8D+axO7N6ad + DoPqskMFuVMSQ4GvqiArqftB526PnFC64s5G3dWPwEkNaY37YPVccqniP2jdl9vu+3+g8 + 1ZXibCO6erTjNV9PEN9lx3luWsuwtpGhW3STSh3Avln/R5ZgzjngEQ59Gl/3rnoY+VeMT + CbeFL7KRLnkRdIUcb3k95LjLNV02Imc1L6RsGoJFwd2r0rATSUB1noUu+ml1sxUKNZYPW + 3vXXAQmjiyKXoXWYKNXyMWEe3nAHicd/h1+OqW9S+7uxHfAplUlPCPL42WQFARzZDwLhP + yl902fu8O2C8DTiUgbI+KJvcgbxweeXfIony5Uat7PXpLpkIxVS7nt+s2efIaI=