Skip to content

Commit ec56108

Browse files
committed
create ccache dir on remote for collector build
optimize git on s390x
1 parent 08eafb8 commit ec56108

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

ansible/ci-build-builder.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,30 @@
2626
version: "{{ local_branch }}"
2727
refspec: "+{{ collector_git_ref | replace('refs/', '') }}:{{ local_branch }}"
2828
depth: 1
29-
recursive: true
29+
recursive: false
3030
when: arch == "s390x"
3131

32-
- name: Check if ccache archive exists
32+
- name: Clone submodules
33+
ansible.builtin.shell: |
34+
git submodule update --init --depth 1
35+
args:
36+
chdir: "{{ collector_root }}"
37+
when: arch == "s390x"
38+
39+
- name: Check if ccache exists
3340
delegate_to: localhost
3441
ansible.builtin.stat:
3542
path: "{{ github_workspace }}/{{ ccache_path }}"
3643
register: ccache_check
3744
when: arch == "s390x"
3845

39-
- name: Copy ccache to build
46+
- name: Copy ccache
4047
ansible.builtin.copy:
4148
src: "{{ github_workspace }}/{{ ccache_path }}"
4249
dest: "{{ collector_root }}/{{ ccache_dir }}/"
4350
when: arch == "s390x" and ccache_check.stat.exists
4451

45-
- name: Inject docker cache
52+
- name: Inject docker cache with ccache
4653
ansible.builtin.shell:
4754
cmd: ansible/scripts/inject_docker_cache.sh "{{ collector_root }}/{{ ccache_dir }}" "{{ container_ccache_dir }}"
4855
chdir: "{{ collector_root }}"
@@ -55,7 +62,7 @@
5562
params:
5663
USE_CCACHE: "true"
5764

58-
- name: Extract docker cache
65+
- name: Extract ccache from docker cache
5966
ansible.builtin.shell:
6067
cmd: ansible/scripts/extract_docker_cache.sh "{{ collector_root }}/{{ ccache_dir }}" "{{ container_ccache_dir }}"
6168
chdir: "{{ collector_root }}"

ansible/ci-build-collector.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,37 @@
2626
# than with commit hashes, prevents "reference is not a tree" errors
2727
version: "{{ local_branch }}"
2828
refspec: "+{{ collector_git_ref | replace('refs/', '') }}:{{ local_branch }}"
29-
recursive: true
3029
depth: 1
30+
recursive: false
3131
when: arch == "s390x"
3232

33-
- name: Check if remote ccache archive exists on controller
33+
- name: Clone submodules
34+
ansible.builtin.shell: |
35+
git submodule update --init --depth 1
36+
args:
37+
chdir: "{{ collector_root }}"
38+
when: arch == "s390x"
39+
40+
- name: Check if ccache exists
3441
delegate_to: localhost
3542
ansible.builtin.stat:
3643
path: "{{ github_workspace }}/{{ ccache_dir }}/{{ ccache_archive }}"
3744
register: ccache_check
3845
when: arch == "s390x"
3946

40-
- name: Copy ccache from the controller to build VM
47+
- name: Create cccache directory
48+
ansible.builtin.file:
49+
path: "{{ collector_root }}/{{ ccache_dir }}"
50+
state: directory
51+
when: arch == "s390x" and ccache_check.stat.exists
52+
53+
- name: Copy ccache
4154
ansible.builtin.copy:
4255
src: "{{ github_workspace }}/{{ ccache_dir }}/{{ ccache_archive }}"
4356
dest: "{{ collector_root }}/"
4457
when: arch == "s390x" and ccache_check.stat.exists
4558

46-
- name: Extract ccache archive if found
59+
- name: Unarchive ccache
4760
ansible.builtin.unarchive:
4861
src: "{{ collector_root }}/{{ ccache_archive }}"
4962
dest: "{{ collector_root }}/{{ ccache_dir }}"
@@ -73,7 +86,7 @@
7386
tar czf "{{ collector_root }}/{{ ccache_archive }}" .
7487
when: arch == "s390x"
7588

76-
- name: Copy ccache from build machine to controller
89+
- name: Fetch ccache
7790
ansible.builtin.fetch:
7891
src: "{{ collector_root }}/{{ ccache_archive }}"
7992
dest: "{{ github_workspace }}/{{ ccache_dir }}/"

0 commit comments

Comments
 (0)