mirror of
https://github.com/ipedrazas/drone-helm.git
synced 2026-06-04 18:24:13 +08:00
changing to a plugin package to allow reuse
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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,4 +1,4 @@
|
||||
package main
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user