Skip to content

Commit

Permalink
changed functions DeployHelmCharts and deployTapService to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiomansillab committed Nov 7, 2024
1 parent 1c00c7b commit 1b6bab0
Showing 1 changed file with 38 additions and 6 deletions.
44 changes: 38 additions & 6 deletions ci/dagger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,55 @@ func (m *Ci) DeployHelmCharts(
version string,
dryRun bool,
) (string, error) {
// var result string
// container := m.deployTapService(username, password, helmValues, version, dryRun)
// output, err := container.Stdout(ctx)
// if err != nil {
// return "", err
// }
// result += output + "\n"
// return result, nil
var result string
container := m.deployTapService(username, password, helmValues, version, dryRun)
container, err := m.deployTapService(username, password, helmValues, version, dryRun)
if err != nil {
return "", fmt.Errorf("deploy failed: %w", err)
}

output, err := container.Stdout(ctx)
if err != nil {
return "", err
return "", fmt.Errorf("failed to get deployment output: %w", err)
}

result += output + "\n"

return result, nil
}

func (m *Ci) deployTapService(username string, password *Secret, helmValues *string, version string, dryRun bool) *Container {
// opts := TapservicegoDeployOpts{
// HelmValues: *helmValues,
// }
// url := "ghcr.io/%s/tapservice-chart/tapservice:%s"
// url = fmt.Sprintf(url, username, version)
// return dag.Tapservicego().Deploy(username, password, url, dryRun, opts)

helmValuesStr := ""
if helmValues != nil {
helmValuesStr = *helmValues
}

opts := TapservicegoDeployOpts{
HelmValues: *helmValues,
HelmValues: helmValuesStr,
}
url := fmt.Sprintf("ghcr.io/%s/tapservice-chart/tapservice:%s", username, version)

container := dag.Tapservicego().Deploy(username, password, url, dryRun, opts)
if container == nil {
return nil, fmt.Errorf("failed to create deployment container")
}
url := "ghcr.io/%s/tapservice-chart/tapservice:%s"
url = fmt.Sprintf(url, username, version)
return dag.Tapservicego().Deploy(username, password, url, dryRun, opts)

return container, nil

}

func (m *Ci) publishTapservice(
Expand Down

0 comments on commit 1b6bab0

Please sign in to comment.