Skip to content

Commit

Permalink
refactor: [#344] rename env vars
Browse files Browse the repository at this point in the history
Repo was renamed from `torrust-index-frontend` to `torrust-index-gui`.

```
TORRUST_IDX_FRON_RUN_AS_USER       -> TORRUST_INDEX_GUI_RUN_AS_USER
TORRUST_IDX_FRON_USER_UID          -> TORRUST_INDEX_GUI_USER_UID
TORRUST_IDX_FRON_API_BASE_URL      -> TORRUST_INDEX_GUI_API_BASE_URL
```

This commit renames anv vars to follow repo renaming. Besides, we are
not using the abbreviation `IDX` for `INDEX` anymore.
  • Loading branch information
josecelano committed Nov 15, 2023
1 parent ac1b7dc commit dd1167e
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- "v*"

env:
TORRUST_IDX_FRON_RUN_AS_USER: appuser
TORRUST_INDEX_GUI_RUN_AS_USER: appuser

jobs:
check-secret:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
context: .
file: ./Dockerfile
build-args: |
RUN_AS_USER=${{ env.TORRUST_IDX_FRON_RUN_AS_USER }}
RUN_AS_USER=${{ env.TORRUST_INDEX_GUI_RUN_AS_USER }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
4 changes: 2 additions & 2 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ services:
context: .
args:
RUN_AS_USER: appuser
UID: ${TORRUST_IDX_FRON_USER_UID:-1001}
UID: ${TORRUST_INDEX_GUI_USER_UID:-1001}
target: development
user: ${TORRUST_IDX_FRON_USER_UID:-1000}:${TORRUST_IDX_FRON_USER_UID:-1000}
user: ${TORRUST_INDEX_GUI_USER_UID:-1000}:${TORRUST_INDEX_GUI_USER_UID:-1000}
tty: true
ports:
- 3000:3000
Expand Down
18 changes: 9 additions & 9 deletions docker/bin/build-dev.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash

TORRUST_IDX_FRON_USER_UID=${TORRUST_IDX_FRON_USER_UID:-1001}
TORRUST_IDX_FRON_RUN_AS_USER=${TORRUST_IDX_FRON_RUN_AS_USER:-appuser}
TORRUST_IDX_FRON_API_BASE_URL=${TORRUST_IDX_FRON_API_BASE_URL:-http://localhost:3001/v1}
TORRUST_INDEX_GUI_USER_UID=${TORRUST_INDEX_GUI_USER_UID:-1001}
TORRUST_INDEX_GUI_RUN_AS_USER=${TORRUST_INDEX_GUI_RUN_AS_USER:-appuser}
TORRUST_INDEX_GUI_API_BASE_URL=${TORRUST_INDEX_GUI_API_BASE_URL:-http://localhost:3001/v1}

echo "Building docker image ..."
echo "TORRUST_IDX_FRON_USER_UID: $TORRUST_IDX_FRON_USER_UID"
echo "TORRUST_IDX_FRON_RUN_AS_USER: $TORRUST_IDX_FRON_RUN_AS_USER"
echo "TORRUST_IDX_FRON_API_BASE_URL: $TORRUST_IDX_FRON_API_BASE_URL"
echo "TORRUST_INDEX_GUI_USER_UID: $TORRUST_INDEX_GUI_USER_UID"
echo "TORRUST_INDEX_GUI_RUN_AS_USER: $TORRUST_INDEX_GUI_RUN_AS_USER"
echo "TORRUST_INDEX_GUI_API_BASE_URL: $TORRUST_INDEX_GUI_API_BASE_URL"

docker build \
--target development \
--build-arg UID="$TORRUST_IDX_FRON_USER_UID" \
--build-arg RUN_AS_USER="$TORRUST_IDX_FRON_RUN_AS_USER" \
--build-arg API_BASE_URL="$TORRUST_IDX_FRON_API_BASE_URL" \
--build-arg UID="$TORRUST_INDEX_GUI_USER_UID" \
--build-arg RUN_AS_USER="$TORRUST_INDEX_GUI_RUN_AS_USER" \
--build-arg API_BASE_URL="$TORRUST_INDEX_GUI_API_BASE_URL" \
-t torrust-index-frontend .
18 changes: 9 additions & 9 deletions docker/bin/build.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/bash

TORRUST_IDX_FRON_USER_UID=${TORRUST_IDX_FRON_USER_UID:-1001}
TORRUST_IDX_FRON_RUN_AS_USER=${TORRUST_IDX_FRON_RUN_AS_USER:-appuser}
TORRUST_IDX_FRON_API_BASE_URL=${TORRUST_IDX_FRON_API_BASE_URL:-http://localhost:3001/v1}
TORRUST_INDEX_GUI_USER_UID=${TORRUST_INDEX_GUI_USER_UID:-1001}
TORRUST_INDEX_GUI_RUN_AS_USER=${TORRUST_INDEX_GUI_RUN_AS_USER:-appuser}
TORRUST_INDEX_GUI_API_BASE_URL=${TORRUST_INDEX_GUI_API_BASE_URL:-http://localhost:3001/v1}

echo "Building docker image ..."
echo "TORRUST_IDX_FRON_USER_UID: $TORRUST_IDX_FRON_USER_UID"
echo "TORRUST_IDX_FRON_RUN_AS_USER: $TORRUST_IDX_FRON_RUN_AS_USER"
echo "TORRUST_IDX_FRON_API_BASE_URL: $TORRUST_IDX_FRON_API_BASE_URL"
echo "TORRUST_INDEX_GUI_USER_UID: $TORRUST_INDEX_GUI_USER_UID"
echo "TORRUST_INDEX_GUI_RUN_AS_USER: $TORRUST_INDEX_GUI_RUN_AS_USER"
echo "TORRUST_INDEX_GUI_API_BASE_URL: $TORRUST_INDEX_GUI_API_BASE_URL"

docker build \
--build-arg UID="$TORRUST_IDX_FRON_USER_UID" \
--build-arg RUN_AS_USER="$TORRUST_IDX_FRON_RUN_AS_USER" \
--build-arg API_BASE_URL="$TORRUST_IDX_FRON_API_BASE_URL" \
--build-arg UID="$TORRUST_INDEX_GUI_USER_UID" \
--build-arg RUN_AS_USER="$TORRUST_INDEX_GUI_RUN_AS_USER" \
--build-arg API_BASE_URL="$TORRUST_INDEX_GUI_API_BASE_URL" \
-t torrust-index-frontend .
4 changes: 2 additions & 2 deletions docker/bin/run-dev.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

TORRUST_IDX_FRON_USER_UID=${TORRUST_IDX_FRON_USER_UID:-1000}
TORRUST_INDEX_GUI_USER_UID=${TORRUST_INDEX_GUI_USER_UID:-1000}

docker run -it \
--user="$TORRUST_IDX_FRON_USER_UID" \
--user="$TORRUST_INDEX_GUI_USER_UID" \
--publish 3000:3000/tcp \
--volume "$(pwd)":"/app" \
torrust-index-frontend
4 changes: 2 additions & 2 deletions docker/bin/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ CURRENT_USER_ID=$(id -u)
echo "User name: $CURRENT_USER_NAME"
echo "User id: $CURRENT_USER_ID"

TORRUST_IDX_FRON_USER_UID=$CURRENT_USER_ID
TORRUST_INDEX_GUI_USER_UID=$CURRENT_USER_ID
USER_ID=$CURRENT_USER_ID
TORRUST_TRACKER_USER_UID=$CURRENT_USER_ID
export TORRUST_IDX_FRON_USER_UID
export TORRUST_INDEX_GUI_USER_UID
export USER_ID
export TORRUST_TRACKER_USER_UID

Expand Down
4 changes: 2 additions & 2 deletions docker/bin/run.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

TORRUST_IDX_FRON_USER_UID=${TORRUST_IDX_FRON_USER_UID:-1001}
TORRUST_INDEX_GUI_USER_UID=${TORRUST_INDEX_GUI_USER_UID:-1001}

docker run -it \
--user="$TORRUST_IDX_FRON_USER_UID" \
--user="$TORRUST_INDEX_GUI_USER_UID" \
--publish 3000:3000/tcp \
torrust-index-frontend
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dd1167e

Please sign in to comment.