@@ -38,11 +38,12 @@ func createApp(appName string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := common.PlugnTrigger("post-create", []string{appName}...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
_, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
|
||||
Trigger: "post-create",
|
||||
Args: []string{appName},
|
||||
StreamStdio: true,
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
// destroys an app
|
||||
@@ -56,19 +57,41 @@ func destroyApp(appName string) error {
|
||||
common.LogInfo1(fmt.Sprintf("Destroying %s (including all add-ons)", appName))
|
||||
|
||||
imageTag, _ := common.GetRunningImageTag(appName, "")
|
||||
if err := common.PlugnTrigger("pre-delete", []string{appName, imageTag}...); err != nil {
|
||||
_, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
|
||||
Trigger: "pre-delete",
|
||||
Args: []string{appName, imageTag},
|
||||
StreamStdio: true,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
scheduler := common.GetAppScheduler(appName)
|
||||
removeContainers := "true"
|
||||
if err := common.PlugnTrigger("scheduler-stop", []string{scheduler, appName, removeContainers}...); err != nil {
|
||||
_, err = common.CallPlugnTrigger(common.PlugnTriggerInput{
|
||||
Trigger: "scheduler-stop",
|
||||
Args: []string{scheduler, appName, removeContainers},
|
||||
StreamStdio: true,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := common.PlugnTrigger("scheduler-post-delete", []string{scheduler, appName, imageTag}...); err != nil {
|
||||
|
||||
_, err = common.CallPlugnTrigger(common.PlugnTriggerInput{
|
||||
Trigger: "scheduler-post-delete",
|
||||
Args: []string{scheduler, appName, imageTag},
|
||||
StreamStdio: true,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := common.PlugnTrigger("post-delete", []string{appName, imageTag}...); err != nil {
|
||||
|
||||
_, err = common.CallPlugnTrigger(common.PlugnTriggerInput{
|
||||
Trigger: "post-delete",
|
||||
Args: []string{appName, imageTag},
|
||||
StreamStdio: true,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -76,7 +99,12 @@ func destroyApp(appName string) error {
|
||||
common.DockerCleanup(appName, forceCleanup)
|
||||
|
||||
common.LogInfo1("Retiring old containers and images")
|
||||
if err := common.PlugnTrigger("scheduler-retire", []string{scheduler, appName}...); err != nil {
|
||||
_, err = common.CallPlugnTrigger(common.PlugnTriggerInput{
|
||||
Trigger: "scheduler-retire",
|
||||
Args: []string{scheduler, appName},
|
||||
StreamStdio: true,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,12 @@ func CommandClone(oldAppName string, newAppName string, skipDeploy bool, ignoreE
|
||||
return err
|
||||
}
|
||||
|
||||
if err := common.PlugnTrigger("post-app-clone-setup", []string{oldAppName, newAppName}...); err != nil {
|
||||
_, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
|
||||
Trigger: "post-app-clone-setup",
|
||||
Args: []string{oldAppName, newAppName},
|
||||
StreamStdio: true,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -48,15 +53,21 @@ func CommandClone(oldAppName string, newAppName string, skipDeploy bool, ignoreE
|
||||
os.Setenv("SKIP_REBUILD", "true")
|
||||
}
|
||||
|
||||
if err := common.PlugnTrigger("git-has-code", []string{newAppName}...); err != nil {
|
||||
_, err = common.CallPlugnTrigger(common.PlugnTriggerInput{
|
||||
Trigger: "git-has-code",
|
||||
Args: []string{newAppName},
|
||||
StreamStdio: true,
|
||||
})
|
||||
if err != nil {
|
||||
os.Setenv("SKIP_REBUILD", "true")
|
||||
}
|
||||
|
||||
if err := common.PlugnTrigger("post-app-clone", []string{oldAppName, newAppName}...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
_, err = common.CallPlugnTrigger(common.PlugnTriggerInput{
|
||||
Trigger: "post-app-clone",
|
||||
Args: []string{oldAppName, newAppName},
|
||||
StreamStdio: true,
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
// CommandCreate creates app via command line
|
||||
@@ -158,7 +169,12 @@ func CommandRename(oldAppName string, newAppName string, skipDeploy bool) error
|
||||
return err
|
||||
}
|
||||
|
||||
if err := common.PlugnTrigger("post-app-rename-setup", []string{oldAppName, newAppName}...); err != nil {
|
||||
_, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
|
||||
Trigger: "post-app-rename-setup",
|
||||
Args: []string{oldAppName, newAppName},
|
||||
StreamStdio: true,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -171,15 +187,21 @@ func CommandRename(oldAppName string, newAppName string, skipDeploy bool) error
|
||||
os.Setenv("SKIP_REBUILD", "true")
|
||||
}
|
||||
|
||||
if err := common.PlugnTrigger("git-has-code", []string{newAppName}...); err != nil {
|
||||
_, err = common.CallPlugnTrigger(common.PlugnTriggerInput{
|
||||
Trigger: "git-has-code",
|
||||
Args: []string{newAppName},
|
||||
StreamStdio: true,
|
||||
})
|
||||
if err != nil {
|
||||
os.Setenv("SKIP_REBUILD", "true")
|
||||
}
|
||||
|
||||
if err := common.PlugnTrigger("post-app-rename", []string{oldAppName, newAppName}...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
_, err = common.CallPlugnTrigger(common.PlugnTriggerInput{
|
||||
Trigger: "post-app-rename",
|
||||
Args: []string{oldAppName, newAppName},
|
||||
StreamStdio: true,
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
// CommandReport displays an app report for one or more apps
|
||||
|
||||
Reference in New Issue
Block a user