Skip to content

Commit

Permalink
add a simple status page
Browse files Browse the repository at this point in the history
  • Loading branch information
rubys committed Feb 1, 2016
1 parent 3348f6e commit 3acdd34
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions status.cgi
@@ -0,0 +1,30 @@
#!/usr/bin/python
print "Content-type: text/html\r\n\r\n",

import cgi, subprocess

log = {}

log['git_log'] = subprocess.check_output(['git', 'log', '-1'])
log['git_status'] = subprocess.check_output(['git', 'status'])
log['python_version'] = subprocess.check_output(['python', '--version'],
stderr=subprocess.STDOUT)

print '''
<!DOCTYPE html>
<html>
<head>
<title>Feedvalidator status check</title>
</head>
<body>
<h1>Git</h1>
<h2>log</h2>
<pre>%(git_log)s</pre>
<h2>status</h2>
<pre>%(git_status)s</pre>
<h1>Python</h1>
<pre>%(python_version)s</pre>
</body>
<html>
'''[1:-1] % {k: cgi.escape(v.strip()) for k,v in log.items()}

0 comments on commit 3acdd34

Please sign in to comment.