Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit 6ace0bf

Browse files
committed
docs: reorganize docs and add rollbacks section
1 parent 9f19c80 commit 6ace0bf

File tree

5 files changed

+106
-49
lines changed

5 files changed

+106
-49
lines changed

README.md

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,10 @@ Live demo: <https://index.torrust-demo.com/torrents>.
66

77
It's also used to track issues in production.
88

9-
## Setup
9+
## Documentation
1010

11-
Follow instructions on [Deploying Torrust To Production](https://torrust.com/blog/deploying-torrust-to-production).
12-
13-
You need to also enable a [firewall](./docs/firewall.md).
14-
15-
The application is located in the directory: `/home/torrust/github/torrust/torrust-demo`.
16-
17-
To run docker compose commands you need to cd to the app dir:
18-
19-
```console
20-
cd /home/torrust/github/torrust/torrust-demo
21-
```
22-
23-
Sample commands:
24-
25-
- `docker ps`: list containers.
26-
- `docker compose logs -f`: print all containers' logs.
27-
- `docker compose logs -f tracker`: print tracker container' logs.
28-
- `docker compose logs -f tracker | head -n100`: print the first 100 lines in the tracker container log.
29-
- `docker compose logs -f | grep "ERROR"`: print logs showing only errors.
30-
31-
## Deployment
32-
33-
1. SSH into the server.
34-
2. Execute the deployment script: `./bin/deploy-torrust-demo.com.sh`.
35-
3. Execute the smoke tests:
36-
37-
```console
38-
cargo run --bin udp_tracker_client announce 144.126.245.19:6969 9c38422213e30bff212b30c360d26f9a02136422
39-
40-
cargo run --bin http_tracker_client announce 144.126.245.19:6969 9c38422213e30bff212b30c360d26f9a02136422
41-
42-
TORRUST_CHECKER_CONFIG='{
43-
"udp_trackers": ["144.126.245.19:6969"],
44-
"http_trackers": ["https://tracker.torrust-demo.com"],
45-
"health_checks": ["https://tracker.torrust-demo.com/api/health_check"]
46-
}' cargo run --bin tracker_checker
47-
```
48-
49-
4. Check the logs of the tracker container to see if everything is working:
50-
51-
```console
52-
./share/bin/tracker-filtered-logs.sh
53-
```
54-
55-
## TODO
56-
57-
- Create a workflow for deployments.
58-
- Automatic deployment when new docker images are available.
11+
- [Setup](docs/setup.md)
12+
- [Deployment](docs/deployment.md)
13+
- [Firewall](docs/firewall.md)
14+
- [Sample Commands](docs/sample_commands.md)
15+
- [Rollbacks](docs/rollbacks.md)

docs/deployment.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Deployment
2+
3+
1. SSH into the server.
4+
2. Execute the deployment script: `./bin/deploy-torrust-demo.com.sh`.
5+
3. Execute the smoke tests:
6+
7+
```console
8+
cargo run --bin udp_tracker_client announce 144.126.245.19:6969 9c38422213e30bff212b30c360d26f9a02136422
9+
10+
cargo run --bin http_tracker_client announce 144.126.245.19:6969 9c38422213e30bff212b30c360d26f9a02136422
11+
12+
TORRUST_CHECKER_CONFIG='{
13+
"udp_trackers": ["144.126.245.19:6969"],
14+
"http_trackers": ["https://tracker.torrust-demo.com"],
15+
"health_checks": ["https://tracker.torrust-demo.com/api/health_check"]
16+
}' cargo run --bin tracker_checker
17+
```
18+
19+
4. Check the logs of the tracker container to see if everything is working:
20+
21+
```console
22+
./share/bin/tracker-filtered-logs.sh
23+
```

docs/rollbacks.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Rollbacks
2+
3+
If you have a problems after a [deployment](deployment.md), you can rollback to the previous version of the app.
4+
5+
1. SSH into the server.
6+
7+
2. Check the docker images to see the previous version of the app:
8+
9+
```console
10+
docker images torrust/tracker
11+
REPOSITORY TAG IMAGE ID CREATED SIZE
12+
torrust/tracker develop b081a7499542 19 minutes ago 133MB
13+
torrust/tracker <none> 7dbdad453cf3 6 hours ago 133MB
14+
```
15+
16+
3. Tag the previous version of the app with a new name (e.g. `rollback`):
17+
18+
```console
19+
docker tag 7dbdad453cf3 torrust/tracker:rollback
20+
```
21+
22+
This command tags the image with ID `7dbdad453cf3` as `torrust/tracker:rollback`.
23+
24+
```console
25+
docker images torrust/tracker
26+
REPOSITORY TAG IMAGE ID CREATED SIZE
27+
torrust/tracker develop b081a7499542 21 minutes ago 133MB
28+
torrust/tracker rollback 7dbdad453cf3 6 hours ago 133MB
29+
```
30+
31+
The `rollback` tag now points to the previous version of the app.
32+
33+
4. Edit the `compose.yaml` file to use the new tag:
34+
35+
Change the line:
36+
37+
```yaml
38+
image: torrust/tracker:develop
39+
```
40+
41+
to:
42+
43+
```yaml
44+
image: torrust/tracker:rollback
45+
```
46+
47+
5. Run the following command to start the previous version of the app:
48+
49+
```console
50+
docker compose up --build --detach
51+
```
52+
53+
6. Check the logs of the tracker container to see if everything is working:
54+
55+
```console
56+
./share/bin/tracker-filtered-logs.sh
57+
```

docs/sample_commands.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Sample Commands
2+
3+
- `docker ps`: list containers.
4+
- `docker compose logs -f`: print all containers' logs.
5+
- `docker compose logs -f tracker`: print tracker container' logs.
6+
- `docker compose logs -f tracker | head -n100`: print the first 100 lines in the tracker container log.
7+
- `docker compose logs -f | grep "ERROR"`: print logs showing only errors.

docs/setup.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Setup
2+
3+
Follow instructions on [Deploying Torrust To Production](https://torrust.com/blog/deploying-torrust-to-production).
4+
5+
You need to also enable a [firewall](./docs/firewall.md).
6+
7+
The application is located in the directory: `/home/torrust/github/torrust/torrust-demo`.
8+
9+
To run docker compose commands you need to cd to the app dir:
10+
11+
```console
12+
cd /home/torrust/github/torrust/torrust-demo
13+
```

0 commit comments

Comments
 (0)