changing to a plugin package to allow reuse

This commit is contained in:
Joachim Hill-Grannec
2018-08-02 14:51:10 +02:00
parent 008f2a1cb8
commit d77c4cde47
4 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ pipeline:
image: golang:1.10
commands:
- go vet
- go test -cover -coverprofile=coverage.out
- go test ./... -cover -coverprofile=coverage.out
build_linux_amd64:
image: golang:1.10
+5 -5
View File
@@ -2,11 +2,11 @@ package main
import (
"fmt"
"os"
"github.com/Sirupsen/logrus"
"github.com/joho/godotenv"
"github.com/josmo/drone-helm/plugin"
"github.com/urfave/cli"
"os"
)
var build = "0" // build number set at compile-time
@@ -149,8 +149,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"),
Certificate: c.String("certificate"),
@@ -181,5 +181,5 @@ func run(c *cli.Context) error {
UpdateDependencies: c.Bool("update-dependencies"),
},
}
return plugin.Exec()
return p.Exec()
}
+1 -1
View File
@@ -1,4 +1,4 @@
package main
package plugin
import (
"fmt"
+2 -2
View File
@@ -1,4 +1,4 @@
package main
package plugin
import (
"fmt"
@@ -23,7 +23,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)