Update procedure for correct runner file location and name
Some checks failed
CI/CD Pipeline / Test Backend (push) Failing after 16s
CI/CD Pipeline / Test Frontend (push) Failing after 51s
CI/CD Pipeline / Build and Push Docker Images (push) Has been skipped
CI/CD Pipeline / Deploy to Production (push) Has been skipped

This commit is contained in:
continuist 2025-06-29 17:22:46 -04:00
parent 2625d34f65
commit 5c667a10f5

View file

@ -988,6 +988,8 @@ To add an existing user as an Administrator of an existing repository in Forgejo
# Switch to DEPLOY_USER to register the runner
sudo su - DEPLOY_USER
cd ~
# Register the runner with your Forgejo instance
forgejo-runner register \
--instance https://your-forgejo-instance \
@ -995,12 +997,9 @@ forgejo-runner register \
--name "ci-cd-runner" \
--labels "ubuntu-latest,docker" \
--no-interactive
# Exit DEPLOY_USER shell
exit
```
**Important**: Replace `your-forgejo-instance` with your actual Forgejo instance URL and `YOUR_REGISTRATION_TOKEN` with the token you copied from Step 2.
**Important**: Replace `your-forgejo-instance` with your actual Forgejo instance URL and `YOUR_REGISTRATION_TOKEN` with the token you copied from Step 2. Also make sure it ends in a `/`.
**Note**: The `your-forgejo-instance` should be the **base URL** of your Forgejo instance (e.g., `https://git.<your-domain>/`), not the full path to the repository. The runner registration process will handle connecting to the specific repository based on the token you provide.
@ -1013,11 +1012,11 @@ exit
```bash
# Copy the runner configuration to system location
sudo cp /home/DEPLOY_USER/.runner /etc/forgejo-runner/config.yml
sudo cp /home/DEPLOY_USER/.runner /etc/forgejo-runner/.runner
# Set proper ownership and permissions
sudo chown SERVICE_USER:SERVICE_USER /etc/forgejo-runner/config.yml
sudo chmod 600 /etc/forgejo-runner/config.yml
sudo chown SERVICE_USER:SERVICE_USER /etc/forgejo-runner/.runner
sudo chmod 600 /etc/forgejo-runner/.runner
```
**Important**: Replace `your-forgejo-instance` with your actual Forgejo instance URL and `YOUR_REGISTRATION_TOKEN` with the token you copied from Step 2.
@ -1026,7 +1025,7 @@ sudo chmod 600 /etc/forgejo-runner/config.yml
**What this does**:
- Creates the required `.runner` configuration file in the DEPLOY_USER's home directory
- Copies the configuration to the system location (`/etc/forgejo-runner/config.yml`)
- Copies the configuration to the system location (`/etc/forgejo-runner/.runner`)
- Sets proper ownership and permissions for SERVICE_USER to access the config
- Registers the runner with your Forgejo instance
- Sets up the runner with appropriate labels for Ubuntu and Docker environments
@ -1045,8 +1044,8 @@ After=network.target
[Service]
Type=simple
User=SERVICE_USER
WorkingDirectory=/home/SERVICE_USER
ExecStart=/usr/bin/forgejo-runner daemon --config /etc/forgejo-runner/config.yml
WorkingDirectory=/etc/forgejo-runner
ExecStart=/usr/bin/forgejo-runner daemon
Restart=always
RestartSec=10
@ -1061,7 +1060,7 @@ sudo systemctl enable forgejo-runner.service
**What this does**:
- Creates the systemd service configuration for the Forgejo runner
- Points the service to use the configuration file we just set up
- Sets the working directory to `/etc/forgejo-runner` where the `.runner` file is located
- Enables the service to start automatically on boot
- Sets up proper restart behavior for reliability