
There are lots of places in the code where typos might occur. Those even squeeze into the openapi and as such into the generated code. On the Rust side we already use `typos` to check that so we need to also invoke it when we generate openapi specs themselves. Change-Id: I9d27391492f9eb10a6b65d4c4589b12db2610813
26 lines
1.0 KiB
YAML
26 lines
1.0 KiB
YAML
---
|
|
- hosts: all
|
|
tasks:
|
|
- name: Update openapi-core
|
|
ansible.builtin.pip:
|
|
name: "openapi-core"
|
|
state: "latest"
|
|
virtualenv: "{{ ansible_user_dir }}/.venv"
|
|
|
|
- name: Generate OpenAPI spec
|
|
args:
|
|
chdir: "{{ ansible_user_dir }}/.venv"
|
|
executable: /bin/bash
|
|
ansible.builtin.shell: >-
|
|
source {{ ansible_user_dir }}/.venv/bin/activate;
|
|
openstack-codegenerator
|
|
--work-dir {{ ansible_user_dir }}/{{ codegenerator_work_dir }}
|
|
--target openapi-spec
|
|
--service-type {{ openapi_service }}
|
|
{%- if codegenerator_api_ref is defined and codegenerator_api_ref is mapping %}
|
|
--api-ref-src {{ ansible_user_dir }}/{{ zuul.projects[codegenerator_api_ref.project].src_dir }}/{{ codegenerator_api_ref.path | default("/api-ref/build/html/index.html") }}
|
|
{% endif %}
|
|
|
|
- name: "Fix typos"
|
|
ansible.builtin.command: "{{ ansible_user_dir }}/bin/typos -vw {{ ansible_user_dir }}/{{ codegenerator_work_dir }}/openapi_specs"
|