Automating bodhi daily pushes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please review this change:
diff --git a/roles/bodhi2/backend/files/bodhi-automated-pushes.cron b/roles/bodhi2/backend/files/bodhi-au
new file mode 100644
index 0000000..7e12cfd
--- /dev/null
+++ b/roles/bodhi2/backend/files/bodhi-automated-pushes.cron
@@ -0,0 +1 @@
+59 23 * * * apache /usr/local/bin/bodhi-automated-pushes.py
diff --git a/roles/bodhi2/backend/files/bodhi-automated-pushes.py b/roles/bodhi2/backend/files/bodhi-auto
new file mode 100644
index 0000000..aacc81c
--- /dev/null
+++ b/roles/bodhi2/backend/files/bodhi-automated-pushes.py
@@ -0,0 +1,12 @@
+import requests
+import json
+import subprocess
+import logging
+
+req = requests.get('https://bodhi.fedoraproject.org/composes/')
+bodhi_composes = req.json()
+
+if len(bodhi_composes['composes']) == 0:
+    bodhi_push_cmd = ["bodhi-push", "--username", "releng"]
+    push = subprocess.Popen(bodhi_push_cmd, stdout=PIPE, stderr=PIPE, stdin=PIPE)
+    push.stdin.write('y')
diff --git a/roles/bodhi2/backend/tasks/main.yml b/roles/bodhi2/backend/tasks/main.yml
index f76d944..054cef1 100644
--- a/roles/bodhi2/backend/tasks/main.yml
+++ b/roles/bodhi2/backend/tasks/main.yml
@@ -264,6 +264,14 @@
   - bodhi
   - cron
 
+- name: put bodhi-automated-pushes.py in place
+  copy: src="" dest=/usr/local/bin/bodhi-automated-pushes.py mode=0755
+  when: inventory_hostname.startswith('bodhi-backend01') and env == "production"
+  tags:
+  - config
+  - bodhi
+  - cron
+
 - name: put update-fullfiletimelist in place
   copy: src="" files }}/scripts/update-fullfiletimelist" dest=/usr/local/bin/update-fullfiletimelist mo
   when: inventory_hostname.startswith('bodhi-backend01') and env == "production"
@@ -288,6 +296,14 @@
   - bodhi
   - cron
 
+- name: Set the bodhi-automated-pushes cron job
+  copy: src="" dest=/etc/cron.d/bodhi-automated-pushes
+  when: inventory_hostname.startswith('bodhi-backend01') and env == "production"
+  tags:
+  - config
+  - bodhi
+  - cron
+
 - name: directory sizes update cron job.
   cron: name="directory-sizes-update" minute="30" hour="19" user="ftpsync"
         job="/usr/bin/find /pub/alt/ /pub/archive/ /pub/fedora-secondary/ /pub/fedora/ /pub/epel/ -type 


During freezes the cron job is disabled and we will push the updates manually.
_______________________________________________
infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx

[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux