2 Commits

Author SHA1 Message Date
danielgormly 5afd783cc1 Updated version number in plugin 2020-02-20 17:51:00 +11:00
danielgormly cdf38eea63 Readme 2020-02-20 12:51:20 +11:00
2 changed files with 4 additions and 14 deletions
+3 -13
View File
@@ -2,24 +2,14 @@
[![](https://images.microbadger.com/badges/version/danielgormly/drone-plugin-kube.svg)](https://microbadger.com/images/danielgormly/drone-plugin-kube "Get your own version badge on microbadger.com")
A simple Drone plugin for updating Kubernetes resources from yaml templates. Follows from [vallard/drone-kube](https://github.com/vallard/drone-kube). The plugin will create a plugin if it doesn't already exist.
This plugin supports deployments, configmaps, ingresses, and services.
A simple Drone plugin for updating Kubernetes resources from yaml templates. Follows from [vallard/drone-kube](https://github.com/vallard/drone-kube). The plugin will create a resource if it doesn't already exist i.e. behaves similar to `kubectl apply`. This plugin supports deployments, configmaps, ingresses, and services.
Usage: See [drone.md](./drone.md)
## Deployment, service, ingress templates
Deployment config files are first interpreted by **aymerick/raymond** ([handlebarsjs](http://handlebarsjs.com/) equivalent). You can use all available raymond expressions and anything you put in settings will be made available in your deployment template e.g. `{{namespace}}`. See [example/deployment.template.yaml](/example/deployment.template.yaml) for a complete example.
## Config maps from files
In this case, you can create a template just like deployment.yaml but you can provide a file path (relative to the repo's root) in the plugin setting `configmap_file`. (Currently only accepts utf-8 encoded data). Like deployments, this will both create new or update existing configmaps (based on the configmap name).
#### Adding a service account to Kubernetes that can manage deployments
#### Creating a Kubernetes service account for Drone
See [example/Role.yaml](example/Role.yaml), [example/ServiceAccount.yaml](example/ServiceAccount.yaml), [example/RoleBinding.yaml](example/RoleBinding.yaml).
## Notes:
## Usage notes:
- The watching process is not currently reliable i.e. it doesn't properly wait for new deployments to become live. Not entirely sure how this should behave but I think behind a flag would make sense. PRs welcome.
+1 -1
View File
@@ -19,7 +19,7 @@ func main() {
},
}
fmt.Printf(os.Getenv("PLUGIN_SKIP_TLS"))
fmt.Println("danielgormly/drone-plugin-kube@0.0.2 https://github.com/danielgormly/drone-plugin-kube")
fmt.Println("danielgormly/drone-plugin-kube@0.1.0 https://github.com/danielgormly/drone-plugin-kube")
err := plugin.Exec()
if err != nil {
log.Fatalf("⛔️ Fatal error: \n%s", err)