Skip to content

Commit 12e311b

Browse files
committed
kdevops_archive: read commit message from file
Fix error below by creating a temporary file with commit message and use that as input: 1. Create temporary file 2. Create temporary var with commit message 3. Write commit message to file 4. git-commit using temporary file content 5. Delete temporary file Also, update tasks to include FQCN. Error: TASK [kdevops_archive : Commit the archive] ************************************ fatal: [localhost]: FAILED! => { "changed": true, "cmd": "git commit -m \"kdevops: Revert \"bringup: Use full path when creating custom_source file\"\n\nThis adds test results for:\n workflow: fstests\n tree: linux\n ref: linux\n test number: 0001\n test result: ok\n\nDetailed test report:\n\nKERNEL: 6.14.0-rc2\nCPUS: 8\n\nxfs_reflink_4k: 1 tests, 16 seconds\n generic/003 Pass 13s\nTotals: 1 tests, 0 skipped, 0 failures, 0 errors, 13s\n\"\n", "delta": "0:00:00.006967", "end": "2025-02-10 02:34:48.789646", "rc": 1, "start": "2025-02-10 02:34:48.782679" } STDERR: error: pathspec 'Use' did not match any file(s) known to git error: pathspec 'full' did not match any file(s) known to git error: pathspec 'path' did not match any file(s) known to git error: pathspec 'when' did not match any file(s) known to git error: pathspec 'creating' did not match any file(s) known to git error: pathspec 'custom_source' did not match any file(s) known to git error: pathspec 'file This adds test results for: workflow: fstests tree: linux ref: linux test number: 0001 test result: ok Detailed test report: KERNEL: 6.14.0-rc2 CPUS: 8 xfs_reflink_4k: 1 tests, 16 seconds generic/003 Pass 13s Totals: 1 tests, 0 skipped, 0 failures, 0 errors, 13s ' did not match any file(s) known to git MSG: non-zero return code PLAY RECAP ********************************************************************* localhost : ok=53 changed=15 unreachable=0 failed=1 skipped=12 rescued=0 ignored=0 Signed-off-by: Daniel Gomez <[email protected]>
1 parent 5649a0d commit 12e311b

File tree

1 file changed

+21
-3
lines changed
  • playbooks/roles/kdevops_archive/tasks

1 file changed

+21
-3
lines changed

playbooks/roles/kdevops_archive/tasks/main.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,15 @@
408408
kdevops_archive_ci_test_result: "unknown"
409409
when: not ci_result_file.stat.exists
410410

411+
- name: Create a temporary file for commit message
412+
ansible.builtin.tempfile:
413+
state: file
414+
suffix: txt
415+
prefix: kdevops_commit_msg_
416+
register: tmp_commit_msg
417+
411418
- name: Set commit message
412-
set_fact:
419+
ansible.builtin.set_fact:
413420
commit_message: |
414421
{{ kdevops_archive_test_trigger }}: {{ kdevops_archive_test_subject }}
415422
@@ -424,14 +431,25 @@
424431
425432
{{ kdevops_archive_test_commit }}
426433
434+
- name: Copy commit message into temporary file
435+
ansible.builtin.copy:
436+
content: "{{ commit_message }}"
437+
dest: "{{ tmp_commit_msg.path }}"
438+
mode: '0644'
439+
427440
- name: Commit the archive
428-
shell: |
429-
git commit -m "{{ commit_message }}"
441+
ansible.builtin.shell: |
442+
git commit --file "{{ tmp_commit_msg.path }}"
430443
args:
431444
chdir: "{{ kdevops_results_archive_dir }}"
432445
environment:
433446
GIT_LFS_SKIP_SMUDGE: "0"
434447

448+
- name: Remove temporary file with commit message
449+
ansible.builtin.file:
450+
path: "{{ tmp_commit_msg.path }}"
451+
state: absent
452+
435453
- name: Push changes to remote repository
436454
command:
437455
cmd: git push origin main

0 commit comments

Comments
 (0)