From 8f27184f30df50f169b72e6043c8fcc7e5cc1d00 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Fri, 17 Jun 2022 16:31:33 +0200 Subject: [PATCH] Make publish_collection more universal With this change we replace zuul.projects with zuul.project that will imply any project which will run the job. Also we read galaxy.yml as vars file to predict packed collection naming for futher upload. Change-Id: I66e27f3026689ad719384203fe66d65f5bca46ce Needed-By: https://review.opendev.org/c/openstack/ansible-config_template/+/846391 --- ci/publish/publish_collection.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ci/publish/publish_collection.yml b/ci/publish/publish_collection.yml index 4b74f953..b2ea2a59 100644 --- a/ci/publish/publish_collection.yml +++ b/ci/publish/publish_collection.yml @@ -1,7 +1,7 @@ --- - hosts: all vars: - collection_path: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/ansible-collections-openstack'].src_dir }}" + collection_path: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}" build_collection_path: /tmp/collection_built/ ansible_galaxy_path: "~/.local/bin/ansible-galaxy" @@ -63,12 +63,15 @@ url = {{ ansible_galaxy_info.url }} token = {{ ansible_galaxy_info.token }} + - name: Include galaxy.yml as vars file + include_vars: "{{ collection_path }}/galaxy.yml" + - name: Publish collection to Ansible Galaxy / Automation Hub environment: ANSIBLE_CONFIG: "{{ _ansiblecfg_tmp.path }}" shell: >- {{ ansible_galaxy_path }} collection publish -vvv - {{ build_collection_path }}/openstack-cloud-{{ version_tag }}.tar.gz + {{ build_collection_path }}/{{ namespace }}-{{ name }}-{{ version_tag }}.tar.gz always: - name: Shred ansible-galaxy credentials