Skip to content

Commit

Permalink
urlshortener // add service host secret
Browse files Browse the repository at this point in the history
  • Loading branch information
seriousdev-gh committed Aug 26, 2024
1 parent 5329a7f commit 9073fc6
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ jobs:
- name: dev setup
run: docker compose run --build --rm app server db_setup dev
- name: dev up
env:
SERVICE_HOST: ${{ secrets.SERVICE_HOST }}
run: docker compose up -d
2 changes: 2 additions & 0 deletions urlshortener/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ services:
target: final
ports:
- 5000:5000
environment:
- HOST=${SERVICE_HOST}
command: server serve dev
depends_on:
db:
Expand Down
4 changes: 2 additions & 2 deletions urlshortener/docker/dev_setup.ps1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$exe = "docker compose"
&$exe run --build --rm app server db_setup dev
$exe = "docker"
&$exe compose run --build --rm app server db_setup dev
2 changes: 1 addition & 1 deletion urlshortener/docker/dev_up
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

docker compose up
SERVICE_HOST='http://localhost' docker compose up
6 changes: 4 additions & 2 deletions urlshortener/docker/dev_up.ps1
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
$exe = "docker compose"
&$exe up
$env:SERVICE_HOST = 'http://localhost'
$exe = "docker"
&$exe compose up
Remove-Item Env:\SERVICE_HOST
4 changes: 2 additions & 2 deletions urlshortener/docker/test_run.ps1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$exe = "docker compose"
&$exe run --build --rm test tests
$exe = "docker"
&$exe compose run --build --rm test tests
4 changes: 2 additions & 2 deletions urlshortener/docker/test_setup.ps1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$exe = "docker compose"
&$exe run --build --rm app server db_setup test
$exe = "docker"
&$exe compose run --build --rm app server db_setup test
2 changes: 1 addition & 1 deletion urlshortener/env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ DATABASE_HOST=mysql://root:root@db:3306
# TODO: how to set database envs separately?
DATABASE_URL=${DATABASE_HOST}/${DATABASE_NAME}
RUST_LOG=debug
HOST=http://localhost
# HOST=http://localhost
PORT=5000

0 comments on commit 9073fc6

Please sign in to comment.