Skip to content

Commit

Permalink
Add charm-lp-recipe-sync.
Browse files Browse the repository at this point in the history
charm-lp-recipe-sync job takes care of installing zosci-tools[0] and
running `zosci-lp-recipe 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[1]

[0] https://github.com/freyes/zosci-tools
[1] https://launchpad.net/~uosci-testing-bot
  • Loading branch information
freyes committed Feb 8, 2023
1 parent 332e3a6 commit 558b13b
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 0 deletions.
3 changes: 3 additions & 0 deletions playbooks/charm/lp-recipe-sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- hosts: all
roles:
- charm-lp-recipe-sync
3 changes: 3 additions & 0 deletions roles/charm-lp-recipe-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 zosci-tools branches.
zosci_tools_pkg: "git+https://github.com/freyes/zosci-tools.git#egg=zosci-tools"
20 changes: 20 additions & 0 deletions roles/charm-lp-recipe-sync/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- name: Sync LP charm recipe definition
environment:
LP_CREDENTIALS: "{{ launchpad_token.value }}"
block:
- name: Install zosci-tools
become: true
ansible.builtin.pip:
name: "{{ zosci_tools_pkg }}"
register: result
until: result is not failed
retries: 10
delay: 10
- name: Run zosci-lp-recipe sync
args:
executable: /bin/bash
chdir: "{{ zuul.project.src_dir }}"
shell: |
export LP_CREDENTIALS_FILE=$(mktemp)
echo "{{ LP_CREDENTIALS }}" | base64 -d > $LP_CREDENTIALS_FILE
zosci-lp-recipe sync --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 @@ -781,6 +781,7 @@
nodes:
- name: focal-medium
label: focal-medium

- job:
name: sqa-integration
description: Sets up a sqalab connection for this test environment
Expand All @@ -789,3 +790,20 @@
abstract: true
secrets:
- sqalab_environment

- job:
name: charm-lp-recipe-sync
description: |
Run `zosci-lp-recipe sync` to update the recipe's definition on
Launchpad.
timeout: 3600
parent: tox
provides: charm
post-review: true
run: playbooks/charm/lp-recipe-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 @@ -253,6 +253,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:
- charm-lp-recipe-sync
- project-template:
name: charm-publish-jobs
description: |
Expand Down
5 changes: 5 additions & 0 deletions zuul.d/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,8 @@
username: ZuulBot
uuid: 0c00c563-7e9e-40ab-8db6-738d81aa1ce5
weebl_url: http://10.131.231.53:8080

- secret:
name: launchpad_token
data:
value: _TBD_

0 comments on commit 558b13b

Please sign in to comment.