fix: create DOKKU_ROOT app dir in Go tests and set global ENV permissions
- config_test.go: create app dir at DOKKU_ROOT for VerifyAppName and ensure global config parent directory exists - migrateGlobalEnv: set dokku:dokku ownership on global ENV file after writing so deploy processes running as dokku can read it
This commit is contained in:
@@ -103,6 +103,13 @@ func migrateGlobalEnv() error {
|
||||
return fmt.Errorf("Unable to write global environment: %s", err.Error())
|
||||
}
|
||||
|
||||
if err := common.SetPermissions(common.SetPermissionInput{
|
||||
Filename: globalEnv.Filename(),
|
||||
Mode: os.FileMode(0600),
|
||||
}); err != nil {
|
||||
return fmt.Errorf("Unable to set permissions on global environment: %s", err.Error())
|
||||
}
|
||||
|
||||
if err := common.PropertyWrite("config", "--global", "env-migrated", "true"); err != nil {
|
||||
return fmt.Errorf("Unable to set env-migrated property: %s", err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user