Skip to content

Commit 64b4add

Browse files
committed
kdevops_archive: ensure git LFS is used
Early tests are showing that although things are working now as expected git lfs is not used sometimes, it seems this may just be git lfs is not installed on some systems, so use the generic package manager by ansible to install it, and use environment variables to be pedantic about using LFS. Signed-off-by: Luis Chamberlain <[email protected]>
1 parent 8bbc88d commit 64b4add

File tree

1 file changed

+18
-0
lines changed
  • playbooks/roles/kdevops_archive/tasks

1 file changed

+18
-0
lines changed

playbooks/roles/kdevops_archive/tasks/main.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
---
2+
- name: Install git-lfs
3+
package:
4+
name: git-lfs
5+
state: present
6+
27
- name: Override kdevops archive repo url to demo URL if in demo mode
38
set_fact:
49
kdevops_results_repo_url: "{{ kdevops_results_repo_url_demo }}"
@@ -288,11 +293,19 @@
288293
dest: "{{ kdevops_results_archive_dir }}/{{ kdevops_archive_prefix }}"
289294
mode: '0644'
290295

296+
- name: Ensure .xz files are tracked by Git LFS
297+
command:
298+
cmd: git lfs track "*.xz"
299+
args:
300+
chdir: "{{ kdevops_results_archive_dir }}"
301+
291302
- name: Stage the new archive file
292303
command:
293304
cmd: git add "{{ kdevops_archive_prefix }}{{ target_linux_ref }}.xz"
294305
args:
295306
chdir: "{{ kdevops_results_archive_dir }}"
307+
environment:
308+
GIT_LFS_SKIP_SMUDGE: "0"
296309

297310
- name: Set commit message
298311
set_fact:
@@ -310,12 +323,17 @@
310323
git commit -m "{{ commit_message }}"
311324
args:
312325
chdir: "{{ kdevops_results_archive_dir }}"
326+
environment:
327+
GIT_LFS_SKIP_SMUDGE: "0"
313328

314329
- name: Push changes to remote repository
315330
command:
316331
cmd: git push origin main
317332
args:
318333
chdir: "{{ kdevops_results_archive_dir }}"
334+
environment:
335+
GIT_LFS_SKIP_SMUDGE: "0"
336+
GIT_LFS_FORCE: "1"
319337
register: git_push_result
320338
ignore_errors: yes
321339

0 commit comments

Comments
 (0)