Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions ansible/roles/dev-desktop/tasks/cleanup.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
- name: Copy cleanup script
template:
src: clean-unused-checkouts.sh
dest: /etc/cron.cleanup_disk_space

- name: Install clean-unused-checkouts binary
copy:
src: "{{ playbook_dir }}/../../../../setup-deploy-keys/target/release/clean-unused-checkouts"
Copy link

@Carbonhell Carbonhell Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(disclaimer: I don't know much of Ansible) is the intended deployment strategy to compile the binary locally, with the target set based on the dev-desktop architecture/os? Would it make sense to add the compilation step as an Ansible task/playbook? Otherwise a simple note in the README would work as well

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me neither. Let's wait for the review from the team, and I will make the necessary changes.

dest: /usr/local/bin/clean-unused-checkouts
owner: root
group: root
mode: 0744
mode: 0755

- name: Set up the cleanup cron job
template:
Expand Down
74 changes: 0 additions & 74 deletions ansible/roles/dev-desktop/templates/clean-unused-checkouts.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
0 0 * * * root /etc/cron.cleanup_disk_space
0 0 * * * root /usr/local/bin/clean-unused-checkouts
9 changes: 9 additions & 0 deletions setup-deploy-keys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ edition = "2021"
name = "deploy"
path = "src/deploy.rs"

[[bin]]
name = "clean-unused-checkouts"
path = "src/clean_unused_checkouts.rs"

[dependencies]
clap = { version = "4", features = ["derive", "env"] }
chrono = "0.4"
reqwest = { version = "0.11", features = ["blocking", "json"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
base64 = "0.13"
walkdir = "2.4"

[dev-dependencies]
tempfile = "3.10"

Loading