Fix labeling of runners
Some checks are pending
CI/CD Pipeline (Fully Isolated DinD) / Run Tests (DinD) (push) Waiting to run
CI/CD Pipeline (Fully Isolated DinD) / Build and Push Docker Images (DinD) (push) Blocked by required conditions
CI/CD Pipeline (Fully Isolated DinD) / Deploy to Production (push) Blocked by required conditions

This commit is contained in:
continuist 2025-06-30 00:07:03 -04:00
parent 080bb12630
commit ce89117aa6
2 changed files with 14 additions and 14 deletions

View file

@ -14,7 +14,7 @@ jobs:
# Job 1: Testing - Uses DinD with multiple containers for comprehensive testing # Job 1: Testing - Uses DinD with multiple containers for comprehensive testing
test: test:
name: Run Tests (DinD) name: Run Tests (DinD)
runs-on: [self-hosted, dind] runs-on: [self-hosted, ci]
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
steps: steps:
@ -84,7 +84,7 @@ jobs:
build-and-push: build-and-push:
name: Build and Push Docker Images (DinD) name: Build and Push Docker Images (DinD)
needs: [test] needs: [test]
runs-on: [self-hosted, dind] runs-on: [self-hosted, ci]
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
steps: steps:
@ -151,7 +151,7 @@ jobs:
deploy: deploy:
name: Deploy to Production name: Deploy to Production
needs: build-and-push needs: build-and-push
runs-on: [self-hosted, production] runs-on: [self-hosted, prod]
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
steps: steps:

View file

@ -1017,8 +1017,8 @@ cd ~
forgejo-runner register \ forgejo-runner register \
--instance https://your-forgejo-instance \ --instance https://your-forgejo-instance \
--token YOUR_REGISTRATION_TOKEN \ --token YOUR_REGISTRATION_TOKEN \
--name "ci-cd-dind-runner" \ --name "ci-runner" \
--labels "ubuntu-latest,docker,dind" \ --labels "ci" \
--no-interactive --no-interactive
``` ```
@ -1115,12 +1115,12 @@ sudo journalctl -u forgejo-runner.service -f --no-pager
# Verify runner appears in Forgejo # Verify runner appears in Forgejo
# Go to your Forgejo repository → Settings → Actions → Runners # Go to your Forgejo repository → Settings → Actions → Runners
# You should see your runner listed as "ci-cd-dind-runner" with status "Online" # You should see your runner listed as "ci-runner" with status "Online"
``` ```
**Expected Output**: **Expected Output**:
- `systemctl status` should show "active (running)" - `systemctl status` should show "active (running)"
- Forgejo web interface should show the runner as online - Forgejo web interface should show the runner as online with "ci" label
**If something goes wrong**: **If something goes wrong**:
- Check logs: `sudo journalctl -u forgejo-runner.service -f` - Check logs: `sudo journalctl -u forgejo-runner.service -f`
@ -1649,7 +1649,7 @@ forgejo-runner register \
--instance https://your-forgejo-instance \ --instance https://your-forgejo-instance \
--token YOUR_REGISTRATION_TOKEN \ --token YOUR_REGISTRATION_TOKEN \
--name "production-runner" \ --name "production-runner" \
--labels "production,ubuntu-latest,docker" \ --labels "prod" \
--no-interactive --no-interactive
# Copy configuration to system location # Copy configuration to system location
@ -1707,9 +1707,9 @@ sudo journalctl -u forgejo-runner.service -f --no-pager
**Expected Output**: **Expected Output**:
- `systemctl status` should show "active (running)" - `systemctl status` should show "active (running)"
- Forgejo web interface should show the runner as online with "production" label - Forgejo web interface should show the runner as online with "prod" label
**Important**: The CI/CD workflow (`.forgejo/workflows/ci.yml`) is already configured to use this production runner. The deploy job runs on `runs-on: [self-hosted, production]`, which means it will execute on any runner with the "production" label. When the workflow runs, it will: **Important**: The CI/CD workflow (`.forgejo/workflows/ci.yml`) is already configured to use this production runner. The deploy job runs on `runs-on: [self-hosted, prod]`, which means it will execute on any runner with the "prod" label. When the workflow runs, it will:
1. Pull the latest Docker images from Harbor registry 1. Pull the latest Docker images from Harbor registry
2. Use the `docker-compose.prod.yml` file to deploy the application stack 2. Use the `docker-compose.prod.yml` file to deploy the application stack
@ -1826,8 +1826,8 @@ sudo su - DEPLOY_USER
forgejo-runner register \ forgejo-runner register \
--instance https://your-forgejo-instance \ --instance https://your-forgejo-instance \
--token YOUR_TOKEN \ --token YOUR_TOKEN \
--name "ci-cd-dind-runner" \ --name "ci-runner" \
--labels "ubuntu-latest,docker,dind" \ --labels "ci" \
--no-interactive --no-interactive
``` ```
@ -1849,12 +1849,12 @@ sudo journalctl -u forgejo-runner.service -f --no-pager
# Verify runner appears in Forgejo # Verify runner appears in Forgejo
# Go to your Forgejo repository → Settings → Actions → Runners # Go to your Forgejo repository → Settings → Actions → Runners
# You should see your runner listed as "ci-cd-dind-runner" with status "Online" # You should see your runner listed as "ci-runner" with status "Online"
``` ```
**Expected Output**: **Expected Output**:
- `systemctl status` should show "active (running)" - `systemctl status` should show "active (running)"
- Forgejo web interface should show the runner as online - Forgejo web interface should show the runner as online with "ci" label
### Step 22: Set Up Monitoring and Cleanup ### Step 22: Set Up Monitoring and Cleanup