mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Without this, we'd need to duplicate some logic or make it more complex via a plugin trigger.
50 lines
1.1 KiB
Go
50 lines
1.1 KiB
Go
package common
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
// TriggerAppList outputs each app name to stdout on a newline
|
|
func TriggerAppList() error {
|
|
apps, _ := DokkuApps()
|
|
for _, app := range apps {
|
|
Log(app)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// TriggerCorePostDeploy associates the container with a specified network
|
|
func TriggerCorePostDeploy(appName string) error {
|
|
quiet := os.Getenv("DOKKU_QUIET_OUTPUT")
|
|
os.Setenv("DOKKU_QUIET_OUTPUT", "1")
|
|
CommandPropertySet("common", appName, "deployed", "true", DefaultProperties, GlobalProperties)
|
|
os.Setenv("DOKKU_QUIET_OUTPUT", quiet)
|
|
return nil
|
|
}
|
|
|
|
// TriggerInstall runs the install step for the common plugin
|
|
func TriggerInstall() error {
|
|
if err := PropertySetup("common"); err != nil {
|
|
return fmt.Errorf("Unable to install the common plugin: %s", err.Error())
|
|
}
|
|
|
|
apps, err := DokkuApps()
|
|
if err != nil {
|
|
return nil
|
|
}
|
|
|
|
// migrate all is-deployed values from trigger to property
|
|
for _, appName := range apps {
|
|
IsDeployed(appName)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// TriggerPostDelete destroys the common property for a given app container
|
|
func TriggerPostDelete(appName string) error {
|
|
return PropertyDestroy("common", appName)
|
|
}
|