refactor: move app files from config to app package

This commit is contained in:
2024-07-05 16:04:01 +02:00
parent ac695ae28e
commit f18c642226
31 changed files with 915 additions and 912 deletions

View File

@ -7,6 +7,7 @@ import (
"path"
"strings"
appPkg "coopcloud.tech/abra/pkg/app"
"coopcloud.tech/abra/pkg/config"
"coopcloud.tech/abra/pkg/formatter"
"github.com/AlecAivazis/survey/v2"
@ -15,7 +16,7 @@ import (
)
// NewVersionOverview shows an upgrade or downgrade overview
func NewVersionOverview(app config.App, currentVersion, newVersion, releaseNotes string) error {
func NewVersionOverview(app appPkg.App, currentVersion, newVersion, releaseNotes string) error {
tableCol := []string{"server", "recipe", "config", "domain", "current version", "to be deployed"}
table := formatter.CreateTable(tableCol)
@ -82,7 +83,7 @@ func GetReleaseNotes(recipeName, version string) (string, error) {
// PostCmds parses a string of commands and executes them inside of the respective services
// the commands string must have the following format:
// "<service> <command> <arguments>|<service> <command> <arguments>|... "
func PostCmds(cl *dockerClient.Client, app config.App, commands string) error {
func PostCmds(cl *dockerClient.Client, app appPkg.App, commands string) error {
abraSh := path.Join(config.RECIPES_DIR, app.Recipe, "abra.sh")
if _, err := os.Stat(abraSh); err != nil {
if os.IsNotExist(err) {
@ -108,7 +109,7 @@ func PostCmds(cl *dockerClient.Client, app config.App, commands string) error {
return err
}
serviceNames, err := config.GetAppServiceNames(app.Name)
serviceNames, err := appPkg.GetAppServiceNames(app.Name)
if err != nil {
return err
}
@ -135,7 +136,7 @@ func PostCmds(cl *dockerClient.Client, app config.App, commands string) error {
}
// DeployOverview shows a deployment overview
func DeployOverview(app config.App, version, message string) error {
func DeployOverview(app appPkg.App, version, message string) error {
tableCol := []string{"server", "recipe", "config", "domain", "version"}
table := formatter.CreateTable(tableCol)