The main ocf website
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
bootstrap-scss @ 8cd2bf8 Import my last attempt at styling Aug 22, 2015
conf labstats -> ocfweb draft wip May 5, 2018
ocfweb Merge pull request #428 from ocf/update-officers Dec 16, 2018
services Remove spiped Feb 11, 2017
tests Rename valid_domain to available_domain Aug 19, 2018
vendor Bump venv-update Apr 15, 2018 100% coverage on vhost_mail Sep 16, 2016
.coveragerc Use pytest-cov Aug 19, 2018 100% coverage on vhost_mail Sep 16, 2016
.dockerignore Remove Debian packaging, Nov 5, 2016
.gitignore Upgrade to Django 2.0 Feb 2, 2018
.gitmodules Import my last attempt at styling Aug 22, 2015
.pre-commit-config.yaml Upgrade pre-commit hooks, add a few additional hooks Sep 3, 2018
.scss-lint.yml Add support for multiple "forward to" addresses Aug 28, 2016
Dockerfile Auto-minify JS and CSS. Nov 21, 2017 Added command to recursively minify. Nov 23, 2017 Remove spiped Feb 11, 2017 Remove spiped Feb 11, 2017
Jenkinsfile Move credential step into shared pipeline Oct 16, 2018
LICENSE Add LICENSE Apr 21, 2016 Delete .version from Apr 18, 2017
Makefile Makefile: sassc -> pysassc to fix deprecation Oct 6, 2018 Update coveralls badge Aug 28, 2018
docs Add symlink to docs in root Aug 29, 2015 Add starter Django template Aug 22, 2015
pytest.ini Use pytest-cov Aug 19, 2018
requirements-dev-minimal.txt Add comment about pytest-django version pinning Aug 19, 2018
requirements-dev.txt Bump requirements. Oct 3, 2018
requirements-minimal.txt Bump requirements Aug 7, 2018
requirements.txt Update requests to 2.20.0 Oct 29, 2018
tox.ini Improve templating Aug 22, 2015


Build Status Coverage Status Code Health

The main ocf website.

Working on ocfweb

Clone the repo, and be sure to check out submodules:

$ git clone
$ git submodule update --init

If you run into problems with scss where it can't import bootstrap, it's because you forgot to run the second command.

Running in development mode

Either on supernova, or on your own staff VM[0], run make dev. The first time will take a while, but future runs will be almost instant thanks to pip-faster.

It will start listening on a deterministically random port (really, 8000 plus the last 3 digits of your user id) which is printed to you. You can then view the site in development.

Building SCSS

Run make scss to build SCSS. You can also use make watch-scss to rebuild it automatically when SCSS files change.

Running tests

To run tests locally, run make test. Please don't push to master with failing tests—Jenkins will refuse to deploy your code, and nobody will be able to deploy until fixing it.

If you make a pull request to the OCF GitHub organization from your fork of ocfweb, Jenkins will attempt to build and test your branch automatically. If your build fails, you can log into Jenkins to see which tests you've failed and fix them, if running make test locally didn't already tell you.

You can run individual tests with venv/bin/pytest -k <test_name> or venv/bin/pytest <test_file>::<test_name> if running all tests is too slow.

Running pre-commit

We use pre-commit to lint our code before commiting. While some of the rules might seem a little arbitrary, it helps keep the style consistent, and ensure annoying things like trailing whitespace don't creep in.

You can simply run make install-hooks to install the necessary git hooks; once installed, pre-commit will run every time you commit.

Alternatively, if you'd rather not install any hooks, you can simply use make test as usual, which will also run the hooks.

Almost all build failures of ocfweb can be tied to something pre-commit probably would have caught.

Installing packages

To install a package to the production environment, add it to requirements-minimal.txt, then run make upgrade-requirements. Similarly, to install to the development environment, add to requirements-dev-minimal.txt and run make upgrade-requirements. Use as loose a version requirement as possible, e.g. try django or django>=1.10,<1.10.999 before django==1.10.0.

[0]: In order to run ocfweb on your staffvm without running into problems, you will have to add the ocf_ocfweb::dev_config class to your Hiera node config. Specifically, add:

    - ocf_ocfweb::dev_config

It's probably easier to just run everything on supernova.