Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide a command deploy strategy? #330

Closed
jstrachan opened this issue Apr 4, 2018 · 4 comments
Closed

provide a command deploy strategy? #330

jstrachan opened this issue Apr 4, 2018 · 4 comments

Comments

@jstrachan
Copy link
Contributor

In Jenkins X we'd like to use different commands to deploy a skaffold built image, such as:

to make it easy for skaffold to trigger these more course grained operations than a kubectl apply or helm upgrade I wondered if we should have a Command based Deploy strategy.

So folks could do something like this in their skaffold.yaml:

apiVersion: skaffold/v1alpha2
kind: Config
build:
  artifacts:
  - imageName: gcr.io/k8s-skaffold/skaffold-example
    workspace: .
  local: {}
deploy:
  commands:
    - command: jx
       args:
       - promote 
       - --env
       - staging 
       - --app 
       - cheese 
       - --version 
       - $VERSION 

Then folks can easily extend skaffold with any particular higher order tools to do Previews, Promotion or GitOps etc

We could then just allow arbitrary commands to be invoked on a deploy (either when in incremental build mode for developing or inside CI / CD pipelines).

We may want to expose the image names + versions as environment variables for easy consumption by the commands - but other than that it should be easy to plugin any kind of command

@jstrachan
Copy link
Contributor Author

another option is a 'noop' option for deploy I guess.

For doing releases we can pass in the version used on the CLI so if a release pipeline wants to do deployments differently (e.g. via GitOps) then thats fine, we can use skaffold just for the docker build part.

@jstrachan
Copy link
Contributor Author

ah - ignore me! I've found that an empty manifests list works without failing the build:.

apiVersion: skaffold/v1alpha2
kind: Config
build:
  tagPolicy:
    envTemplate:
      template: "{{.MY_REGISTRY}}/{{.MY_USER}}/myimage"
  artifacts:
  - imageName: myimage
    workspace: .
  local: {}
deploy:
  kubectl:
    manifests:

@jstrachan jstrachan reopened this Apr 22, 2018
@jstrachan
Copy link
Contributor Author

reopening as it looks like the current strategy of using an empty manifests value fails if a base image has a port exposed
jenkins-x/jx#690

Another option is a NOOP deploy strategy - but I figure a Command strategy is more useful

@balopat
Copy link
Contributor

balopat commented Sep 4, 2019

I'm going to close this as we are tracking it on #2277.
Also skaffold build is now a thing :)

@balopat balopat closed this as completed Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants