Formato .gitops.yml
O arquivo .gitops.yml na raiz do repositorio define como o GitOps processa e distribui os artefatos de cada release.
Estrutura Completa
version: 2.0
# Canais de distribuicao (opcional)
channels:
stable:
branch: main
tag_pattern: "v[0-9]+.[0-9]+.[0-9]+$"
folder: ""
is_default: true
rc:
branch: dev
tag_pattern: "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+$"
folder: "rc"
is_prerelease: true
# Artefatos para upload
artifacts:
- source: asset:projeto.zip:binario
destination: "{channel_path}binario"
type: binary
latest: true
- source: asset:projeto.zip:binario
destination: "{channel_path}binario.zip"
type: zip
latest: true
- source: asset:projeto.zip:binario
destination: "{channel_path}{version}/binario"
type: binary
versioned: true
# Documentacao
docs:
- source: README.md
destination: docs/latest/README.md
latest: true
- source: README.md
destination: docs/{version}/README.md
versioned: true
# Storage
storage:
provider: b2
bucket: ccs-systems
folder_name: projeto
delivery_url: https://projeto.ccs.systems
# Publicacao
publish:
auto_latest: true
preserve_versions: true
max_versions: 10
max_rc_versions: 5
# GitHub
github:
repo: devborlot/projeto-client
# Metadata
metadata:
project: projeto
type: client
language: rustSecoes
channels
Define canais de distribuicao. Cada canal mapeia um padrao de tag para uma pasta no storage.
| Campo | Tipo | Descricao |
|---|---|---|
branch |
string | Branch associada ao canal |
tag_pattern |
regex | Padrao regex para detectar tags |
folder |
string | Pasta no storage ("" = raiz) |
is_default |
bool | Canal padrao |
is_prerelease |
bool | Marca como prerelease |
artifacts
Lista de artefatos para processar e enviar ao storage.
| Campo | Tipo | Descricao |
|---|---|---|
source |
string | Origem do artefato (ver abaixo) |
destination |
string | Caminho de destino no storage |
type |
string | binary ou zip |
latest |
bool | Atualiza copia "latest" |
versioned |
bool | Cria copia versionada |
Formatos de source:
| Formato | Descricao | Exemplo |
|---|---|---|
path/file |
Arquivo do repositorio | meu-binario |
asset:name |
Asset do GitHub Release | asset:projeto.zip |
asset:name.zip:inner |
Extrai arquivo de ZIP | asset:projeto.zip:binario |
Placeholders em destination:
| Placeholder | Valor | Exemplo |
|---|---|---|
{channel_path} |
Pasta do canal + / |
"" (stable) ou "rc/" |
{version} |
Versao sem prefixo v |
1.2.3 |
docs
Lista de documentos para upload. Formato identico ao v2.0.
| Campo | Tipo | Descricao |
|---|---|---|
source |
string | Caminho do arquivo no repo |
destination |
string | Caminho de destino no storage |
latest |
bool | Atualiza copia latest |
versioned |
bool | Cria copia versionada |
Formato legacy (ainda suportado):
docs:
readme: README.md
manual: MANUAL.md
changelog: CHANGELOG.mdstorage
Configuracao do storage de destino.
| Campo | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
provider |
string | Sim | b2 (Backblaze B2) |
bucket |
string | Sim | Nome do bucket |
folder_name |
string | Sim | Pasta raiz no bucket |
delivery_url |
string | Sim | URL base do CDN |
Aliases: path funciona como alias de folder_name. public_url funciona como alias de delivery_url.
Importante: Se folder_name estiver vazio, o GitOps usa o nome do repositorio como fallback.
publish
Opcoes de publicacao.
| Campo | Tipo | Default | Descricao |
|---|---|---|---|
auto_latest |
bool | true | Atualiza "latest" automaticamente |
preserve_versions |
bool | true | Mantem versoes anteriores |
max_versions |
int | 10 | Maximo de versoes stable |
max_rc_versions |
int | 5 | Maximo de versoes RC |
Exemplos Reais
Client CLI Simples
version: 2.0
artifacts:
- source: meu-app
destination: meu-app
type: binary
latest: true
- source: meu-app
destination: meu-app.zip
type: zip
latest: true
- source: meu-app
destination: v{version}/meu-app
type: binary
versioned: true
docs:
- source: README.md
destination: docs/latest/README.md
latest: true
storage:
provider: b2
bucket: ccs-systems
folder_name: meu-app
delivery_url: https://meu-app.ccs.systemsClient com Release Candidates
version: 2.0
channels:
stable:
branch: main
tag_pattern: "v[0-9]+.[0-9]+.[0-9]+$"
folder: ""
is_default: true
rc:
branch: dev
tag_pattern: "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+$"
folder: "rc"
is_prerelease: true
artifacts:
- source: asset:app.zip:app
destination: "{channel_path}app"
type: binary
latest: true
- source: asset:app.zip
destination: "{channel_path}app.zip"
type: binary
latest: true
- source: asset:app.zip:app
destination: "{channel_path}{version}/app"
type: binary
versioned: true
storage:
provider: b2
bucket: ccs-systems
folder_name: app
delivery_url: https://app.ccs.systemsProjeto com Dominio Proprio
version: 2.0
artifacts:
- source: backupally
destination: backupally
type: binary
latest: true
- source: backupally
destination: backupally.zip
type: zip
latest: true
storage:
provider: b2
bucket: ccs-systems
folder_name: backupally
delivery_url: https://get.backupally.com
By Borlot.com.br on 06/03/2026