mirror of
https://github.com/ipedrazas/drone-helm.git
synced 2026-06-04 18:24:13 +08:00
make plugin a package
so that it can be used/imported by other things
This commit is contained in:
@@ -4,6 +4,8 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/ipedrazas/drone-helm/plugin"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/joho/godotenv"
|
||||
"github.com/urfave/cli"
|
||||
@@ -139,8 +141,8 @@ func run(c *cli.Context) error {
|
||||
if c.String("env-file") != "" {
|
||||
_ = godotenv.Load(c.String("env-file"))
|
||||
}
|
||||
plugin := Plugin{
|
||||
Config: Config{
|
||||
p := plugin.Plugin{
|
||||
Config: plugin.Config{
|
||||
APIServer: c.String("api_server"),
|
||||
Token: c.String("token"),
|
||||
ServiceAccount: c.String("service-account"),
|
||||
@@ -169,5 +171,5 @@ func run(c *cli.Context) error {
|
||||
Force: c.Bool("force"),
|
||||
},
|
||||
}
|
||||
return plugin.Exec()
|
||||
return p.Exec()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -22,7 +22,7 @@ func TestInitialiseKubeconfig(t *testing.T) {
|
||||
}
|
||||
|
||||
configfile := "config3.test"
|
||||
initialiseKubeconfig(&plugin.Config, "kubeconfig", configfile)
|
||||
initialiseKubeconfig(&plugin.Config, "../kubeconfig", configfile)
|
||||
data, err := ioutil.ReadFile(configfile)
|
||||
if err != nil {
|
||||
t.Errorf("Error reading file %v", err)
|
||||
Reference in New Issue
Block a user