Skip to content

Commit

Permalink
Config fixes (#820)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
bragov4ik authored Apr 5, 2024
1 parent 3d7397f commit 3f326e1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion proxy-verifier/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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



2 changes: 1 addition & 1 deletion scoutcloud/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion service-template/.github/workflows/{{project-name}}.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 9 additions & 10 deletions service-template/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

2 changes: 1 addition & 1 deletion user-ops-indexer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3f326e1

Please sign in to comment.