Skip to content

Commit

Permalink
dev: more work
Browse files Browse the repository at this point in the history
  • Loading branch information
da2ce7 committed Aug 25, 2023
1 parent 0252d8f commit 16bf5a0
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 48 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,9 @@ jobs:

steps:
- id: checkout_index
name: Checkout Repository (Index)
name: Checkout Repository (index)
uses: actions/checkout@v3

- id: checkout_tracker
name: Checkout Repository (Tracker)
uses: actions/checkout@v3
with:
repository: torrust/torrust-tracker
path: tracker

- id: setup
name: Setup Toolchain
uses: docker/setup-buildx-action@v2
Expand All @@ -65,7 +58,7 @@ jobs:
name: Build (tracker)
uses: docker/build-push-action@v4
with:
context: tracker
context: https://github.com/torrust/torrust-tracker.git#pull/363/head
push: false
load: true
target: debug
Expand All @@ -89,8 +82,8 @@ jobs:
name: Run Applications

run: |
export TORRUST_INDEX_CONFIG=$(cat index/config-index.mysql.local.toml)
export TORRUST_TRACKER_CONFIG=$(cat index/config-tracker.local.toml)
export TORRUST_INDEX_CONFIG=$(cat config-index.mysql.local.toml)
export TORRUST_TRACKER_CONFIG=$(cat config-tracker.local.toml)
docker compose up --detach
Expand Down
5 changes: 2 additions & 3 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ services:
environment:
- TORRUST_INDEX_CONFIG=${TORRUST_INDEX_CONFIG}
- TORRUST_INDEX_CORS_PERMISSIVE=true
- CARGO_HOME=/home/appuser/.cargo
networks:
- server_side
ports:
- 3001:3001
volumes:
- ./lib/torrust:/var/lib/torrust
- ./storage:/var/lib/torrust/index
depends_on:
- tracker
- mailcatcher
Expand All @@ -33,7 +32,7 @@ services:
- 6969:6969/udp
- 1212:1212/tcp
volumes:
- ./lib/torrust:/var/lib/torrust
- ./storage:/var/lib/torrust/tracker
depends_on:
- mysql

Expand Down
2 changes: 1 addition & 1 deletion config-index.sqlite.local.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ max_password_length = 64
secret_key = "MaxVerstappenWC2021"

[database]
connect_url = "sqlite:///var/lib/torrust/database/torrust_index_backend_e2e_testing.db?mode=rwc"
connect_url = "sqlite:///var/lib/torrust/index/database/torrust_index_backend_e2e_testing.db?mode=rwc"

[mail]
email_verification_enabled = false
Expand Down
2 changes: 1 addition & 1 deletion config-tracker.local.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
log_level = "info"
mode = "public"
db_driver = "Sqlite3"
db_path = "/var/lib/torrust/database/torrust_tracker_e2e_testing.db"
db_path = "/var/lib/torrust/tracker/database/torrust_tracker_e2e_testing.db"
announce_interval = 120
min_announce_interval = 120
max_peer_timeout = 900
Expand Down
13 changes: 2 additions & 11 deletions docker/bin/build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
#!/bin/bash

TORRUST_INDEX_USER_UID=${TORRUST_INDEX_USER_UID:-1000}
TORRUST_IDX_BACK_RUN_AS_USER=${TORRUST_IDX_BACK_RUN_AS_USER:-appuser}

echo "Building docker image ..."
echo "TORRUST_INDEX_USER_UID: $TORRUST_INDEX_USER_UID"
echo "TORRUST_IDX_BACK_RUN_AS_USER: $TORRUST_IDX_BACK_RUN_AS_USER"

docker build \
--build-arg UID="$TORRUST_INDEX_USER_UID" \
--build-arg RUN_AS_USER="$TORRUST_IDX_BACK_RUN_AS_USER" \
--target debug --tag torrust-index-backend:debug .
docker build --target debug --tag torrust-index-backend:debug .
docker build --target debug --tag torrust-tracker:debug https://github.com/torrust/torrust-tracker.git#pull/363/head
17 changes: 8 additions & 9 deletions docker/bin/e2e/mysql/e2e-env-up.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/bin/bash

USER_UID=${USER_UID:-1000} \
docker compose build

USER_UID=${USER_UID:-1000} \
TORRUST_INDEX_CONFIG=$(cat config-index.mysql.local.toml) \
TORRUST_INDEX_MYSQL_DATABASE="torrust_index_backend_e2e_testing" \
TORRUST_TRACKER_CONFIG=$(cat config-tracker.local.toml) \
TORRUST_TRACKER_API_TOKEN=${TORRUST_TRACKER_API_TOKEN:-MyAccessToken} \
docker compose up -d
docker compose build


TORRUST_INDEX_CONFIG=$(cat config-index.mysql.local.toml) \
TORRUST_INDEX_MYSQL_DATABASE="torrust_index_backend_e2e_testing" \
TORRUST_TRACKER_CONFIG=$(cat config-tracker.local.toml) \
TORRUST_TRACKER_API_TOKEN=${TORRUST_TRACKER_API_TOKEN:-MyAccessToken} \
docker compose up -d

16 changes: 8 additions & 8 deletions docker/bin/e2e/sqlite/e2e-env-up.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

USER_UID=${USER_UID:-1000} \
docker compose build

USER_UID=${USER_UID:-1000} \
TORRUST_INDEX_CONFIG=$(cat config-index.sqlite.local.toml) \
TORRUST_TRACKER_CONFIG=$(cat config-tracker.local.toml) \
TORRUST_TRACKER_API_TOKEN=${TORRUST_TRACKER_API_TOKEN:-MyAccessToken} \
docker compose up -d

docker compose build


TORRUST_INDEX_CONFIG=$(cat config-index.sqlite.local.toml) \
TORRUST_TRACKER_CONFIG=$(cat config-tracker.local.toml) \
TORRUST_TRACKER_API_TOKEN=${TORRUST_TRACKER_API_TOKEN:-MyAccessToken} \
docker compose up -d
7 changes: 3 additions & 4 deletions docker/bin/run.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/bin/bash

TORRUST_INDEX_USER_UID=${TORRUST_INDEX_USER_UID:-1000}
TORRUST_INDEX_CONFIG=$(cat config.toml)

docker run -it \
--user="$TORRUST_INDEX_USER_UID" \
--publish 3001:3001/tcp \
--env TORRUST_INDEX_CONFIG="$TORRUST_INDEX_CONFIG" \
--volume "$(pwd)/lib/torrust":"/var/lib/torrust" \
torrust-index-backend
--volume "$(pwd)/source":"/var/lib/torrust" \
--entrypoint "torrust-index-backend" \
torrust-index-backend:debug

0 comments on commit 16bf5a0

Please sign in to comment.