Coder Social home page Coder Social logo

zeyadal / ocfweb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ocf/ocfweb

0.0 0.0 0.0 3.71 MB

The main ocf website

Home Page: https://www.ocf.berkeley.edu

License: Other

Shell 0.11% Dockerfile 0.43% Makefile 0.49% Python 45.27% HTML 46.18% CSS 5.65% JavaScript 1.86%

ocfweb's Introduction

ocfweb

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 [email protected]:ocf/ocfweb.git
$ 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:

classes:
    - ocf_ocfweb::dev_config

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

ocfweb's People

Contributors

chriskuehl avatar kpengboy avatar jvperrin avatar abizer avatar matthew-mcallister avatar kennydo avatar tahabi avatar tliu22 avatar naderm avatar daradib avatar fawaf avatar baisang avatar asaiacai avatar nickimpicciche avatar bzh-bzh avatar mcint avatar shex1627 avatar wporr avatar sahilhasan avatar edricx avatar chrisdliu avatar kevinmasd avatar ethanhs avatar n-patel avatar tmochida avatar dkess avatar harrisonkuo avatar noloerino avatar seanlobo avatar wilswu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.