orchestrator
Todo o comportamento vem de um `ci/pipeline.toml` do projeto consumidor: ostargets declarados lá viram simultaneamente as estratégias de build, os checks
de qualidade e o mapa de imagens usado por CheckImages/Promote. Isso torna
impossível o drift entre "o que se builda" e "o que se promove", e dispensa o
módulo Dagger por projeto que existia até a versão 2.x.
Installation
dagger install github.com/BasisTI/daggerverse/orchestrator@cba08bc28860c15623cd86abb27677402fd38b23Entrypoint
Return Type
Orchestrator !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | Diretório raiz do repositório do projeto. |
| configPath | String ! | "ci/pipeline.toml" | Caminho do arquivo declarativo de pipeline, relativo à raiz do repositório. |
Example
dagger -m github.com/BasisTI/daggerverse/orchestrator@cba08bc28860c15623cd86abb27677402fd38b23 call \
--config-path stringfunc (m *MyModule) Example(configPath string) *dagger.Orchestrator {
return dag.
Orchestrator(configPath)
}@function
def example(configpath: str) -> dagger.Orchestrator:
return (
dag.orchestrator(configpath)
)@func()
example(configPath: string): Orchestrator {
return dag
.orchestrator(configPath)
}Types
Orchestrator 🔗
Orchestrator expõe as funções de pipeline dirigidas pela configuração declarativa do projeto.
source() 🔗
Source é a raiz do repositório do projeto consumidor.
Return Type
Directory ! Example
dagger -m github.com/BasisTI/daggerverse/orchestrator@cba08bc28860c15623cd86abb27677402fd38b23 call \
--config-path string sourcefunc (m *MyModule) Example(configPath string) *dagger.Directory {
return dag.
Orchestrator(configPath).
Source()
}@function
def example(configpath: str) -> dagger.Directory:
return (
dag.orchestrator(configpath)
.source()
)@func()
example(configPath: string): Directory {
return dag
.orchestrator(configPath)
.source()
}configPath() 🔗
ConfigPath é o caminho do arquivo declarativo, relativo à raiz.
Return Type
String ! Example
dagger -m github.com/BasisTI/daggerverse/orchestrator@cba08bc28860c15623cd86abb27677402fd38b23 call \
--config-path string config-pathfunc (m *MyModule) Example(ctx context.Context, configPath string) string {
return dag.
Orchestrator(configPath).
Configpath(ctx)
}@function
async def example(configpath: str) -> str:
return await (
dag.orchestrator(configpath)
.configpath()
)@func()
async example(configPath: string): Promise<string> {
return dag
.orchestrator(configPath)
.configPath()
}checkImages() 🔗
CheckImages verifica se todas as imagens derivadas da configuração existem no registry antes da promoção.
Targets custom NÃO são ignorados: suas imagens existem no registry e precisam ser verificadas como qualquer outra.
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| registry | String ! | - | URL do registry Docker. |
| registryUser | String ! | - | Usuário para autenticação no registry. |
| registryPassword | Secret ! | - | Senha para autenticação no registry. |
| buildBranch | String | "origin/develop" | Ref Git da branch onde as imagens foram construídas (ex: “origin/develop”). |
Example
dagger -m github.com/BasisTI/daggerverse/orchestrator@cba08bc28860c15623cd86abb27677402fd38b23 call \
--config-path string check-images --registry string --registry-user string --registry-password env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, configPath string, registry string, registryUser string, registryPassword *dagger.Secret) {
return dag.
Orchestrator(configPath).
Checkimages(ctx, registry, registryUser, registryPassword)
}@function
async def example(configpath: str, registry: str, registryuser: str, registrypassword: dagger.Secret) -> None:
return await (
dag.orchestrator(configpath)
.checkimages(registry, registryuser, registrypassword)
)@func()
async example(configPath: string, registry: string, registryUser: string, registryPassword: Secret): Promise<void> {
return dag
.orchestrator(configPath)
.checkImages(registry, registryUser, registryPassword)
}checkQuality() 🔗
CheckQuality roda testes e análise estática (Sonar) nos targets alterados que
declaram sonar = true.
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseBranch | String ! | - | Branch base para comparar as mudanças (ex: “origin/develop”). |
| commitSha | String ! | - | Digest do commit atual (sha completo) para reporting de status. |
| sonarHost | String ! | - | URL do SonarQube. |
| sonarToken | Secret ! | - | Token de autenticação do SonarQube. |
| stopOnFirstFail | Boolean ! | false | Se true, para no primeiro target que falhar. |
| gitlabHost | String | - | URL base do GitLab (ex: CI_SERVER_URL). Se vazio, commit statuses não são reportados. |
| gitlabToken | Secret | - | Token com scope |
| gitlabProjectId | String | - | ID numérico do projeto no GitLab (ex: CI_PROJECT_ID). |
Example
dagger -m github.com/BasisTI/daggerverse/orchestrator@cba08bc28860c15623cd86abb27677402fd38b23 call \
--config-path string check-quality --base-branch string --commit-sha string --sonar-host string --sonar-token env:MYSECRET --stop-on-first-fail booleanfunc (m *MyModule) Example(ctx context.Context, configPath string, baseBranch string, commitSha string, sonarHost string, sonarToken *dagger.Secret, stopOnFirstFail bool) {
return dag.
Orchestrator(configPath).
Checkquality(ctx, baseBranch, commitSha, sonarHost, sonarToken, stopOnFirstFail)
}@function
async def example(configpath: str, basebranch: str, commitsha: str, sonarhost: str, sonartoken: dagger.Secret, stoponfirstfail: bool) -> None:
return await (
dag.orchestrator(configpath)
.checkquality(basebranch, commitsha, sonarhost, sonartoken, stoponfirstfail)
)@func()
async example(configPath: string, baseBranch: string, commitSha: string, sonarHost: string, sonarToken: Secret, stopOnFirstFail: boolean): Promise<void> {
return dag
.orchestrator(configPath)
.checkQuality(baseBranch, commitSha, sonarHost, sonarToken, stopOnFirstFail)
}promote() 🔗
Promote promove as imagens derivadas da configuração de staging para produção.
Assim como CheckImages, inclui as imagens de targets custom.
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| srcRegistry | String ! | - | Registry de origem (staging). |
| registryUser | String ! | - | Usuário para autenticação nos registries. |
| registryPassword | Secret ! | - | Senha para autenticação nos registries. |
| dstRegistry | String | - | Registry de destino (produção). Se vazio, usa srcRegistry. |
| buildBranch | String | "origin/develop" | Ref Git da branch onde as imagens foram construídas (ex: “origin/develop”). |
Example
dagger -m github.com/BasisTI/daggerverse/orchestrator@cba08bc28860c15623cd86abb27677402fd38b23 call \
--config-path string promote --src-registry string --registry-user string --registry-password env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, configPath string, srcRegistry string, registryUser string, registryPassword *dagger.Secret) {
return dag.
Orchestrator(configPath).
Promote(ctx, srcRegistry, registryUser, registryPassword)
}@function
async def example(configpath: str, srcregistry: str, registryuser: str, registrypassword: dagger.Secret) -> None:
return await (
dag.orchestrator(configpath)
.promote(srcregistry, registryuser, registrypassword)
)@func()
async example(configPath: string, srcRegistry: string, registryUser: string, registryPassword: Secret): Promise<void> {
return dag
.orchestrator(configPath)
.promote(srcRegistry, registryUser, registryPassword)
}publishAll() 🔗
PublishAll constrói e publica as imagens de todos os targets alterados e, se gitRemoteUrl for informado, commita os arquivos de versão bumpados.
Retorna a lista de imagens publicadas, uma por linha.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseBranch | String ! | - | Branch base para comparar as mudanças (ex: “origin/develop”). |
| commitSha | String ! | - | Digest do commit atual (sha completo). |
| version | String ! | - | Versão da aplicação no formato CalVer. |
| registry | String ! | - | Registry Docker para onde as imagens serão publicadas. |
| registryUser | String ! | - | Nome de usuário para autenticação no registry. |
| registryPassword | Secret ! | - | Senha do usuário para autenticação no registry. |
| gitlabHost | String | - | URL base do GitLab (ex: CI_SERVER_URL). Se vazio, commit statuses não são reportados. |
| gitlabToken | Secret | - | Token com scope |
| gitlabProjectId | String | - | ID numérico do projeto no GitLab (ex: CI_PROJECT_ID). |
| gitRemoteUrl | String | - | URL do repositório Git com credenciais para push das versões bumpadas. Se vazio, o bump de versão não é commitado. |
| gitBranch | String | "develop" | Branch Git para push das versões bumpadas. |
Example
dagger -m github.com/BasisTI/daggerverse/orchestrator@cba08bc28860c15623cd86abb27677402fd38b23 call \
--config-path string publish-all --base-branch string --commit-sha string --version string --registry string --registry-user string --registry-password env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, configPath string, baseBranch string, commitSha string, version string, registry string, registryUser string, registryPassword *dagger.Secret) string {
return dag.
Orchestrator(configPath).
Publishall(ctx, baseBranch, commitSha, version, registry, registryUser, registryPassword)
}@function
async def example(configpath: str, basebranch: str, commitsha: str, version: str, registry: str, registryuser: str, registrypassword: dagger.Secret) -> str:
return await (
dag.orchestrator(configpath)
.publishall(basebranch, commitsha, version, registry, registryuser, registrypassword)
)@func()
async example(configPath: string, baseBranch: string, commitSha: string, version: string, registry: string, registryUser: string, registryPassword: Secret): Promise<string> {
return dag
.orchestrator(configPath)
.publishAll(baseBranch, commitSha, version, registry, registryUser, registryPassword)
}validate() 🔗
Validate carrega e valida o arquivo declarativo, devolvendo um relatório legível com os targets resolvidos e o mapa de imagens derivado.
Não faz nenhuma chamada de rede: é o job de lint da configuração.
Return Type
String ! Example
dagger -m github.com/BasisTI/daggerverse/orchestrator@cba08bc28860c15623cd86abb27677402fd38b23 call \
--config-path string validatefunc (m *MyModule) Example(ctx context.Context, configPath string) string {
return dag.
Orchestrator(configPath).
Validate(ctx)
}@function
async def example(configpath: str) -> str:
return await (
dag.orchestrator(configpath)
.validate()
)@func()
async example(configPath: string): Promise<string> {
return dag
.orchestrator(configPath)
.validate()
}