From c4e0f20fa1ce31acf6dd31453f48d02cde178c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 29 Sep 2021 11:21:15 +0200 Subject: [PATCH] beacon-node-builds: keep only 3 days worth of builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- ansible/roles/beacon-node-builds/defaults/main.yml | 3 ++- ansible/roles/beacon-node-builds/tasks/build.yml | 2 +- ansible/roles/beacon-node-builds/templates/build.sh.j2 | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ansible/roles/beacon-node-builds/defaults/main.yml b/ansible/roles/beacon-node-builds/defaults/main.yml index 189f65b..25496da 100644 --- a/ansible/roles/beacon-node-builds/defaults/main.yml +++ b/ansible/roles/beacon-node-builds/defaults/main.yml @@ -3,13 +3,14 @@ beacon_node_builds_user: 'nimbus' beacon_node_builds_group: 'staff' beacon_node_builds_path: '/data/beacon-node-builds' beacon_node_builds_image_name: 'statusteam/nimbus_beacon_node' +beacon_node_builds_days_kept: 3 # Required for pushing the images beacon_node_builds_docker_hub_user: ~ beacon_node_builds_docker_hub_token: ~ # Timers -beacon_node_build_timer_timeout: 3600 +beacon_node_builds_timer_timeout: 3600 beacon_node_builds_branches: [] # - name: 'unstable' diff --git a/ansible/roles/beacon-node-builds/tasks/build.yml b/ansible/roles/beacon-node-builds/tasks/build.yml index 5a24f18..9babe66 100644 --- a/ansible/roles/beacon-node-builds/tasks/build.yml +++ b/ansible/roles/beacon-node-builds/tasks/build.yml @@ -55,6 +55,6 @@ systemd_timer_consul_warning: true systemd_timer_enabled: '{{ item.enabled | default(true) }}' systemd_timer_frequency: '{{ item.frequency | default("daily") }}' - systemd_timer_timeout_sec: '{{ beacon_node_build_timer_timeout }}' + systemd_timer_timeout_sec: '{{ beacon_node_builds_timer_timeout }}' systemd_timer_work_dir: '{{ beacon_node_builds_path }}/{{ item.name }}' systemd_timer_script_path: '{{ beacon_node_builds_path }}/{{ item.name }}/build.sh' diff --git a/ansible/roles/beacon-node-builds/templates/build.sh.j2 b/ansible/roles/beacon-node-builds/templates/build.sh.j2 index 288fccb..ae7551b 100644 --- a/ansible/roles/beacon-node-builds/templates/build.sh.j2 +++ b/ansible/roles/beacon-node-builds/templates/build.sh.j2 @@ -33,7 +33,7 @@ function buildBinaries() { mv "build/nimbus_signing_process" "build/nimbus_signing_process_${COMMIT}" # Delete copies that are older than 7 days - find build -mtime +7 -exec rm '{}' \+ + find build -mtime +{{ beacon_node_builds_days_kept }} -exec rm '{}' \+ } # Adds binary into a simple Alpine image