3 Home
Virgil edited this page 2026-02-19 16:59:42 +00:00

go-devops

Portable dev environment orchestration, multi-language builds, Ansible execution, and infrastructure provisioning.

Module: forge.lthn.ai/core/go-devops
Go: 1.25.5
Licence: EUPL-1.2

Overview

go-devops provides a unified toolkit for development environment management, build orchestration, and infrastructure provisioning. It supports LinuxKit-based portable VMs, multi-language project detection with cross-compilation, Ansible playbook execution, OpenAPI SDK generation, and cloud provisioning for Hetzner and CloudNS.

Package Structure

Package Purpose
devops/ LinuxKit dev environment lifecycle (image pull, cache, verify)
ansible/ Playbook execution, inventory parsing, SSH connection pooling
build/ Multi-language project detection and cross-compilation
container/ LinuxKit/QEMU/Hyperkit VM management
sdk/ OpenAPI spec codegen for 6 languages + breaking change detection
devkit/ Developer toolkit utilities
infra/ Cloud provisioning (Hetzner servers, CloudNS DNS)

Quick Start

import (
    "forge.lthn.ai/core/go-devops/build"
    "forge.lthn.ai/core/go-devops/ansible"
    "forge.lthn.ai/core/go-devops/container"
)

// Auto-detect project type and build
cfg := build.Config{ProjectDir: "./my-project", OutputDir: "./dist"}
builder := build.New(cfg)
artifacts, err := builder.Build(ctx)

// Run an Ansible playbook
executor := ansible.NewExecutor("/path/to/playbooks")
executor.SetInventory("/path/to/inventory.yml")
result, err := executor.Run(ctx, "deploy.yml")

// Start a LinuxKit VM
mgr := container.NewLinuxKitManager("qemu")
ctr, err := mgr.Run(ctx, container.RunOptions{
    Name:   "dev-env",
    Memory: "4G",
    CPUs:   4,
})

API Overview

Type Package Description
Config build Build settings (project dir, output, name, version, ldflags)
ProjectType build Detected project type (go, node, php, etc.)
Target build OS/Arch cross-compilation target
Artifact build Build output with path, checksum
Executor ansible Playbook runner with inventory and results
Inventory ansible Host groups and variables
Task / TaskResult ansible Playbook task definition and execution result
Container container VM instance with status, PID, ports
Manager container Interface for Run, Stop, Logs, Exec, Inspect
DevOps devops Top-level environment lifecycle
HetznerProvisioner infra Cloud server provisioning
CloudNSManager infra DNS record management

Dependencies

Module Purpose
github.com/Snider/Borg Secure blob/pointer storage for secrets
github.com/getkin/kin-openapi OpenAPI 3.x spec parsing
github.com/oasdiff/oasdiff API breaking change detection
github.com/spf13/cobra CLI command structure
golang.org/x/crypto SSH client for Ansible connections

Pages

  • Build-System — Multi-language project detection, cross-compilation, and SDK generation
  • Ansible-Executor — Playbook execution, inventory, and SSH management
  • Infrastructure — Container management, Hetzner provisioning, and CloudNS DNS