From 91267d4d49d4f38638c8230320cac9824272d422 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 27 Nov 2024 09:44:45 -0800 Subject: [PATCH] Templatize branched nightly cron Instead of doing this by hand at branch and final release, let's make it a template. Signed-off-by: Adam Williamson --- playbooks/groups/releng-compose.yml | 2 ++ roles/releng/files/branched | 3 --- roles/releng/tasks/main.yml | 2 +- roles/releng/templates/branched.j2 | 7 +++++++ vars/all/README | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) delete mode 100644 roles/releng/files/branched create mode 100644 roles/releng/templates/branched.j2 diff --git a/playbooks/groups/releng-compose.yml b/playbooks/groups/releng-compose.yml index bc1f68fccb..6ff57c3722 100644 --- a/playbooks/groups/releng-compose.yml +++ b/playbooks/groups/releng-compose.yml @@ -18,6 +18,8 @@ vars_files: - /srv/web/infra/ansible/vars/global.yml - "/srv/web/infra/ansible/vars/all/00-FedoraCycleNumber.yaml" + - "/srv/web/infra/ansible/vars/all/FedoraBranched.yaml" + - "/srv/web/infra/ansible/vars/all/FedoraBranchedNumber.yaml" - "/srv/web/infra/ansible/vars/all/FedoraPreviousCycleNumber.yaml" - "/srv/web/infra/ansible/vars/all/FedoraPreviousPrevious.yaml" - "/srv/web/infra/ansible/vars/all/FedoraPreviousPreviousCycleNumber.yaml" diff --git a/roles/releng/files/branched b/roles/releng/files/branched deleted file mode 100644 index d07834dd40..0000000000 --- a/roles/releng/files/branched +++ /dev/null @@ -1,3 +0,0 @@ -# branched compose -# MAILTO=releng-cron@lists.fedoraproject.org -# 15 7 * * * root touch /tmp/fedora-compose-branched && TMPDIR=`mktemp -d /tmp/branched.XXXXXX` && chmod 755 $TMPDIR && cd $TMPDIR && git clone https://pagure.io/pungi-fedora.git && cd pungi-fedora && git checkout f41 && /usr/local/bin/lock-wrapper branched-compose "LANG=en_US.UTF-8 ./nightly.sh" && sudo -u ftpsync /usr/local/bin/update-fullfiletimelist -l /pub/fedora-secondary/update-fullfiletimelist.lock -t /pub fedora fedora-secondary && rm /tmp/fedora-compose-branched diff --git a/roles/releng/tasks/main.yml b/roles/releng/tasks/main.yml index c24c4fa7c7..49587031a0 100644 --- a/roles/releng/tasks/main.yml +++ b/roles/releng/tasks/main.yml @@ -300,7 +300,7 @@ # put cron job in for branched compose - name: Branched compose cron - ansible.builtin.copy: + ansible.builtin.template: src: branched dest: /etc/cron.d/branched mode: "644" diff --git a/roles/releng/templates/branched.j2 b/roles/releng/templates/branched.j2 new file mode 100644 index 0000000000..ba3a46495b --- /dev/null +++ b/roles/releng/templates/branched.j2 @@ -0,0 +1,7 @@ +# branched compose +# MAILTO=releng-cron@lists.fedoraproject.org +{% if FedoraBranched %} +15 7 * * * root touch /tmp/fedora-compose-branched && TMPDIR=`mktemp -d /tmp/branched.XXXXXX` && chmod 755 $TMPDIR && cd $TMPDIR && git clone https://pagure.io/pungi-fedora.git && cd pungi-fedora && git checkout f{{ FedoraBranchedNumber }} && /usr/local/bin/lock-wrapper branched-compose "LANG=en_US.UTF-8 ./nightly.sh" && sudo -u ftpsync /usr/local/bin/update-fullfiletimelist -l /pub/fedora-secondary/update-fullfiletimelist.lock -t /pub fedora fedora-secondary && rm /tmp/fedora-compose-branched +{% else %} +# No Branched at present, this space intentionally left blank +{% endif %} diff --git a/vars/all/README b/vars/all/README index 483ea04399..ba909b18ed 100644 --- a/vars/all/README +++ b/vars/all/README @@ -28,7 +28,7 @@ Fedora N-2 (stable) These are controlled by some variables: 00-FedoraCycleNumber.yaml - The current stable release -FedoraBranchedBodhi.yaml - If bodhi is enabled, If it's prebeta or postbeta +FedoraBranchedBodhi.yaml - If bodhi is enabled, whether it's preenable, prebeta, postbeta or current FedoraBranchedNumber.yaml - The current branched release, or 0 if it doesnt exist FedoraBranched.yaml - true if there is a branched, false otherwise FedoraPreviousCycleNumber.yaml - number of previous stable release