Skip to content

Commit d62ab7a

Browse files
authored
chore: Add config options (#499)
1 parent fe18348 commit d62ab7a

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
lint:
1010
runs-on: ubuntu-20.04 # Remember to update this when changing Erlang version. See https://github.com/erlef/setup-beam
1111
steps:
12-
- uses: actions/checkout@v1
12+
- uses: actions/checkout@v4
1313
- uses: erlef/setup-beam@v1
1414
with:
1515
version-file: .tool-versions
@@ -30,8 +30,8 @@ jobs:
3030
POSTGRES_USER: postgres
3131
POSTGRES_PASSWORD: postgres
3232
steps:
33-
- uses: actions/checkout@v1
34-
- uses: actions/cache@v1
33+
- uses: actions/checkout@v4
34+
- uses: actions/cache@v4
3535
with:
3636
path: deps
3737
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}

.github/workflows/e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ jobs:
3232
path: frontend
3333
# Setup API
3434
- name: Restore Elixir cache
35-
uses: actions/cache@v3
35+
uses: actions/cache@v4
3636
with:
3737
path: ./api/deps
3838
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
3939
restore-keys: |
4040
${{ runner.os }}-mix-${{ env.cache-name }}-
4141
${{ runner.os }}-mix-
4242
- name: Restore Elixir build folder
43-
uses: actions/cache@v1
43+
uses: actions/cache@v4
4444
with:
4545
path: ./api/build
4646
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}

config/releases.exs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ import Config
33
# ---- Helpers ----
44

55
# Try to load `secret_name` from `/run/secrets/secret_name`.
6+
# If it fails, fallback to load it from env variable aliased by `CF_ALIAS_SECRET_NAME`.
67
# If it fails, fallback to load it from env variable `CF_SECRET_NAME`.
78
# If it fails too, fallback on `default`.
89
do_load_secret = fn secret_name ->
910
cond do
1011
File.exists?("/run/secrets/#{secret_name}") ->
1112
File.read!("/run/secrets/#{secret_name}")
1213

14+
System.get_env("CF_ALIAS_#{String.upcase(secret_name)}") && System.get_env(System.get_env("CF_ALIAS_#{String.upcase(secret_name)}")) ->
15+
System.get_env(System.get_env("CF_ALIAS_#{String.upcase(secret_name)}"))
16+
1317
System.get_env("CF_#{String.upcase(secret_name)}") ->
1418
System.get_env("CF_#{String.upcase(secret_name)}")
1519

@@ -65,7 +69,8 @@ config :db, DB.Repo,
6569
hostname: load_secret.("db_hostname"),
6670
username: load_secret.("db_username"),
6771
password: load_secret.("db_password"),
68-
database: load_secret.("db_name")
72+
database: load_secret.("db_name"),
73+
port: load_int.({"db_port", 5432})
6974

7075
config :ex_aws,
7176
access_key_id: [load_secret.("s3_access_key_id"), :instance_role],

0 commit comments

Comments
 (0)