diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 655da095d..845b247f8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,9 +8,8 @@ "runServices": [ "dev", "database-root", - "database-tenant" "database-tenant", - "phpmyadmin" // uncomment if adminer should run to see the database + "phpmyadmin" ], "workspaceFolder": "/workspace", "postCreateCommand": "/bin/bash .devcontainer/wait-for-database.sh -d db-root/test -d db-tenant/dev_zhaw -d db-tenant/test_econ .devcontainer/postCreate.sh", diff --git a/.env.sample b/.env.sample index 8399dac1e..30a842f21 100644 --- a/.env.sample +++ b/.env.sample @@ -1,8 +1,23 @@ # all these settings are configured for the DevContainer by default. Use this example file to override the defaults. -ECON_PACKAGE_REGISTRY_READ_TOKEN=1234 -DATABASE_URL_TENANT_TEST=mariadb://root:@database-tenant:3306/test_econ +SIHL_ENV=development +VERSION=dev +PUBLIC_URL=http://localhost:3000 + +ECON_PACKAGE_REGISTRY_READ_TOKEN= + +DATABASE_URL=mariadb://root@0.0.0.0:3316/development +DATABASE_URL_TENANT_ONE=mariadb://root@0.0.0.0:3317/test_econ +DATABASE_URL_TENANT_TWO=mariadb://root@0.0.0.0:3317/test_zhaw + +DATABASE_SKIP_DEFAULT_POOL_CREATION=true +DATABASE_CHOOSE_POOL=root +OPAMSOLVERTIMEOUT=180 +EMAIL_RATE_LIMIT=100 +MATCHER_MAX_CAPACITY=80 +MATCHER_RUN=false # Mail intercept +SMTP_SENDER=test@econ.uzh.ch TEST_EMAIL=test@econ.uzh.ch # Matcher service diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed817100b..2ce1545a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,13 +45,13 @@ jobs: uses: addnab/docker-run-action@v3 env: DATABASE_URL: mariadb://root:${{ env.MYSQL_ROOT_PASSWORD }}@database-root:3306/${{ env.MYSQL_DATABASE }} - DATABASE_URL_TENANT_TEST: mariadb://root:${{ env.MYSQL_ROOT_PASSWORD }}@database-tenant:3306/${{ env.MYSQL_DATABASE }} + DATABASE_URL_TENANT_ONE: mariadb://root:${{ env.MYSQL_ROOT_PASSWORD }}@database-tenant:3306/${{ env.MYSQL_DATABASE }} SIHL_ENV: test SMTP_SENDER: test@econ.uzh.ch TEST_EMAIL: test@econ.uzh.ch with: image: ocaml/opam:debian-10-ocaml-4.14 - options: -v ${{ github.workspace }}:/app -w /app -e DATABASE_URL -e DATABASE_URL_TENANT_TEST -e TEST_EMAIL -e SMTP_SENDER -e SIHL_ENV -e EMAIL_RATE_LIMIT -e MATCHER_MAX_CAPACITY + options: -v ${{ github.workspace }}:/app -w /app -e DATABASE_URL -e DATABASE_URL_TENANT_ONE -e TEST_EMAIL -e SMTP_SENDER -e SIHL_ENV -e EMAIL_RATE_LIMIT -e MATCHER_MAX_CAPACITY run: | # Reclaim required directory permissions sudo chown -R opam . diff --git a/pool/database/seed/seed_tenant.ml b/pool/database/seed/seed_tenant.ml index 6581d0e5c..4ed495927 100644 --- a/pool/database/seed/seed_tenant.ml +++ b/pool/database/seed/seed_tenant.ml @@ -29,8 +29,8 @@ let create () = if Sihl.Configuration.is_test () then ( let database_url = - Sihl.Configuration.read_string "DATABASE_URL_TENANT_TEST" - |> CCOption.get_exn_or "DATABASE_URL_TENANT_TEST undefined" + Sihl.Configuration.read_string "DATABASE_URL_TENANT_ONE" + |> CCOption.get_exn_or "DATABASE_URL_TENANT_ONE undefined" in [ ( "Econ test" , "description" @@ -46,7 +46,7 @@ let create () = [ ( "Econ UZH" , "description" , "localhost:3017" - , Sihl.Configuration.read_string "DATABASE_URL_TENANT_TEST" + , Sihl.Configuration.read_string "DATABASE_URL_TENANT_ONE" |> Option.value ~default:"mariadb://root@database-tenant:3306/dev_econ" , "econ-uzh" @@ -57,7 +57,7 @@ let create () = ; ( "ZHAW" , "description" , "pool.zhaw.ch" - , Sihl.Configuration.read_string "DATABASE_URL_TENANT_TEST_ZHAW" + , Sihl.Configuration.read_string "DATABASE_URL_TENANT_TWO" |> Option.value ~default:"mariadb://root@database-tenant:3306/dev_zhaw" , "zhaw" diff --git a/pool/test/database_test.ml b/pool/test/database_test.ml index 29edf7f9e..cd22b791e 100644 --- a/pool/test/database_test.ml +++ b/pool/test/database_test.ml @@ -11,8 +11,8 @@ module Data = struct let database = let url = - Sihl.Configuration.read_string "DATABASE_URL_TENANT_TEST" - |> CCOption.get_exn_or "DATABASE_URL_TENANT_TEST undefined" + Sihl.Configuration.read_string "DATABASE_URL_TENANT_ONE" + |> CCOption.get_exn_or "DATABASE_URL_TENANT_ONE undefined" |> Url.create |> get_exn in diff --git a/pool/test/tenant_test.ml b/pool/test/tenant_test.ml index bccc2ecf6..9d45ce24b 100644 --- a/pool/test/tenant_test.ml +++ b/pool/test/tenant_test.ml @@ -22,8 +22,8 @@ module Data = struct let url = "pool.econ.uzh.ch" let database_url = - Sihl.Configuration.read_string "DATABASE_URL_TENANT_TEST" - |> CCOption.get_exn_or "DATABASE_URL_TENANT_TEST undefined" + Sihl.Configuration.read_string "DATABASE_URL_TENANT_ONE" + |> CCOption.get_exn_or "DATABASE_URL_TENANT_ONE undefined" ;; let database_label = "econ-test"