Commit Graph

2 Commits

Author SHA1 Message Date
Derek Bender 11c01f4b66 Configure databases in a unified manner
This patchset removes the much duplicated database.yml and instead
defaults to a DATABASE_URL scheme. There is however still present a
docker-compose/config/new-jenkins/database.yml file to temporarily allow
our internal portal service to still function until such time we can
reconfigure it.

To set up custom connection options all that is needed is setting
DATABASE_URL. See examples of this in docker-compose.yml and
docker-compose.new-jenkins.yml.

Test Plan
=========

Image:
- pulling canvas-lms:master image boots without database errors

Repo:
- given default dev environment where
  COMPOSE_FILE=docker-compose.yml:docker-compose.override.yml

- build the web and postgres images: docker-compose build web postgres
  (feel free to comment out `yarn install` and `compile_assets` in the
  Dockerfile since we won't be needing them for this test and this
  speeds things up)

- set a custom DATABASE_URL to change the database name and echo it to
  see it gets into the image correctly:

    $ docker run -it -e \
      DATABASE_URL=postgres://postgres:sekret@postgres/canvas_custom_env \
      $(docker-compose ps -q web) bash -c "echo \$DATABASE_URL"
    => postgres://postgres:sekret@postgres/canvas_custom_env

    $ docker-compose run --rm -e \
    DATABASE_URL=postgres://postgres:sekret@postgres/canvas_custom_env \
    web bash -c "echo \$DATABASE_URL"
    => postgres://postgres:sekret@postgres/canvas_custom_env

- Test that setting a custom database name via DATABASE_URL can create
  the database

    $ docker-compose run --rm -e \
    DATABASE_URL=postgres://postgres:sekret@postgres/canvas_custom_env \
    web bash -c "bin/rails db:create"
    => Created database 'canvas_custom_env'

- This patchset boots on portal

Change-Id: Ic6f3819550df94b6c98b17ef05ac2029a578cfe4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234213
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
QA-Review: Rex Fleischer <rfleischer@instructure.com>
QA-Review: Jacob Powell <spowell@instructure.com>
Product-Review: Rex Fleischer <rfleischer@instructure.com>
2020-04-28 22:42:21 +00:00
Clay Diffrient 41a0220079 Rename linters-and-js build to frontend
Change-Id: If43ab8c5b9fd291ae06bc1975f443cb6c3e0140e
Reviewed-on: https://gerrit.instructure.com/207991
Tested-by: Jenkins
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-09-05 20:15:10 +00:00