Skip to content

hooks: implement for helm and kustomize deployers #6454

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

Merged
merged 4 commits into from
Aug 23, 2021

Conversation

gsquared94
Copy link
Contributor

Fixes: #6420
Related: #1441

Description

This PR implements lifecycle hooks for helm and kustomize deployers.

User facing changes (remove if N/A)

Users can specify hooks definition for helm or kustomize deployers

deploy:
  helm:
    releases:
    - name: skaffold-helm
      chartPath: skaffold-helm
      artifactOverrides:
        image: gcr.io/k8s-skaffold/skaffold-helm
    hooks:
      before:
        - host:
            command: ["sh", "-c", "echo pre-deploy host hook running on $(hostname)!"]
            os: [darwin, linux]
      after:
        - container:
            command: ["sh", "-c", "echo post-deploy container hook running on $(hostname)!"]
            containerName: skaffold-helm*
            podName: skaffold-helm*

@gsquared94 gsquared94 requested a review from a team as a code owner August 18, 2021 06:51
@google-cla google-cla bot added the cla: yes label Aug 18, 2021
@codecov
Copy link

codecov bot commented Aug 18, 2021

Codecov Report

Merging #6454 (8bcd0e1) into main (7d7de48) will increase coverage by 0.02%.
The diff coverage is 95.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6454      +/-   ##
==========================================
+ Coverage   70.29%   70.32%   +0.02%     
==========================================
  Files         510      511       +1     
  Lines       22976    23020      +44     
==========================================
+ Hits        16152    16189      +37     
- Misses       5769     5773       +4     
- Partials     1055     1058       +3     
Impacted Files Coverage Δ
pkg/skaffold/schema/latest/v1/config.go 62.16% <ø> (ø)
pkg/skaffold/hooks/types.go 75.00% <75.00%> (ø)
pkg/skaffold/deploy/helm/deploy.go 77.91% <100.00%> (+1.09%) ⬆️
pkg/skaffold/deploy/kubectl/kubectl.go 64.07% <100.00%> (ø)
pkg/skaffold/deploy/kustomize/kustomize.go 74.51% <100.00%> (+1.98%) ⬆️
pkg/skaffold/hooks/deploy.go 85.71% <100.00%> (ø)
pkg/skaffold/runner/v1/deploy.go 72.22% <0.00%> (-2.07%) ⬇️
pkg/skaffold/docker/image.go 65.56% <0.00%> (-1.00%) ⬇️
cmd/skaffold/app/cmd/flags.go 90.81% <0.00%> (ø)
pkg/skaffold/config/options.go 100.00% <0.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d7de48...8bcd0e1. Read the comment docs.

Copy link
Contributor

@MarlonGamez MarlonGamez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏼

@gsquared94 gsquared94 merged commit 9327776 into GoogleContainerTools:main Aug 23, 2021
@glennpratt
Copy link
Contributor

@gsquared94 it appears 9327776 broke some Travis-CI stages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deployment hooks when Helm is used
3 participants