Fix version number;Parse, Pull & Compress container images
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Danny Bessems 2022-06-26 20:56:45 +02:00
parent 18fa7742fa
commit b7abf25907
2 changed files with 19 additions and 24 deletions

View File

@ -19,33 +19,26 @@
cmd: helm fetch {{ item.value.helm_chart }} --untar --version {{ item.value.version }} cmd: helm fetch {{ item.value.helm_chart }} --untar --version {{ item.value.version }}
chdir: /opt/metacluster/helm-charts chdir: /opt/metacluster/helm-charts
loop: "{{ lookup('ansible.builtin.dict', components) }}" loop: "{{ lookup('ansible.builtin.dict', components) }}"
loop_control:
- ansible.builtin.command: label: "{{ item.key }}"
cmd: ls -lashR /opt/metacluster/helm-charts
register: results
- ansible.builtin.debug:
var: results
- name: Parse helm charts for container images - name: Parse helm charts for container images
ansible.builtin.command: ansible.builtin.command:
cmd: "{{ item.value.parse_cmd }} /opt/metacluster/helm-charts/{{ item.key }}/values.yaml" cmd: "{{ item.value.parse_logic }} /opt/metacluster/helm-charts/{{ item.key }}/values.yaml"
register: containerimages register: containerimages
loop: "{{ lookup('ansible.builtin.dict', components) }}" loop: "{{ lookup('ansible.builtin.dict', components) }}"
# loop_control: loop_control:
# label: "{{ item.key }}" label: "{{ item.key }}"
- ansible.builtin.debug: - name: Pull and store containerimages
var: containerimages ansible.builtin.command:
cmd: skopeo copy docker://{{ item }} docker-archive:./{{ ( item | regex_findall('[^/:]+'))[-2] }}.tar:{{ item }}
chdir: /opt/metacluster/container-images
loop: "{{ containerimages.results | map(attribute='stdout_lines') | flatten }}"
# - name: Pull and store containerimages - name: Compress tarballs
# ansible.builtin.command: community.general.archive:
# cmd: skopeo copy docker://{{ item }} docker-archive:./{{ ( item | regex_findall('[^/:]+'))[-2] }}.tar:{{ item }} dest: /opt/metacluster/container-images/{{ item | regex_findall('[^/:]+'))[-2] }}.tar.gz
# chdir: /opt/metacluster/container-images path: /opt/metacluster/container-images/{{ item | regex_findall('[^/:]+'))[-2] }}.tar
# loop: ... remove: yes
loop: "{{ containerimages.results | map(attribute='stdout_lines') | flatten }}"
# - name: Compress tarballs
# community.general.archive:
# dest: /opt/metacluster/container-images/{{ item | regex_findall('[^/:]+'))[-2] }}.tar.gz
# path: /opt/metacluster/container-images/{{ item | regex_findall('[^/:]+'))[-2] }}.tar
# remove: yes
# loop: ...

View File

@ -13,10 +13,12 @@ components:
longhorn: longhorn:
version: 1.3.0 version: 1.3.0
helm_chart: longhorn/longhorn helm_chart: longhorn/longhorn
parse_logic: yq e '.. | select(has("repository")) | .repository + ":" + .tag'
harbor: harbor:
version: 2.5.1 version: 1.9.1 # (= Harbor v2.5.1)
helm_chart: harbor/harbor helm_chart: harbor/harbor
parse_logic: yq e '.. | select(has("repository")) | .repository + ":" + .tag'
# argocd: # argocd:
# version: # version: