diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..8b83b07 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,22 @@ +kind: pipeline +type: docker +name: default + + +steps: + - name: test + image: golang:1.13 + commands: + - go vet ./... + - name: build + image: golang:1.13 + commands: + - go build -o build/drone-helm cmd/drone-helm/main.go + - name: publish + image: plugins/docker + auto_tag: true + settings: + dockerfile: Dockerfile + registry: '192.168.0.17:5000' + repo: 192.168.0.17:5000/drone-helm3 + insecure: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6f10062 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM alpine/helm +MAINTAINER Erin Call + +COPY build/drone-helm /bin/drone-helm + +LABEL description="Helm 3 plugin for Drone 3" +LABEL base="alpine/helm" + +ENTRYPOINT [ "/bin/drone-helm" ] diff --git a/README.md b/README.md index 2b98298..e13e360 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ # Drone plugin for Helm 3 -TODO: useful information in this README +TODO: + +* [x] Make a `.drone.yml` that's sufficient for building an image +* [x] Make a `Dockerfile` that's sufficient for launching the built image +* [ ] Make `cmd/drone-helm/main.go` actually invoke `helm` +* [ ] Change `.drone.yml` to use a real docker registry diff --git a/cmd/drone-helm/.gitignore b/cmd/drone-helm/.gitignore new file mode 100644 index 0000000..edfeed8 --- /dev/null +++ b/cmd/drone-helm/.gitignore @@ -0,0 +1 @@ +drone-helm diff --git a/cmd/drone-helm/main.go b/cmd/drone-helm/main.go new file mode 100644 index 0000000..7df637c --- /dev/null +++ b/cmd/drone-helm/main.go @@ -0,0 +1,35 @@ +package main + +import ( + "fmt" + "os" + + "github.com/urfave/cli" +) + +func main() { + _ = fmt.Println + _ = os.Exit + + app := cli.NewApp() + app.Name = "helm plugin" + app.Usage = "helm plugin" + app.Action = run + app.Version = "0.0.1α" + app.Flags = []cli.Flag{ + cli.StringFlag{ + Name: "echo, e", + Usage: "this text'll be ech'll", + EnvVar: "ECHO", + }, + } + + if err := app.Run(os.Args); err != nil { + fmt.Fprintf(os.Stderr, "%s\n", err.Error()) + } +} + +func run(c *cli.Context) error { + fmt.Println(c.String("echo")) + return nil +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..0368153 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/pelotech/drone-helm3 + +go 1.13 + +require github.com/urfave/cli v1.22.0 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..e2599a4 --- /dev/null +++ b/go.sum @@ -0,0 +1,9 @@ +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/urfave/cli v1.22.0 h1:8nz/RUUotroXnOpYzT/Fy3sBp+2XEbXaY641/s3nbFI= +github.com/urfave/cli v1.22.0/go.mod h1:b3D7uWrF2GilkNgYpgcg6J+JMUw7ehmNkE8sZdliGLc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=