These script bring github-pages like functionality to the cs servers. GitHub still serves as the remote repository, but build and deploy is moved to cs servers. Pushing local changes or making modifications through GitHub's ui should trigger a build on the cs server. The built site is then deployed to the course site folder.
build_course_site.py - commandline utility that builds and deploys course site
- based on repository name...
- pulls changes from a github repo that contains the course site
- uses jekyll to build site
- rsyncs built site to deployment directory
- emails on exceptions
- logs last build info to file
build.cgi - cgi script that serves as webhook for course repo on github
- assuming that course repo is configured to POST to this script on commits (actually push)...
- extracts repository name
- calls
build_course_site.py
(all available on department's servers)
- jekyll
- git
- cgi / python
- on server
- place
build.cgi
in cgi-bin (see helpdesk directions on proper permissions and location) - place
build_course_site.py
in any directory on server; just make sure it's executable
- place
- on github
- create new repository with name in this format:
csci-ua.0123-fall2016-009
- under settings, add webhook for push only... the url should point to the location of
build.cgi
- create new repository with name in this format:
- on server (again)
- clone your repository
- modify the default values in
build_course_site.py
to use the appropriate values for:DEFAULT_STAGING_PATH
- directory that contains your cloned repoDEFAULT_COURSES_BASE_PATH
- absolute path to directory that contains course all course sites w/ out semeseterDEFAULT_SERVER
- smtp server for sending error emails
- fill in the blank values in
build.cgi
under the firstTODO
cmd
- absolute path to location of build_course_site.pyerroremail
- append email address of where error messages should be sentsender
- append eemail address of senderlog
- absolute path to location of build logs
build_course_site.py
can be used as a standalone commandline utility (independent from the cgi script) to pull, build and deploy your site:
build_course_site.py [-h] [--staging STAGING] [--target TARGET]
[--erroremail ERROREMAIL] [--sender SENDER]
[--server SERVER] [--log LOG]
repo_name
To use with the webhook:
- make a change to your repo and push it
- you can find the output of the webhook in github's ui through the webhook page under settings
- the cgi script should always respond with the post data that it received from github
- ...the status of the webhook should have a green checkmark
- note that the cgi-script should give back a response even before the site is built