Skip to content

Commit 0fdcf5b

Browse files
Fixed "Compute Thunderloop MD5 Hash" Ansible Task (UBC-Thunderbots#3589)
* Commented out broken "Compute Thunderloop MD5 Hash" Ansible playbook command. This command prevents the setup_pi playbook from successfully executing. * changed glob pattern matching to use ansible.builtin.shell instead of ansible.builtin.sudo * added ansible task to import thunderloop_MD5_hash.sh to raspberry pi * Fixed dependences for Ansible task: Compute Thunderloop MD5 Hash * Modified/added ansible tasks to transfer hash_thunderloop_binary.sh to rasp pi and allow its execution * Revert "changed glob pattern matching to use ansible.builtin.shell instead of ansible.builtin.sudo" This reverts commit 72e629e. * [pre-commit.ci lite] apply automatic fixes * changed sh_binary in BUILD file to filegroup to configure dependency without making file directly executable --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent 46b5005 commit 0fdcf5b

4 files changed

Lines changed: 18 additions & 1 deletion

File tree

src/software/embedded/BUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ sh_binary(
110110
srcs = ["setup_robot_software_deps.sh"],
111111
)
112112

113+
filegroup(
114+
name = "hash_thunderloop_binary",
115+
srcs = ["hash_thunderloop_binary.sh"],
116+
)
117+
113118
cc_test(
114119
name = "test_battery",
115120
srcs = ["battery_test.cpp"],

src/software/embedded/ansible/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ py_binary(
1818
data = [
1919
":playbooks",
2020
":tasks",
21+
"//software/embedded:hash_thunderloop_binary.sh",
2122
"//software/embedded:setup_robot_software_deps",
2223
"//software/embedded:thunderloop_main",
2324
"//software/embedded/linux_configs/jetson_nano:jetson_nano_files",

src/software/embedded/ansible/tasks/setup_systemd.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@
1515
dest: ~/thunderbots_binaries/
1616
copy_links: true
1717

18+
- name: Sync Thunderloop MD5 Hash
19+
ansible.posix.synchronize:
20+
src: "{{ playbook_dir }}/../../hash_thunderloop_binary.sh"
21+
dest: "~/hash_thunderloop_binary.sh"
22+
copy_links: true
23+
24+
- name: Make MD5 Hash Script Executable
25+
ansible.builtin.file:
26+
path: "~/hash_thunderloop_binary.sh"
27+
mode: "0755"
28+
1829
- name: Compute Thunderloop MD5 Hash
1930
ansible.builtin.command: "/home/{{ ansible_user }}/hash_thunderloop_binary.sh"
2031
register: result

src/software/embedded/hash_thunderloop_binary.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ a60a083f11289d0904c9c4bf8fa59a59 thunderloop
1414
1515
using the awk command filters out only the first argument passed to it, in this case the MD5 hash
1616
'
17-
hash=$(md5sum ~/thunderbots_binaries/thunderloop | awk '{ print $1}')
17+
hash=$(md5sum ~/thunderbots_binaries/thunderloop_main | awk '{ print $1}')
1818
run_date=$(date '+%x %H:%M')
1919

2020
echo "$hash" > ~/thunderbots_hashes/thunderloop.hash

0 commit comments

Comments
 (0)