CI/CD Pipelines
GAGOS provides two CI/CD execution modes: Kubernetes Pipelines and SSH Freestyle Jobs.
Overview
| Feature | Pipelines | Freestyle Jobs |
|---|---|---|
| Execution | Kubernetes Pods | SSH to remote hosts |
| Configuration | YAML files | UI-based |
| Use Case | Container builds, testing | Server deployments |
Kubernetes Pipelines
Pipeline YAML Structure
apiVersion: gagos.io/v1
kind: Pipeline
metadata:
name: my-pipeline
description: Build and test
spec:
variables:
APP_ENV: production
triggers:
- type: webhook
enabled: true
- type: cron
schedule: "0 0 * * *"
jobs:
- name: build
image: golang:1.21
script: |
go build -o app ./cmd/...
- name: test
image: golang:1.21
dependsOn: [build]
script: |
go test ./...
artifacts:
- name: binary
path: /workspace/app
Creating a Pipeline
- Open CI/CD window
- Go to "Create Pipeline" tab
- Enter YAML or click "Load Sample"
- Click "Create Pipeline"
Running a Pipeline
- Go to "Pipelines" tab
- Click play button on pipeline row
- Optionally override variables
- Click "Run"
Freestyle Jobs
Creating a Freestyle Job
- First, add SSH hosts in "SSH Hosts" tab
- Go to "Freestyle Jobs" tab
- Click "Create Job"
- Add build steps
- Save and run
Build Step Types
- shell - Execute single command
- script - Execute multi-line script
- scp_push - Copy file to remote
- scp_pull - Copy file from remote
SSH Host Management
- Go to "SSH Hosts" tab
- Click "Add Host"
- Enter connection details
- Choose auth method (password or key)
- Test connection
- Save
Webhooks
Trigger pipelines from external systems:
curl -X POST "https://gagos.example.com/api/v1/cicd/webhooks/{pipelineId}/{token}" \
-H "Content-Type: application/json" \
-d '{"branch": "main"}'
Artifacts
Collect files from pipeline jobs:
- Define artifacts in pipeline YAML
- After run completes, go to "Artifacts" tab
- Download collected files
Notifications
Get notified on build events via webhooks to Slack, Discord, or custom endpoints.