Skip to content

Commit

Permalink
Add charmhub-lp-tool-osci-sync
Browse files Browse the repository at this point in the history
charmhub-lp-tool-osci-sync job takes care of installing charmhub-lp-tools (via pip) and
running `charmhub-lp-tool osci-sync` which reads osci.yaml to get the desired
charmcraft version to be used when building the charm and update the
Launchpad charm build recipe.

Introduces a new secret named "launchpad_token" which contains a token
associated to a uosci-testing-bot[0]

[0] https://launchpad.net/~uosci-testing-bot
  • Loading branch information
freyes committed Mar 16, 2023
1 parent 0078b40 commit 45471ce
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 0 deletions.
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
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
- 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=

0 comments on commit 45471ce

Please sign in to comment.