Update plugin directory check for ci (#11253)

* Update plugin directory check for ci

On CIRCLECI the default plugin direction is under `$HOME/.config/packer`
this changes updates the acctest just a bit to check if we are running
in a CIRCLECI env.

* Apply same logic to cleanup step
pull/11254/head
Wilken Rivera 5 years ago committed by GitHub
parent 079a680492
commit 6d0d5c89f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -85,6 +85,17 @@ func cleanupPluginInstallation(plugin addrs.Plugin) error {
plugin.Hostname,
plugin.Namespace,
plugin.Type)
if _, ok := os.LookupEnv("CIRCLECI"); ok {
pluginPath = filepath.Join(home,
".config",
"packer",
"plugins",
plugin.Hostname,
plugin.Namespace,
plugin.Type)
}
testutils.CleanupFiles(pluginPath)
return nil
}
@ -99,12 +110,24 @@ func checkPluginInstallation(initOutput string, plugin addrs.Plugin) error {
if err != nil {
return err
}
pluginPath := filepath.Join(home,
".packer.d",
"plugins",
plugin.Hostname,
plugin.Namespace,
plugin.Type)
if _, ok := os.LookupEnv("CIRCLECI"); ok {
pluginPath = filepath.Join(home,
".config",
"packer",
"plugins",
plugin.Hostname,
plugin.Namespace,
plugin.Type)
}
if !testutils.FileExists(pluginPath) {
return fmt.Errorf("%s plugin installation not found", plugin.String())
}

Loading…
Cancel
Save