Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add charmhub-lp-tool-osci-sync #261

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions playbooks/charm/charmhub-lp-tool-osci-sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- hosts: all
roles:
- charmhub-lp-tool-osci-sync
3 changes: 3 additions & 0 deletions roles/charmhub-lp-tool-osci-sync/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -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"
20 changes: 20 additions & 0 deletions roles/charmhub-lp-tool-osci-sync/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
3 changes: 3 additions & 0 deletions zuul.d/project-templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something I'm not sure if this is the right place to trigger the job, I don't know if there should be a new check job that each charm needs/should opt-in.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChrisMacNaughton what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promote feels like the place to sync between the code and LP/charmhub; I wouldn't want it in check as that happens in every code submission

- project-template:
name: charm-publish-jobs
description: |
Expand Down
15 changes: 15 additions & 0 deletions zuul.d/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=