|
|
||
|---|---|---|
| app | ||
| config | ||
| docs | ||
| files/ctl | ||
| gcloud/tf | ||
| k8s-manifests | ||
| logger | ||
| pipelines | ||
| scripts | ||
| templates | ||
| vagrant/dev/ubuntu | ||
| .envrc.example | ||
| .gitignore | ||
| build.sh | ||
| go.mod | ||
| go.sum | ||
| install.sh | ||
| LICENSE | ||
| main.go | ||
| main_test.go | ||
| pipeline.json.example | ||
| README.md | ||
infctl-cli
infctl-cli is a Go command-line tool for orchestrating deployment pipelines using shell scripts and Kubernetes manifests. The tool is configured via JSON files and executes tasks as defined in a pipeline configuration.
Project Structure
infctl-cli/
├── main.go # Application entry point
├── go.mod # Go module definition
├── app/ # Core application logic
│ ├── app.go # Pipeline orchestration and state management
│ └── k8s.go # Kubernetes operations
├── config/ # Configuration management
│ ├── base.go # Base configuration handling
│ └── project.go # Project configuration handling
├── docs/ # Documentation
│ ├── API_REFERENCE.md # API reference
│ └── CONFIG_SCHEMA.md # Config schema
├── scripts/ # Shell scripts executed by the CLI
├── k8s-manifests/ # Kubernetes manifests
├── templates/ # Template files
└── files/ # Static configuration files
Configuration Files
Three JSON files are used:
base.json: Base configuration (e.g.,projects_directory, images, environment file path)config.json: Project-specific configuration (e.g., project name, directory, URLs, port)pipeline.json: Defines the sequence of scripts and manifests to execute
Example configuration files are provided as .example files in the repository.
Usage
Build the CLI:
go mod download
go build -o infctl-cli .
Run the CLI with a pipeline file:
./infctl-cli --deployment-file pipeline.json
# or
./infctl-cli -f pipeline.json
The CLI will:
- Load base and project configuration
- Initialize SQLite database for state management
- Execute the pipeline defined in the JSON file
- Run scripts from the
scripts/directory - Apply Kubernetes manifests from the
k8s-manifests/directory
Scripts
Shell scripts in scripts/ are executed as defined in the pipeline configuration. Scripts are responsible for infrastructure setup, secret creation, configmap generation, and other deployment tasks. The pipeline JSON determines the order and parameters for each script.
Kubernetes Manifests
Manifests in k8s-manifests/ are applied using kubectl and kustomize. The pipeline configuration specifies which manifests to apply and in what order.
Testing
Run tests with:
go test ./... -v
License
This project is licensed under the GNU General Public License v3.0. See LICENSE for details.