Skip to content

feat: [CI-21185]: Add Dockerfile and versioning support for plugin binary#47

Merged
spahuja-harness merged 1 commit intomainfrom
ci-21185-add-plugin-dockerfile
Mar 2, 2026
Merged

feat: [CI-21185]: Add Dockerfile and versioning support for plugin binary#47
spahuja-harness merged 1 commit intomainfrom
ci-21185-add-plugin-dockerfile

Conversation

@spahuja-harness
Copy link
Copy Markdown
Contributor

Summary

Add Dockerfile and versioning support for the plugin binary to enable Harness CI builds and Docker-based distribution.

Changes

Version Support

  • ✅ Added version/version.go with GetVersion() pattern
    • Returns "dev" for local builds
    • Can be set via ldflags during Docker build
  • ✅ Updated main.go to support -v and --version flags

Docker Build

  • ✅ Created docker/Dockerfile-plugin for building binary images
    • Multi-stage build using GAR golang:1.25-alpine3.21
    • Scratch-based final image with binary at /binaries/plugin
    • Supports cross-platform builds (linux/darwin/windows, amd64/arm64)
    • Version injected via BUILD_VERSION arg

Harness CI Integration

  • ✅ Added config/manifest.yaml for Harness CI pipeline

Testing

# Without ldflags
go build && ./plugin -v
# Output: dev

# With ldflags
go build -ldflags "-X github.com/drone/plugin/version.Version=3.9.5-beta" && ./plugin -v
# Output: 3.9.5-beta

Impact

This enables building harness/harness-vm-runner-plugin images that will be bundled into harness-vm-runner-binaries for VM injection.

Dependencies

  • Part of VM Runner binary modernization effort
  • Follows pattern established in CI-21182 (lite-engine)
  • Required for harness-vm-runner-binaries bundle

JIRA

https://harness.atlassian.net/browse/CI-21185

…nary

Add support for building plugin Docker images via Harness CI pipeline,
following the same pattern as lite-engine (CI-21182).

Changes:
- Added version/version.go with GetVersion() pattern
  * Returns "dev" for local builds
  * Can be set via ldflags during Docker build
- Updated main.go to support -v and --version flags
- Created docker/Dockerfile-plugin for building binary images
  * Multi-stage build using GAR golang:1.25-alpine3.21
  * Scratch-based final image with binary at /binaries/plugin
  * Supports cross-platform builds (linux/darwin/windows, amd64/arm64)
  * Version injected via BUILD_VERSION arg
- Added config/manifest.yaml for Harness CI pipeline integration

This enables building harness/harness-vm-runner-plugin images that will be
bundled into harness-vm-runner-binaries for VM injection.

Tested:
- plugin -v returns "dev" without ldflags
- plugin -v returns "3.9.5-beta" with ldflags
@spahuja-harness spahuja-harness merged commit 341a9b3 into main Mar 2, 2026
1 check passed
spahuja-harness added a commit that referenced this pull request Mar 4, 2026
This is a placeholder commit to enable Harness CI build pipeline.

Harness CI requires branch format 'release/*' for PATCH releases.
Command format: SERVICE_NAME@release/branch-name

All actual implementation for CI-21185 has been completed in previous PRs:
- #47: Dockerfile and versioning support
- #49: Helm chart for build pipeline compliance

This PR establishes the release branch for CI/CD integration.
spahuja-harness added a commit that referenced this pull request Mar 4, 2026
This is a placeholder commit to enable Harness CI build pipeline.

Harness CI requires branch format 'release/*' for PATCH releases.
Command format: SERVICE_NAME@release/branch-name

All actual implementation for CI-21185 has been completed in previous PRs:
- #47: Dockerfile and versioning support
- #49: Helm chart for build pipeline compliance

This PR establishes the release branch for CI/CD integration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants