You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2015/09/25 00:54:41 UTC

svn commit: r1705187 - in /comdev/projects.apache.org: STRUCTURE.txt scripts/README.txt scripts/cronjobs/reportingcycles.py scripts/cronjobs/reportingcycles.sh

Author: sebb
Date: Thu Sep 24 22:54:41 2015
New Revision: 1705187

URL: http://svn.apache.org/viewvc?rev=1705187&view=rev
Log:
Added reportingcycles processing
TODO add to crontab

Added:
    comdev/projects.apache.org/scripts/cronjobs/reportingcycles.py   (with props)
    comdev/projects.apache.org/scripts/cronjobs/reportingcycles.sh   (with props)
Modified:
    comdev/projects.apache.org/STRUCTURE.txt
    comdev/projects.apache.org/scripts/README.txt

Modified: comdev/projects.apache.org/STRUCTURE.txt
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/STRUCTURE.txt?rev=1705187&r1=1705186&r2=1705187&view=diff
==============================================================================
--- comdev/projects.apache.org/STRUCTURE.txt (original)
+++ comdev/projects.apache.org/STRUCTURE.txt Thu Sep 24 22:54:41 2015
@@ -33,6 +33,7 @@ Suggested cron setup:
     scripts/cronjobs/podlings.py - daily
     scripts/cronjobs/countaccounts.py - weekly
     scripts/cronjobs/parsereleases.py - daily
+    scripts/cronjobs/reportincycles.sh - daily
 
 Stuff to run manually when needed:
     scripts/import/parsecommittees.py
@@ -58,6 +59,7 @@ crontab -l -u www-data:
 00 00 * * * cd /var/www/projects.apache.org/scripts/cronjobs && python3.4 parsechairs.py
 00 00 * * * cd /var/www/projects.apache.org/scripts/cronjobs && python3.4 countaccounts.py
 00 00 * * * cd /var/www/projects.apache.org/scripts/cronjobs && python3.4 parsereleases.py
+00 00 * * * cd /var/www/projects.apache.org/scripts/cronjobs && ./reportingcycles.sh
 
 Note: the puppet config for the VM is stored at:
 

Modified: comdev/projects.apache.org/scripts/README.txt
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/README.txt?rev=1705187&r1=1705186&r2=1705187&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/README.txt (original)
+++ comdev/projects.apache.org/scripts/README.txt Thu Sep 24 22:54:41 2015
@@ -30,6 +30,9 @@ various sources:
   out: json/foundation/releases.json
      + json/foundation/releases-files.json
 
+- reportingcycles.sh
+  in: committee-info.json
+  out reporter.apache.org/site/reportingcycles.json
 
 2. importing data (import)
 

Added: comdev/projects.apache.org/scripts/cronjobs/reportingcycles.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/reportingcycles.py?rev=1705187&view=auto
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/reportingcycles.py (added)
+++ comdev/projects.apache.org/scripts/cronjobs/reportingcycles.py Thu Sep 24 22:54:41 2015
@@ -0,0 +1,27 @@
+import sys
+sys.path.append("..") # module committee_info is in parent directory
+import committee_info
+import json
+
+"""
+Reads committee-info.json via committee_info module
+
+Creates:
+../../data/cache/reportingcycles.json
+
+This file is not used by the projects.a.o site.
+However it is simpler to keep the CI scripts together.
+The file is read directly by render.js so needs to be available
+from the local website.
+Therefore the file is created in the p.a.o cache and then
+copied to the final output destination for use by reporter.a.o
+"""
+
+cycles = committee_info.cycles()
+
+print("Writing reportingcycles.json")
+with open("../../data/cache/reportingcycles.json", "w", encoding='utf-8') as f:
+    json.dump(cycles, f, sort_keys = True, indent=1, ensure_ascii=False)
+    f.close()
+
+print("All done!")
\ No newline at end of file

Propchange: comdev/projects.apache.org/scripts/cronjobs/reportingcycles.py
------------------------------------------------------------------------------
    svn:eol-style = native

Added: comdev/projects.apache.org/scripts/cronjobs/reportingcycles.sh
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/reportingcycles.sh?rev=1705187&view=auto
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/reportingcycles.sh (added)
+++ comdev/projects.apache.org/scripts/cronjobs/reportingcycles.sh Thu Sep 24 22:54:41 2015
@@ -0,0 +1,8 @@
+# Create the reporting cycles file and copy it to reporter.a.o
+
+python3 reportingcycles.py
+
+echo copying ../../data/cache/reportingcycles.json  to ../../../reporter.apache.org/
+cp ../../data/cache/reportingcycles.json ../../../reporter.apache.org/site/
+
+echo All done
\ No newline at end of file

Propchange: comdev/projects.apache.org/scripts/cronjobs/reportingcycles.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: comdev/projects.apache.org/scripts/cronjobs/reportingcycles.sh
------------------------------------------------------------------------------
    svn:executable = *