Deployment

moz-dev-dash is designed with 12-factor app philosophy, so it runs easily on heroku, and deis. You can most easily deploy your changes to your own heroku app with heroku toolbelt.

Deploy your own (on Heroku)

  1. Create a heroku remote. We suggest naming it moz-dev-dash-username:

    heroku apps:create moz-dev-dash-username
    
  2. Set the heroku app to use the “multi” buildpack:

    heroku buildpacks:set https://github.com/ddollar/heroku-buildpack-multi.git
    
  3. Push code to the heroku remote:

    git push heroku master
    
  4. Migrate DB tables on heroku:

    heroku run python manage.py migrate
    
  5. Create a superuser on heroku:

    heroku run python manage.py createsuperuser
    
  6. Open the new heroku app:

    heroku open
    

Deploy your own (on Mozilla Deis)

To deploy the app to the Mozilla Cloud Ops Dev Deis cluster, you will need to request a dev IAM account from Mozilla Cloud Ops.

  1. Install the deis client.

  2. Register/login with the Mozilla Deis controller:

    deis register http://deis.apps.dev.mozaws.net
    deis login
    
  3. Add your public key:

    deis keys:add
    
  4. Create the application:

    deis create
    
  5. Set the deis app to use the “multi” buildpack:

    deis config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-multi
    
  6. Push code to the deis remote:

    git push deis master
    
  7. Create an RDS Postgres instance in us-east-1 with default settings except:

    • DB Instance Class: db.t2.micro
    • Allocated Storag: 5 GB
    • VPC: vpc-9c2b0ef8
  8. In the RDS Instance configuration details, click the “Security Groups”. (Usually something like “rds-launch-wizard-N (sg-abcdef123)”)

  9. In the security group, under the “Inbound” tab, change the source to allow the deis cluster hosts:

    10.21.0.0/16
    
  10. Set the DATABASE_URL environment variable to match the RDS DB:

    deis config:set DATABASE_URL=postgres://username:password@endpoint/dbname
    
  11. Migrate DB tables on the new RDS instance:

    deis run python manage.py migrate
    
  12. Dock to app instance to create a superuser:

    deisctl dock <app-name>
    /app/.heroku/python/bin/python manage.py createsuperuser
    
  13. Open the new deis app:

    deis open
    

Enable Firefox Accounts Auth

To enable Firefox Account sign-ins on your own app, you will need to create your own Firefox Accounts OAuth Client for your app domain.

  1. Go to register your own Firefox Accounts OAuth Client:

    • Client name: moz-dev-dash-username
    • Redirect URI: https://<app-domain>/accounts/fxa/login/callback/
    • Trusted Mozilla Client: CHECKED

    Be sure to copy the client secret - you can’t see it again.

  2. Go to https://<app-domain>/admin/socialaccount/socialapp/add/ to Enable Firefox Accounts Auth like a local machine; this time using your own new Firefox Accounts OAuth Client ID and Secret

  3. Sign in at https://<app-domain>/ with a Firefox Account.