Skip to content

Commit c85e21e

Browse files
committed
collector
1 parent ab60dff commit c85e21e

File tree

2 files changed

+18
-31
lines changed

2 files changed

+18
-31
lines changed

ansible/ci-build-builder.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,20 @@
2929
recursive: true
3030
when: arch == "s390x"
3131

32-
#- name: Create a remote ccache directory if it does not exist
33-
# ansible.builtin.file:
34-
# path: "{{ collector_root }}/{{ ccache_dir }}"
35-
# state: directory
36-
# mode: '0777'
37-
# when: arch == "s390x"
38-
39-
#- name: Create a controller ccache directory if it does not exist
40-
# delegate_to: localhost
41-
# ansible.builtin.file:
42-
# path: "{{ github_workspace }}/{{ ccache_dir }}"
43-
# state: directory
44-
# when: arch == "s390x"
45-
46-
- name: Check if remote ccache archive exists on controller
32+
- name: Check if ccache archive exists
4733
delegate_to: localhost
4834
ansible.builtin.stat:
4935
path: "{{ github_workspace }}/{{ ccache_path }}"
5036
register: ccache_check
5137
when: arch == "s390x"
5238

53-
- name: Copy ccache from the controller to build VM
39+
- name: Copy ccache to build
5440
ansible.builtin.copy:
5541
src: "{{ github_workspace }}/{{ ccache_path }}"
5642
dest: "{{ collector_root }}/{{ ccache_dir }}/"
5743
when: arch == "s390x" and ccache_check.stat.exists
5844

59-
- name: Inject docker cache manually
45+
- name: Inject docker cache
6046
ansible.builtin.shell:
6147
cmd: ansible/scripts/inject_docker_cache.sh "{{ collector_root }}/{{ ccache_dir }}" "{{ container_ccache_dir }}"
6248
chdir: "{{ collector_root }}"
@@ -75,13 +61,20 @@
7561
chdir: "{{ collector_root }}"
7662
when: arch == "s390x"
7763

78-
- name: Copy ccache from build machine to controller
64+
- name: Fetch ccache
7965
ansible.builtin.fetch:
8066
src: "{{ collector_root }}/{{ ccache_path }}"
8167
dest: "{{ github_workspace }}/{{ ccache_dir }}/"
8268
flat: yes
8369
when: arch == "s390x"
8470

71+
- name: Fetch build log
72+
ansible.builtin.fetch:
73+
src: "{{ collector_root }}/build_builder_image.log"
74+
dest: "{{ github_workspace }}/"
75+
flat: yes
76+
when: arch == "s390x"
77+
8578
- name: Retag collector builder image to arch specific
8679
community.docker.docker_image:
8780
name: "quay.io/stackrox-io/collector-builder:{{ ansible_env.COLLECTOR_BUILDER_TAG }}"

ansible/ci-build-collector.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,33 +27,27 @@
2727
version: "{{ local_branch }}"
2828
refspec: "+{{ collector_git_ref | replace('refs/', '') }}:{{ local_branch }}"
2929
recursive: true
30-
when: arch == "s390x"
31-
32-
- name: Create a ccache directory if it does not exist
33-
ansible.builtin.file:
34-
path: "{{ collector_root }}/{{ ccache_dir }}"
35-
state: directory
30+
depth: 1
3631
when: arch == "s390x"
3732

3833
- name: Check if remote ccache archive exists on controller
34+
delegate_to: localhost
3935
ansible.builtin.stat:
4036
path: "{{ github_workspace }}/{{ ccache_dir }}/{{ ccache_archive }}"
41-
delegate_to: localhost
4237
register: ccache_check
4338
when: arch == "s390x"
4439

4540
- name: Copy ccache from the controller to build VM
4641
ansible.builtin.copy:
4742
src: "{{ github_workspace }}/{{ ccache_dir }}/{{ ccache_archive }}"
48-
dest: "{{ collector_root }}/{{ ccache_archive }}"
49-
mode: preserve
50-
remote_src: no
51-
delegate_to: localhost
43+
dest: "{{ collector_root }}/"
5244
when: arch == "s390x" and ccache_check.stat.exists
5345

5446
- name: Extract ccache archive if found
55-
ansible.builtin.shell:
56-
cmd: tar -xzf "{{ collector_root }}/{{ ccache_archive }}" -C "{{ collector_root }}/{{ ccache_dir }}"
47+
ansible.builtin.unarchive:
48+
src: "{{ collector_root }}/{{ ccache_archive }}"
49+
dest: "{{ collector_root }}/{{ ccache_dir }}"
50+
remote_src: true
5751
when: arch == "s390x" and ccache_check.stat.exists
5852

5953
- name: Run the builder image

0 commit comments

Comments
 (0)