You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Integrating with dagger is actually pretty easy, I think. I played around with it today and you can just wrap the kargo-render docker image and directly use it. The kargo-render go library is IMHO not the way to go here, as dagger wants to execute the stuff in a docker image anyway.
As of now there's no module on daggerverse, but you can easily create your own and use it like that. From what I played with, it looks something like this:
// A dagger module for kargo-renderedpackage main
import (
"context""fmt"
)
typeDaggerKargostruct{}
// Render plain (json/yaml) manifests for a given repo// containing either helm or kustomize resourcesfunc (m*DaggerKargo) RenderManifests(
ctx context.Context,
// the URL of a remote gitops reporepoUrlstring,
// a branch or a precise commit to render from;// if this is not provided, Kargo Render renders from the head of the default branch// +optionalbaseBranchstring,
// the environment-specific branch to render manifests intotargetBranchstring,
// username for reading from and writing to the remote gitops reporepoUsernamestring,
// password for reading from and writing to the remote gitops reporepoPassword*Secret,
// a format for command output (json or yaml)// +default="yaml"outputFormatstring,
// the version of the kargo-renderer used internally// +default="v0.1.0-rc.35"kargoRendererVersionstring,
) (string, error) {
plainPassword, err:=repoPassword.Plaintext(ctx)
iferr!=nil {
return"", err
}
returndag.Container().
From(fmt.Sprintf("ghcr.io/akuity/kargo-render:%s", kargoRendererVersion)).
// fix some issues with wrong home variable stuff when it comes to helm templatingWithEnvVariable("XDG_CONFIG_HOME", "/tmp").
WithEnvVariable("XDG_CACHE_HOME", "/tmp").
WithEnvVariable("XDG_DATA_HOME", "/tmp").
// execute the docker commandWithExec([]string{
"kargo-render",
"render",
"--repo", repoUrl,
"--ref", baseBranch,
"--target-branch", targetBranch,
"--output", outputFormat,
"--repo-username", repoUsername,
"--repo-password", plainPassword,
}).
Stdout(ctx)
}
Already have 'go-lang' style integration, would it be possible to create doc's / example for using it with dagger.io ?
REF daggerio i.e. pipeline independent builds ?
The text was updated successfully, but these errors were encountered: