14 Commits

Author SHA1 Message Date
jcabillot a9fa841569 Merge pull request 'fix: use git push instead of GitHub API for tag creation' (#11) from fix/git-tag-push into main
Docker Build and Push / build (push) Successful in 3m47s
Reviewed-on: #11
2026-06-12 12:48:39 -04:00
cloudix_mcp_server f1d828bfe3 fix: use git push instead of GitHub API for tag creation
Docker Build and Push / build (pull_request) Successful in 3m1s
GIT_API_TAGGING defaults to true, which tries to create tags via the
GitHub REST API (api.github.com). On self-hosted Gitea, this fails.
Setting it to false uses git push origin <tag> instead, which works
with the credentials configured by actions/checkout.
2026-06-12 12:47:40 -04:00
jcabillot be4711f646 Merge pull request 'ci: add automatic semver tagging on merge to main' (#10) from feat/semver-tag-action into main
Docker Build and Push / build (push) Failing after 4m0s
Reviewed-on: #10
2026-06-12 12:37:45 -04:00
cloudix_mcp_server 0ba3f170fd ci: add automatic semver tagging on push to main
Docker Build and Push / build (pull_request) Successful in 2m56s
Uses anothrNick/github-tag-action (v1.75.0) to bump version and create
a git tag based on #major/#minor/#patch keywords in merge commits.
Runs only on push events to main (i.e. after a PR merge).

Also adds fetch-depth: 0 to checkout so the tag action can see all tags.

Fixes docker/build-push-action SHA: f9a3042 -> f9f3042 (v7.2.0).
2026-06-12 12:34:30 -04:00
cloudix_mcp_server ae9adb3c8a ci: add automatic semver tagging on push to main
Docker Build and Push / build (pull_request) Failing after 2m36s
Uses anothrNick/github-tag-action (v1.75.0) to bump version and create
a git tag based on #major/#minor/#patch keywords in merge commits.
Runs only on push events to main (i.e. after a PR merge).

Also adds fetch-depth: 0 to checkout so the tag action can see all tags.
2026-06-12 12:25:16 -04:00
cloudix_mcp_server b97f91546a ci: add automatic semver tagging on push to main
Uses anothrNick/github-tag-action (v1.75.0) to bump version and create
a git tag based on #major/#minor/#patch keywords in merge commits.
Runs only on push events to main (i.e. after a PR merge).

Also adds fetch-depth: 0 to checkout so the tag action can see all tags.
2026-06-12 12:19:56 -04:00
jcabillot 06453428ec Merge pull request 'chore(deps): update registry.k8s.io/kubectl docker tag to v1.36.2' (#9) from renovate/registry.k8s.io-kubectl-1.x into main
Docker Build and Push / build (push) Successful in 4m14s
Reviewed-on: #9
2026-06-12 07:31:19 -04:00
renovate 5698cbb1dc chore(deps): update registry.k8s.io/kubectl docker tag to v1.36.2
Docker Build and Push / build (pull_request) Successful in 2m44s
2026-06-12 11:05:52 +00:00
jcabillot 64efc540ce Merge pull request 'chore(deps): pin dependencies' (#6) from renovate/pin-dependencies into main
Docker Build and Push / build (push) Successful in 4m6s
Reviewed-on: #6
2026-06-09 14:13:44 -04:00
jcabillot 9abc442574 Merge pull request 'docs: add dependency management section — renovate must track all pinned Dockerfile packages' (#8) from docs/agents-md-renovate-convention into main
Docker Build and Push / build (push) Successful in 3m49s
Reviewed-on: #8
2026-06-09 12:46:56 -04:00
cloudix_mcp_server 7ffc2f7e4f docs: fix double-encoded AGENTS.md, replace Jenkins with Gitea Actions
Docker Build and Push / build (pull_request) Successful in 3m13s
2026-06-09 12:27:13 -04:00
cloudix_mcp_server d7acd23316 docs: remove all Jenkins references, replace with Gitea Actions conventions
Docker Build and Push / build (pull_request) Successful in 3m27s
2026-06-09 12:25:56 -04:00
Sagent 990aceff0e docs: add dependency management section — renovate must track all pinned Dockerfile packages
Docker Build and Push / build (pull_request) Successful in 3m49s
2026-06-09 16:18:58 +00:00
cloudix_mcp_server b7bd789d99 chore: add renovate regex manager for opencode-ai
Docker Build and Push / build (push) Successful in 3m50s
2026-06-09 12:16:03 -04:00
4 changed files with 42 additions and 14 deletions
+13 -1
View File
@@ -14,6 +14,8 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
fetch-depth: 0
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4 uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
@@ -37,10 +39,20 @@ jobs:
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7 uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with: with:
context: . context: .
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
pull: true pull: true
- name: Bump version and push tag
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: anothrNick/github-tag-action@4ed44965e0db8dab2b466a16da04aec3cc312fd8 # v1.75.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: patch
RELEASE_BRANCHES: main
WITH_V: true
GIT_API_TAGGING: false
+18 -11
View File
@@ -2,33 +2,40 @@
## Project overview ## Project overview
This repository builds and publishes a Docker image for [OpenCode](https://opencode.ai), the open source AI coding agent. The image runs OpenCode in headless server mode (`opencode serve`) and is automatically rebuilt and pushed to Docker Hub (`jcabillot/opencode`) every night by a Jenkins pipeline. This repository builds and publishes a Docker image for [OpenCode](https://opencode.ai), the open source AI coding agent. The image runs OpenCode in headless server mode (`opencode serve`) and is automatically rebuilt and pushed to Docker Hub (`jcabillot/opencode`) every night by a Gitea Actions pipeline.
## Repository structure ## Repository structure
``` ```
. .
├── Dockerfile # Image definition ├── Dockerfile # Image definition
├── Jenkinsfile # CI/CD pipeline (nightly build + Docker Hub push) ├── .gitea/workflows/docker-build.yaml # CI/CD pipeline (Gitea Actions)
├── opencode-attach # Helper script for attaching to a running server ├── renovate.json # Dependency update automation (Renovatebot)
── README.md # Usage documentation ── opencode-attach # Helper script for attaching to a running server
└── README.md # Usage documentation
``` ```
## Dependency management
- **Always pin versions** in the Dockerfile `npm install` command (e.g. `opencode-ai@1.16.2 n2-soul@9.0.9`). Never leave packages unpinned.
- **Update renovate customManagers** when adding, removing, or renaming a dependency tracked in the Dockerfile. Each pinned package must have a corresponding `customManager` entry in `renovate.json` with a regex `matchStrings` pattern that captures the version. If a dependency is added without a renovate entry, Renovatebot will not open automated PRs for it.
- **apt packages** (apt-get install lines in Dockerfile) and **COPY --from** image references are not currently tracked by Renovate. Pinning these manually is acceptable for now but adding renovate managers for them is encouraged.
## Dockerfile conventions ## Dockerfile conventions
- **Base image**: `node:24` — Debian-based Node.js image (not Alpine, needed for apt packages). - **Base image**: `node:24` — Debian-based Node.js image (not Alpine, needed for apt packages).
- **Install**: `npm i -g opencode-ai n2-soul@<version>` — installs OpenCode and Soul globally. - **Install**: `npm i -g opencode-ai@<version> n2-soul@<version>` — installs OpenCode and Soul globally, both pinned.
- **Version check**: `RUN opencode --version` after install to validate the build and record the installed version in build logs. - **Version check**: `RUN opencode --version` after install to validate the build and record the installed version in build logs.
- **Dedicated user**: a non-root `opencode` user and group are created with `groupadd`/`useradd` (UID/GID 1000). All runtime steps run as this user. - **Dedicated user**: a non-root `opencode` user and group are created with `groupadd`/`useradd` (UID/GID 1000). All runtime steps run as this user.
- **Cluster tooling**: `kubectl` is copied from the official `registry.k8s.io/kubectl` image (multi-stage COPY). - **Cluster tooling**: `kubectl` is copied from the official `registry.k8s.io/kubectl` image (multi-stage COPY).
- **Entrypoint**: `["opencode"]` — arguments are passed at runtime (e.g. `serve`). - **Entrypoint**: `["opencode"]` — arguments are passed at runtime (e.g. `serve`).
## Jenkinsfile conventions ## CI/CD conventions (Gitea Actions)
- The pipeline runs on a `@midnight` cron trigger for nightly rebuilds. - Pipeline triggers on push to `main`, PRs targeting `main`, and a nightly cron (`cron: '0 0 * * *'`).
- Build uses `--no-cache --pull` to always fetch the latest base image and package version. - Image is pushed to Docker Hub only on non-PR events (main branch pushes and cron runs).
- Docker Hub credentials are stored under the `dockerhub_jcabillot` Jenkins credential ID. - Docker Hub credentials are stored in Gitea Actions secrets (`DOCKERHUB_USERNAME`, `DOCKERHUB_TOKEN`).
- The image is published as `jcabillot/opencode` (no explicit tag = `latest`). - The image is published as `jcabillot/opencode:latest` with digest and branch tags.
## Useful commands ## Useful commands
+1 -1
View File
@@ -17,7 +17,7 @@ RUN apt-get update && \
chown -R 1000:1000 /usr/local/lib/node_modules/n2-soul/ chown -R 1000:1000 /usr/local/lib/node_modules/n2-soul/
COPY --chmod=755 opencode-attach /usr/local/bin/opencode-attach COPY --chmod=755 opencode-attach /usr/local/bin/opencode-attach
COPY --from=registry.k8s.io/kubectl:v1.36.1 /bin/kubectl /usr/local/bin/kubectl COPY --from=registry.k8s.io/kubectl:v1.36.2 /bin/kubectl /usr/local/bin/kubectl
USER opencode USER opencode
WORKDIR /home/opencode WORKDIR /home/opencode
+10 -1
View File
@@ -9,6 +9,15 @@
"depNameTemplate": "n2-soul", "depNameTemplate": "n2-soul",
"datasourceTemplate": "npm", "datasourceTemplate": "npm",
"versioningTemplate": "npm" "versioningTemplate": "npm"
},
{
"customType": "regex",
"description": "Track opencode-ai npm package pinned in Dockerfile RUN command",
"managerFilePatterns": ["/^Dockerfile$/"],
"matchStrings": ["opencode-ai@(?<currentValue>[^\\s]+)"],
"depNameTemplate": "opencode-ai",
"datasourceTemplate": "npm",
"versioningTemplate": "npm"
} }
] ]
} }