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:
Jose Diaz-Gonzalez
2026-04-25 05:02:19 -04:00
parent c3db713c27
commit aa45f748b1
2 changed files with 12 additions and 0 deletions

View File

@@ -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())
}