Update procedure for correct runner file location and name
This commit is contained in:
parent
2625d34f65
commit
5c667a10f5
1 changed files with 10 additions and 11 deletions
|
@ -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
|
# Switch to DEPLOY_USER to register the runner
|
||||||
sudo su - DEPLOY_USER
|
sudo su - DEPLOY_USER
|
||||||
|
|
||||||
|
cd ~
|
||||||
|
|
||||||
# Register the runner with your Forgejo instance
|
# Register the runner with your Forgejo instance
|
||||||
forgejo-runner register \
|
forgejo-runner register \
|
||||||
--instance https://your-forgejo-instance \
|
--instance https://your-forgejo-instance \
|
||||||
|
@ -995,12 +997,9 @@ forgejo-runner register \
|
||||||
--name "ci-cd-runner" \
|
--name "ci-cd-runner" \
|
||||||
--labels "ubuntu-latest,docker" \
|
--labels "ubuntu-latest,docker" \
|
||||||
--no-interactive
|
--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.
|
**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
|
```bash
|
||||||
# Copy the runner configuration to system location
|
# 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
|
# Set proper ownership and permissions
|
||||||
sudo chown SERVICE_USER:SERVICE_USER /etc/forgejo-runner/config.yml
|
sudo chown SERVICE_USER:SERVICE_USER /etc/forgejo-runner/.runner
|
||||||
sudo chmod 600 /etc/forgejo-runner/config.yml
|
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.
|
**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**:
|
**What this does**:
|
||||||
- Creates the required `.runner` configuration file in the DEPLOY_USER's home directory
|
- 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
|
- Sets proper ownership and permissions for SERVICE_USER to access the config
|
||||||
- Registers the runner with your Forgejo instance
|
- Registers the runner with your Forgejo instance
|
||||||
- Sets up the runner with appropriate labels for Ubuntu and Docker environments
|
- Sets up the runner with appropriate labels for Ubuntu and Docker environments
|
||||||
|
@ -1045,8 +1044,8 @@ After=network.target
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=SERVICE_USER
|
User=SERVICE_USER
|
||||||
WorkingDirectory=/home/SERVICE_USER
|
WorkingDirectory=/etc/forgejo-runner
|
||||||
ExecStart=/usr/bin/forgejo-runner daemon --config /etc/forgejo-runner/config.yml
|
ExecStart=/usr/bin/forgejo-runner daemon
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
|
|
||||||
|
@ -1061,7 +1060,7 @@ sudo systemctl enable forgejo-runner.service
|
||||||
|
|
||||||
**What this does**:
|
**What this does**:
|
||||||
- Creates the systemd service configuration for the Forgejo runner
|
- 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
|
- Enables the service to start automatically on boot
|
||||||
- Sets up proper restart behavior for reliability
|
- Sets up proper restart behavior for reliability
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue