feat(dependencies): Add postinstall process and swagger dependency
This commit is contained in:
@ -31,7 +31,10 @@ func init() {
|
||||
|
||||
func runUpgradeAction(cmd *cobra.Command, args []string) {
|
||||
|
||||
dependencies := []dependencies.Dependency{dependencies.Golang{}}
|
||||
dependencies := []dependencies.Dependency{
|
||||
dependencies.Golang{},
|
||||
dependencies.Swagger{},
|
||||
}
|
||||
|
||||
for _, dependency := range dependencies {
|
||||
|
||||
@ -95,7 +98,7 @@ func runUpgradeAction(cmd *cobra.Command, args []string) {
|
||||
installDirectory = helpers.IsValidPathInput()
|
||||
}
|
||||
|
||||
log.Infof("The following command will be executed:\n%s", dependency.DescribeInstall(installDirectory))
|
||||
log.Infof("%s", dependency.DescribeInstall(installDirectory))
|
||||
log.Info("Do you want to continue ?")
|
||||
answer := helpers.YesOrNoInput()
|
||||
if !answer {
|
||||
@ -111,6 +114,21 @@ func runUpgradeAction(cmd *cobra.Command, args []string) {
|
||||
return
|
||||
}
|
||||
|
||||
log.Infof("%s", dependency.DescribePostInstall(installDirectory))
|
||||
log.Info("Do you want to continue ?")
|
||||
answer = helpers.YesOrNoInput()
|
||||
if !answer {
|
||||
log.Warnf("Skipping post installation of %s. Some part of the application might not be able to work correctly!", dependency.GetName())
|
||||
continue
|
||||
}
|
||||
|
||||
log.Debug("Launching post install")
|
||||
err = dependency.PostInstall(installDirectory)
|
||||
if err != nil {
|
||||
log.Errorf("Fail to execute post install of %s. The following error happen: %s", dependency.GetName(), err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
log.Infof("%s successfully installed", dependency.GetName())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user