Skip to content
Modern publishing for mozilla.org
Branch: master
Clone or download
jpetto Merge pull request #100 from mozilla/k8s-hostname-middleware
Switch away from DEIS_* settings in HostnameMiddleware for #98
Latest commit 4270c5c May 24, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Move to CircleCI 2 for PR testing Nov 8, 2017
bin Use DOCKER_IMAGE_TAG instead of DEPLOYMENT_DOCKER_IMAGE May 8, 2019
docker Build and deploy via gitlab May 8, 2019
docs Initial import of new sugardough-based nucleus Feb 26, 2016
jenkins Switch Jenkins notifications from IRC to Slack Jul 26, 2018
nucleus Switch away from DEIS_* settings in HostnameMiddleware for #98 May 23, 2019
root_files Add Mozilla favicon Jul 27, 2016
.coveragerc Initial import of new sugardough-based nucleus Feb 26, 2016
.dockerignore Initial import of new sugardough-based nucleus Feb 26, 2016
.gitignore Upgrade Django to 1.11 Oct 8, 2018
.gitlab-ci.yml Run dev, stage, and prod jobs in aws runner May 23, 2019
.pyup.yml Add pyup.io config Apr 18, 2018
CODE_OF_CONDUCT.md Add Mozilla Code of Conduct file Mar 28, 2019
Dockerfile Upgrade to Django 2.2 and Python 3.7 (#77) Apr 22, 2019
Jenkinsfile Build and deploy via Jenkins Sep 21, 2017
LICENSE
README.md Add Gitlab section to README May 8, 2019
contribute.json Serve static root files via whitenoise Jul 27, 2016
docker-compose.yml Upgrade to Django 2.2 and Python 3.7 (#77) Apr 22, 2019
manage.py Initial import of new sugardough-based nucleus Feb 26, 2016
newrelic.ini Initial import of new sugardough-based nucleus Feb 26, 2016
requirements.txt Update psycopg2-binary from 2.7.7 to 2.8.2 May 16, 2019
setup.cfg Initial import of new sugardough-based nucleus Feb 26, 2016
setup.py Minor change to kick off deployment Sep 22, 2017

README.md

nucleus

Build Status

Coverage status

Run the tests

There's a sample test in nucleus/base/tests.py for your convenience, that you can run using the following command:

python manage.py test

If you want to run the full suite, with flake8 and coverage, you may use tox. This will run the tests the same way they are run by travis):

pip install tox
tox

The .travis.yml file will also run coveralls by default.

If you want to benefit from Travis and Coveralls, you will need to activate both of them in your project.

Oh, and you might want to change the "Build Status" and "Coverage Status" links at the top of this file to point to your own travis and coveralls accounts.

Docker for development

  1. Make sure you have docker and docker-compose
  2. docker-compose up

Docker for deploying to production

  1. Add your project in Docker Registry as Automated Build

  2. Prepare a 'env' file with all the variables needed by dev, stage or production.

  3. Run the image:

    docker run --env-file env -p 80:8000 mozilla/nucleus

Heroku

  1. heroku create
  2. heroku config:set DEBUG=False ALLOWED_HOSTS=.herokuapp.com, SECRET_KEY=something_secret DATABASE_URL gets populated by heroku once you setup a database.
  3. git push heroku master

NewRelic Monitoring

A newrelic.ini file is already included. To enable NewRelic monitoring add two enviroment variables:

  • NEW_RELIC_LICENSE_KEY
  • NEW_RELIC_APP_NAME

See the full list of supported environment variables.

Kubernetes

https://github.com/mozmeao/nucleus-config/ has public examples of deployments in k8s clusters in AWS & GCP.

Gitlab CI/CD

We have https://gitlab.com/mozmeao/nucleus/pipelines set up as CI/CD for https://github.com/mozilla/nucleus via this .gitlab-ci.yml, which updates the config repo triggering https://gitlab.com/mozmeao/nucleus/pipelines configured by .gitlab-ci.yml in the config repo.

You can’t perform that action at this time.