From 3f326e1e19cbff67053fd0c2ec3e071d3bb6d4b4 Mon Sep 17 00:00:00 2001 From: Kirill Ivanov <8144358+bragov4ik@users.noreply.github.com> Date: Fri, 5 Apr 2024 13:15:36 +0300 Subject: [PATCH] Config fixes (#820) - fix/remove database env where applicable - fix some variables did not have an effect in templates (in raw blocks) - conditional env variable inclusion in justfile template - fix migrate down just command in template - small newline tweaks --- proxy-verifier/justfile | 2 +- scoutcloud/justfile | 2 +- .../.github/workflows/{{project-name}}.yml | 2 +- service-template/justfile | 19 +++++++++---------- user-ops-indexer/docker-compose.yml | 2 +- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/proxy-verifier/justfile b/proxy-verifier/justfile index b783e264e..0353371e4 100644 --- a/proxy-verifier/justfile +++ b/proxy-verifier/justfile @@ -32,7 +32,7 @@ test-with-db *args: stop-test-postgres: just docker-name="{{docker-name}}-test" stop-postgres run: - PROXY_VERIFIER__DATABASE__URL={{DATABASE_URL}} cargo run --bin proxy-verifier-server + cargo run --bin proxy-verifier-server diff --git a/scoutcloud/justfile b/scoutcloud/justfile index 5fffeddc2..404448003 100644 --- a/scoutcloud/justfile +++ b/scoutcloud/justfile @@ -33,7 +33,7 @@ stop-test-postgres: just docker-name="{{docker-name}}-test" stop-postgres run: - SCOUTCLOUD__DATABASE__URL={{DATABASE_URL}} cargo run --bin scoutcloud-server + SCOUTCLOUD__DATABASE__CONNECT__URL={{DATABASE_URL}} cargo run --bin scoutcloud-server generate-entities: sea-orm-cli generate entity --lib -o scoutcloud-entity/src diff --git a/service-template/.github/workflows/{{project-name}}.yml b/service-template/.github/workflows/{{project-name}}.yml index 738f16be3..e5603e642 100644 --- a/service-template/.github/workflows/{{project-name}}.yml +++ b/service-template/.github/workflows/{{project-name}}.yml @@ -128,7 +128,7 @@ jobs: id: regex with: text: ${{ github.ref }} - regex: '^(refs\/tags\/{{project-name}}\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' + regex: '^(refs\/tags\/{% endraw %}{{project-name}}{% raw %}\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - name: Extract tag name id: tags_extractor diff --git a/service-template/justfile b/service-template/justfile index 96b53ee43..637e6dc2a 100644 --- a/service-template/justfile +++ b/service-template/justfile @@ -31,26 +31,25 @@ test-with-db *args: stop-test-postgres: just docker-name="{{docker-name}}-test" stop-postgres -{% endraw -%} - +{% endraw %} run: - {{crate_name| upcase}}__DATABASE__URL={% raw %}{{DATABASE_URL}}{% endraw %} cargo run --bin {{project-name}}-server - + {% if database -%} + {{crate_name| upcase}}__DATABASE__CONNECT__URL={% raw %}{{DATABASE_URL}}{% endraw %} \ + {% endif -%} + cargo run --bin {{project-name}}-server -{% if entity %} +{% if entity -%} generate-entities: sea-orm-cli generate entity --lib -o {{project-name}}-entity/src {% endif %} -{% if migrations %} -{% raw -%} +{% if migrations -%} new-migration name: - sea-orm-cli migrate generate -d {{project-name}}-migration {{name}} -{% endraw -%} + sea-orm-cli migrate generate -d {{project-name}}-migration {% raw %}{{name}}{% endraw %} migrate-up: sea-orm-cli migrate -d {{project-name}}-migration up migrate-down: - sea-orm-cli migrate {{project-name}}-migration down + sea-orm-cli migrate -d {{project-name}}-migration down {% endif %} diff --git a/user-ops-indexer/docker-compose.yml b/user-ops-indexer/docker-compose.yml index d7c7940ff..e3eb18f33 100644 --- a/user-ops-indexer/docker-compose.yml +++ b/user-ops-indexer/docker-compose.yml @@ -24,7 +24,7 @@ services: environment: ## optional: if provided, would be used as a configuration file USER_OPS_INDEXER__CONFIG: /app/config.toml - USER_OPS_INDEXER__DATABASE__URL: postgres://postgres:@database:5432/blockscout + USER_OPS_INDEXER__DATABASE__CONNECT__URL: postgres://postgres:@database:5432/blockscout USER_OPS_INDEXER__DATABASE__CREATE_DATABASE: true USER_OPS_INDEXER__DATABASE__RUN_MIGRATIONS: true env_file: