|
1 | 1 | # Deployment
|
2 | 2 |
|
3 |
| -1. SSH into the server. |
4 |
| -2. Execute the deployment script: `./bin/deploy-torrust-tracker-demo.com.sh`. |
5 |
| -3. Execute the smoke tests: |
6 |
| - |
7 |
| - ```console |
8 |
| - # Clone Torrust Tracker |
9 |
| - [email protected]:torrust/torrust-tracker.git |
10 |
| - cd torrust-tracker |
| 3 | +This document outlines the deployment process for the Torrust Tracker demo application. |
| 4 | + |
| 5 | +## 1. Prerequisites |
| 6 | + |
| 7 | +- Ensure you have SSH access to the production server. |
| 8 | +- The server should be provisioned and configured according to the |
| 9 | + [Production Setup Guide](./production-setup.md). |
| 10 | + |
| 11 | +## 2. Deployment Steps |
| 12 | + |
| 13 | +1. **SSH into the server**. |
| 14 | + |
| 15 | +2. **Navigate to the application directory**: |
| 16 | + |
| 17 | + ```bash |
| 18 | + cd /home/torrust/github/torrust/torrust-tracker-demo |
11 | 19 | ```
|
12 | 20 |
|
13 |
| - Execute the following commands to run the tracker client and checker. |
| 21 | +3. **Pull the latest changes** from the repository: |
| 22 | + |
| 23 | + ```bash |
| 24 | + git pull |
| 25 | + ``` |
| 26 | + |
| 27 | +4. **Run the deployment script**: |
| 28 | + |
| 29 | + ```bash |
| 30 | + ./share/bin/deploy-torrust-tracker-demo.com.sh |
| 31 | + ``` |
| 32 | + |
| 33 | + This script handles: |
| 34 | + |
| 35 | + - Stopping services |
| 36 | + - Rebuilding containers |
| 37 | + - Starting services |
| 38 | + |
| 39 | +## 3. Verification and Smoke Testing |
| 40 | + |
| 41 | +After deployment, verify that all services are running correctly. |
14 | 42 |
|
15 |
| - Simulate a torrent announce to the tracker using UDP: |
| 43 | +### Service Status |
16 | 44 |
|
17 |
| - ```console |
| 45 | +Check the status of all Docker containers: |
| 46 | + |
| 47 | +```bash |
| 48 | +docker compose ps |
| 49 | +``` |
| 50 | + |
| 51 | +### Application Logs |
| 52 | + |
| 53 | +Check the logs for the tracker container to ensure it started without errors: |
| 54 | + |
| 55 | +```bash |
| 56 | +./share/bin/tracker-filtered-logs.sh |
| 57 | +``` |
| 58 | + |
| 59 | +### Smoke Tests |
| 60 | + |
| 61 | +Execute the following smoke tests from a machine with the `torrust-tracker` repository cloned. |
| 62 | + |
| 63 | +1. **UDP Announce**: |
| 64 | + |
| 65 | + ```bash |
18 | 66 | cargo run -p torrust-tracker-client --bin udp_tracker_client announce \
|
19 | 67 | udp://tracker.torrust-demo.com:6969/announce \
|
20 | 68 | 9c38422213e30bff212b30c360d26f9a02136422 | jq
|
21 | 69 | ```
|
22 | 70 |
|
23 |
| - Simulate a torrent scrape to the tracker using HTTP: |
| 71 | +2. **HTTP Announce**: |
24 | 72 |
|
25 |
| - ```console |
| 73 | + ```bash |
26 | 74 | cargo run -p torrust-tracker-client --bin http_tracker_client announce \
|
27 |
| - https://tracker.torrust-demo.com \ |
| 75 | + https://tracker.torrust-demo.com/announce \ |
28 | 76 | 9c38422213e30bff212b30c360d26f9a02136422 | jq
|
29 | 77 | ```
|
30 | 78 |
|
31 |
| - Make a request to the health check endpoint: |
| 79 | +3. **Health Check Endpoint**: |
32 | 80 |
|
33 |
| - ```console |
| 81 | + ```bash |
| 82 | + curl https://tracker.torrust-demo.com/api/health_check |
| 83 | + ``` |
| 84 | + |
| 85 | +4. **Run the comprehensive tracker checker**: |
| 86 | + |
| 87 | + ```bash |
34 | 88 | TORRUST_CHECKER_CONFIG='{
|
35 | 89 | "udp_trackers": ["udp://tracker.torrust-demo.com:6969/announce"],
|
36 |
| - "http_trackers": ["https://tracker.torrust-demo.com"], |
| 90 | + "http_trackers": ["https://tracker.torrust-demo.com/announce"], |
37 | 91 | "health_checks": ["https://tracker.torrust-demo.com/api/health_check"]
|
38 | 92 | }' cargo run -p torrust-tracker-client --bin tracker_checker
|
39 |
| - |
40 |
| - ``` |
41 |
| - |
42 |
| -4. Check the logs of the tracker container to see if everything is working: |
43 |
| - |
44 |
| - ```console |
45 |
| - ./share/bin/tracker-filtered-logs.sh |
46 | 93 | ```
|
0 commit comments