diff --git a/.forgejo/workflows/test.yaml b/.forgejo/workflows/test.yaml index dd6e668..a0552bf 100644 --- a/.forgejo/workflows/test.yaml +++ b/.forgejo/workflows/test.yaml @@ -10,7 +10,12 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout (git clone) + run: | + git clone --depth 1 --branch "${{ gitea.ref_name }}" \ + "${{ gitea.server_url }}/${{ gitea.repository }}.git" . + env: + GIT_SSL_NO_VERIFY: "true" - name: Hello World run: | @@ -18,3 +23,4 @@ jobs: echo "Runner: $(hostname)" echo "Repository: ${{ gitea.repository }}" echo "Branch: ${{ gitea.ref_name }}" + ls -la diff --git a/plans/ci-cd-bootstrap/P4_container_builds.md b/plans/ci-cd-bootstrap/P4_container_builds.md index 6e4297c..6a7ced8 100644 --- a/plans/ci-cd-bootstrap/P4_container_builds.md +++ b/plans/ci-cd-bootstrap/P4_container_builds.md @@ -17,6 +17,78 @@ With Forgejo Actions operational, we can now build container images for: --- +## Use Case 0: Custom Runner Image + +### Problem + +The stock `forgejo/runner` image lacks tools needed for standard GitHub Actions: +- **Node.js** - Required by most actions (checkout, setup-*, etc.) +- **Docker CLI** - For building container images +- **Git** - For repository operations +- **Common build tools** - make, gcc, etc. + +In host mode, jobs run directly in the runner container, so these tools must be pre-installed. + +### Solution + +Build a custom runner image with all necessary tools: + +```dockerfile +# argocd/manifests/forgejo-runner/Dockerfile +FROM code.forgejo.org/forgejo/runner:3.5.1 + +# Install Node.js (required for most GitHub Actions) +RUN apt-get update && apt-get install -y \ + nodejs \ + npm \ + git \ + curl \ + docker.io \ + make \ + gcc \ + && rm -rf /var/lib/apt/lists/* +``` + +### Workflow + +Create `.forgejo/workflows/build-runner.yml`: + +```yaml +name: Build Runner Image + +on: + push: + paths: + - 'argocd/manifests/forgejo-runner/Dockerfile' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + run: | + git clone --depth 1 "${{ gitea.server_url }}/${{ gitea.repository }}.git" . + + - name: Build and push + run: | + cd argocd/manifests/forgejo-runner + docker build -t registry.tail8d86e.ts.net/blumeops/forgejo-runner:latest . + docker push registry.tail8d86e.ts.net/blumeops/forgejo-runner:latest +``` + +### Update Deployment + +Once the custom image is built, update `argocd/manifests/forgejo-runner/deployment.yaml`: + +```yaml +image: registry.tail8d86e.ts.net/blumeops/forgejo-runner:latest +``` + +This enables standard GitHub Actions like `actions/checkout@v4` to work in host mode. + +--- + ## Use Case 1: devpi Custom Image ### Current State