Merge "Use relative path to get metadata" into main

This commit is contained in:
Zuul 2024-01-30 13:00:13 +00:00 committed by Gerrit Code Review
commit 21607c9e14

View File

@ -19,24 +19,21 @@
include_role: include_role:
name: ensure-docker name: ensure-docker
- name: Set project absolute path
set_fact:
project_abs: "{{ zuul.executor.work_root }}/{{ zuul.project.src_dir }}"
- name: Create charm destination folder - name: Create charm destination folder
file: file:
path: "{{ project_abs }}/{{ charm_build_name }}" path: "{{ zuul.project.src_dir }}/{{ charm_build_name }}"
state: directory state: directory
mode: "0755"
- name: Decompress charm - name: Decompress charm
unarchive: unarchive:
src: "{{ project_abs }}/{{ charm_build_name }}.charm" src: "{{ zuul.project.src_dir }}/{{ charm_build_name }}.charm"
dest: "{{ project_abs }}/{{ charm_build_name }}" dest: "{{ zuul.project.src_dir }}/{{ charm_build_name }}"
- name: Upload oci-image to charmhub - name: Upload oci-image to charmhub
register: upload_oci_image_output register: upload_oci_image_output
vars: vars:
metadata: "{{ lookup('file', project_abs + '/' + charm_build_name + '/metadata.yaml') | from_yaml }}" metadata: "{{ lookup('file', zuul.executor.work_root + '/' + zuul.project.src_dir + '/' + charm_build_name + '/metadata.yaml') | from_yaml }}"
args: args:
executable: /bin/bash executable: /bin/bash
shell: | shell: |