Local dev
make dev boots the whole platform on your machine: control plane
(server), an agent, the web dashboard, and a Postgres in Docker.
Useful for iterating on plugins, parser changes, or new pipeline
recipes before they hit the cluster.
Prerequisites
- Go 1.25 (the workspace is on
go 1.25.0). - pnpm 9+ for the web frontend.
- Docker (the agent’s default runtime spawns containers).
goosefor migrations:go install github.com/pressly/goose/v3/cmd/goose@latest.sqlcfor query regeneration:go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest.buffor proto changes:go install github.com/bufbuild/buf/cmd/buf@latest.
First run
git clone https://github.com/klinux/gocdnext.gitcd gocdnextcp .env.example .envmake devWhat .env.example covers:
GOCDNEXT_DATABASE_URL— points at the postgres-dev container.GOCDNEXT_DOCKER_PULL_POLICY=always— recommended in dev so plugin image edits show up without manualdocker pull.GOCDNEXT_AGENT_NAME=dev,GOCDNEXT_AGENT_TOKEN=dev-token— pre-provisioned in the dev seed.
Once make dev settles:
- Server on
http://localhost:8153 - Agent registered (check
/agentsin the dashboard) - Web on
http://localhost:3000
Working on a pipeline locally
Create .gocdnext/hello.yaml:
name: hellowhen: event: [push, pull_request]stages: [smoke]jobs: greet: stage: smoke image: alpine:3.20 script: - echo "hello from $(uname -sr)"Apply it:
gocdnext apply --slug demo --name "Demo project" .Trigger a run from the dashboard or push a commit if you’ve wired the
scm_source. Logs stream live via SSE; reloads keep working through
the cursor-paginated read API.
Working on a plugin
Plugins live in plugins/<name>/ — Dockerfile, entrypoint, and a
plugin.yaml manifest. The thin shim pattern from
plugins/go/entrypoint.sh is the simplest reference:
#!/bin/shset -eucd /workspace[ -n "${PLUGIN_WORKING_DIR:-}" ] && cd "${PLUGIN_WORKING_DIR}"echo "==> go ${PLUGIN_COMMAND}"exec go ${PLUGIN_COMMAND}Local iteration loop:
docker build -t gocdnext-plugin-myplugin:dev plugins/myplugin# Edit plugins/myplugin/plugin.yaml so the catalog picks up your# inputs schema. The server reloads the catalog on restart only —# `make stop && make dev` after a manifest edit.To exercise the plugin in a real pipeline locally, push your dev image to a registry the agent can reach (or load it directly into the agent’s Docker daemon) and reference it via:
uses: gocdnext-plugin-myplugin:devTests
make test # full suite, race detector on, includes containersmake lint # golangci-lint on every module + buf lintmake build produces production-ready Go binaries; the web build
runs as part of cd web && pnpm build (Next.js production
build).
Database integration tests use testcontainers-go — they spin up a fresh Postgres per test binary. First invocation pulls the postgres image (~200 MB); subsequent runs reuse it.
Cleaning up
make stop # stop the dev stack (server + agent + web)make db-down # tear down the dev Postgres containerdocker volume prune # if you want to wipe the dev DB volume