36 lines
770 B
Go
36 lines
770 B
Go
package install
|
|
|
|
import (
|
|
"fmt"
|
|
"path/filepath"
|
|
|
|
log "oc-deploy/log_wrapper"
|
|
"oc-deploy/utils"
|
|
"oc-deploy/chart"
|
|
)
|
|
|
|
func (this *InstallClass) NewGenerate() (string, error) {
|
|
|
|
// Extraction du fichier de la version
|
|
dst, err := this.extractVersion()
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
|
|
this.charts, _ = chart.FromConfigFile(dst)
|
|
if err != nil {
|
|
return dst, err
|
|
}
|
|
|
|
for _, ele1 := range this.charts {
|
|
for _, ele2 := range ele1.Charts {
|
|
|
|
filename := filepath.Join(this.Workspace, fmt.Sprintf("values-%s.yml", ele2.Name) )
|
|
utils.CopyContentFile(ele2.Overwrite, filename)
|
|
log.Log().Info().Msg(fmt.Sprintf(">> %s : %s", ele2.Name, filename))
|
|
|
|
}
|
|
}
|
|
|
|
return dst, nil
|
|
} |