canvas-lms/docker-compose.new-jenkins....

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
327 B
YAML
Raw Normal View History

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-16 02:52:10 +08:00
# it is intended that this be used exclusive of all other docker-compose.*yml files in CI
version: "2.3"
services:
canvas:
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-16 02:52:10 +08:00
environment:
DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/canvas_test
init: true
redis:
image: starlord.inscloudgate.net/jenkins/redis:alpine
init: true