Add --auto-trigger option to kev dev with Skaffold#352
Conversation
ezodude
left a comment
There was a problem hiding this comment.
The code looks fine and makes sense 👍
But, here are my 2 pennies ...
Is there a better way of surfacing --auto-trigger - even make it the default behaviour?
Looking at all the new extra flags, it feels like they complicate how the --skaffold option can be used.
Running kev dev --help presents the below ... which is quite a lot to grok and use.
$ kev dev --help
(dev) Continuous reconcile and re-render of K8s manifests with optional project build, push and deploy (using --skaffold).
Examples:
### Run Kev in dev mode
$ kev dev
### Use a custom directory to render manifests
$ kev dev -d my-manifests
### Activate the Skaffold dev loop to build, push and deploy your project
$ kev dev --skaffold
### Activate the Skaffold dev loop to build, push and deploy your project to a particular namespace
$ kev dev --skaffold --namespace myspace
### Activate the Skaffold dev loop to build, push and deploy your project using a specific kubecontext
$ kev dev --skaffold --namespace myspace --kubecontext mycontext
### Activate the Skaffold dev loop to build, push and deploy your project and tail deployed app logs
$ kev dev --skaffold --tail
### Activate the Skaffold dev loop to build, push and deploy your project "staging" configuration
$ kev dev --skaffold --kev-env staging
### Activate the Skaffold dev loop to build, push and deploy your project automatically on every code change
$ kev dev --skaffold --auto-trigger
Usage:
kev dev [flags]
Flags:
-f, --format string Deployment files format. Default: Kubernetes manifests. (default "kubernetes")
-s, --single Controls whether to produce individual manifests or a single file output. Default: false
-d, --dir string Override default Kubernetes manifests output directory. Default: k8s/<env>
--skaffold [Experimental] Activates Skaffold dev loop.
-n, --namespace string [Experimental] Kubernetes namespaces to which Skaffold dev deploys the application. (default "default")
-k, --kubecontext string [Experimental] Kubernetes context to be used by Skaffold dev.
--kev-env string [Experimental] Kev environment that will be deployed by Skaffold. If not specified it'll use the sandbox dev env. (default "dev")
-t, --tail [Experimental] Enable Skaffold deployed application log tailing.
-a, --auto-trigger [Experimental] Enable Skaffold to automatically trigger build/push/deploy on each application source code change. Defaults to 'manual' trigger.
-h, --help help for dev|
@ezodude these are just a few different use examples. As for making |
…ill allow users to manually trigger build/push/deploy after series of source code changes.
92efb1a to
19c2a69
Compare
Addresses #344
This PR adds additional command line flag specific to
kev devwith --skaffold flow enabled.By default
kev devwill build/push/deploy first time and then wait for user input (in a form of ENTER button) to trigger another build/push/deploy iteration. It's the default to prevent unnecessary avalanche of rebuilds and deploys happening on each source code change.In order to enable automatic build/push/deploy on each project source code change user must specify
--auto-triggerflag.