From 1769acb93bcadee3a1e4447879496492aff2b7ff Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Tue, 12 Jan 2021 11:45:24 +0000 Subject: [PATCH 01/21] Troubleshooting pre-commit command --- .travis.pre-commit.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.pre-commit.yml b/.travis.pre-commit.yml index b1065ff47..00e1fca0a 100644 --- a/.travis.pre-commit.yml +++ b/.travis.pre-commit.yml @@ -9,4 +9,6 @@ jobs: language: python python: 3.8 install: curl https://pre-commit.com/install-local.py | python3 - - script: pre-commit run --all-files + script: + - pre-commit run --all-files -v + - cat /home/travis/.cache/pre-commit/pre-commit.log From 80861006cca4ae706213a563bb0f357ce99824cc Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Tue, 12 Jan 2021 12:37:01 +0000 Subject: [PATCH 02/21] Add verbose to checkov hook --- .pre-commit-hooks.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index da15b484d..9bf4ce9fa 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -52,3 +52,5 @@ entry: bash -c "find . -name Chart.yaml" | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % > %.yaml && checkov -f %.yaml --framework kubernetes" || true # allowed to fail language: system pass_filenames: false + verbose: true + From cd1a2f5ef79a99ce09f5f806b3b80174f4438ca2 Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Tue, 12 Jan 2021 12:54:13 +0000 Subject: [PATCH 03/21] Try wrapping checkov command in single quotes --- .pre-commit-hooks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 9bf4ce9fa..1b8dac5a0 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -49,7 +49,7 @@ pass_filenames: false - id: checkov-helm name: Checkov - Helm check - entry: bash -c "find . -name Chart.yaml" | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % > %.yaml && checkov -f %.yaml --framework kubernetes" || true # allowed to fail + entry: 'bash -c "find . -name Chart.yaml" | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % > %.yaml && checkov -f %.yaml --framework kubernetes" || true' # allowed to fail language: system pass_filenames: false verbose: true From 83e42d219254f1e9e5ddc96defbfdc2ab7206669 Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Tue, 12 Jan 2021 14:45:34 +0000 Subject: [PATCH 04/21] Added debugging --- .travis.pre-commit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.pre-commit.yml b/.travis.pre-commit.yml index 00e1fca0a..d3e58f396 100644 --- a/.travis.pre-commit.yml +++ b/.travis.pre-commit.yml @@ -10,5 +10,6 @@ jobs: python: 3.8 install: curl https://pre-commit.com/install-local.py | python3 - script: + - export LOG_LEVEL=DEBUG - pre-commit run --all-files -v - cat /home/travis/.cache/pre-commit/pre-commit.log From d4e030465c7daffb57e02fb616905a36b9937d7f Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Wed, 13 Jan 2021 10:32:35 +0000 Subject: [PATCH 05/21] Tweak checkov command --- .pre-commit-hooks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 1b8dac5a0..4cedd67c0 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -49,7 +49,7 @@ pass_filenames: false - id: checkov-helm name: Checkov - Helm check - entry: 'bash -c "find . -name Chart.yaml" | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % > %.yaml && checkov -f %.yaml --framework kubernetes" || true' # allowed to fail + entry: bash -c "find . -name Chart.yaml" | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % > %.yaml && checkov -f %.yaml --framework kubernetes" language: system pass_filenames: false verbose: true From 8a6a6d53db7171abdb4e58468c8e575e63d664ec Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Wed, 13 Jan 2021 10:42:42 +0000 Subject: [PATCH 06/21] change script back to single line --- .travis.pre-commit.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.pre-commit.yml b/.travis.pre-commit.yml index d3e58f396..b0e009400 100644 --- a/.travis.pre-commit.yml +++ b/.travis.pre-commit.yml @@ -9,7 +9,4 @@ jobs: language: python python: 3.8 install: curl https://pre-commit.com/install-local.py | python3 - - script: - - export LOG_LEVEL=DEBUG - - pre-commit run --all-files -v - - cat /home/travis/.cache/pre-commit/pre-commit.log + script: pre-commit run --all-files && cat /home/travis/.cache/pre-commit/pre-commit.log From ef86356eccf4cef609f7353a1f64222b5ee8dc4c Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Wed, 13 Jan 2021 10:55:03 +0000 Subject: [PATCH 07/21] Use simpler checkov command --- .pre-commit-hooks.yaml | 3 +-- .travis.pre-commit.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 4cedd67c0..b3869dd98 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -49,8 +49,7 @@ pass_filenames: false - id: checkov-helm name: Checkov - Helm check - entry: bash -c "find . -name Chart.yaml" | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % > %.yaml && checkov -f %.yaml --framework kubernetes" + entry: env LOG_LEVEL=DEBUG checkov -f ./helm/alfresco-content-services/Chart.yaml --framework kubernetes language: system pass_filenames: false verbose: true - diff --git a/.travis.pre-commit.yml b/.travis.pre-commit.yml index b0e009400..b1065ff47 100644 --- a/.travis.pre-commit.yml +++ b/.travis.pre-commit.yml @@ -9,4 +9,4 @@ jobs: language: python python: 3.8 install: curl https://pre-commit.com/install-local.py | python3 - - script: pre-commit run --all-files && cat /home/travis/.cache/pre-commit/pre-commit.log + script: pre-commit run --all-files From ec28be17c12323bafedb1c3e651d98a0b9e5e2e2 Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Wed, 13 Jan 2021 13:19:18 +0000 Subject: [PATCH 08/21] add verbose mode back --- .travis.pre-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.pre-commit.yml b/.travis.pre-commit.yml index b1065ff47..51f537146 100644 --- a/.travis.pre-commit.yml +++ b/.travis.pre-commit.yml @@ -9,4 +9,4 @@ jobs: language: python python: 3.8 install: curl https://pre-commit.com/install-local.py | python3 - - script: pre-commit run --all-files + script: pre-commit run --all-files -v From 9a302e6e2698b1b832934146e9f111613384a561 Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Wed, 13 Jan 2021 13:48:04 +0000 Subject: [PATCH 09/21] Revert checkov entry cmd --- .pre-commit-hooks.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index b3869dd98..da15b484d 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -49,7 +49,6 @@ pass_filenames: false - id: checkov-helm name: Checkov - Helm check - entry: env LOG_LEVEL=DEBUG checkov -f ./helm/alfresco-content-services/Chart.yaml --framework kubernetes + entry: bash -c "find . -name Chart.yaml" | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % > %.yaml && checkov -f %.yaml --framework kubernetes" || true # allowed to fail language: system pass_filenames: false - verbose: true From 6020568f3371be24fd3044e6f1885c8e596e4b47 Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Wed, 13 Jan 2021 14:07:09 +0000 Subject: [PATCH 10/21] Disable caching --- .travis.pre-commit.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.pre-commit.yml b/.travis.pre-commit.yml index 51f537146..83f1d84e3 100644 --- a/.travis.pre-commit.yml +++ b/.travis.pre-commit.yml @@ -1,7 +1,7 @@ -cache: - directories: - - $HOME/.cache/pip - - $HOME/.cache/pre-commit +# cache: +# directories: +# - $HOME/.cache/pip +# - $HOME/.cache/pre-commit jobs: include: - name: pre-commit From 7eab6b0957d035caa612aeab0d4a66dc37fec97b Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Thu, 14 Jan 2021 19:02:22 +0000 Subject: [PATCH 11/21] Remove verbose option from pre-commit command --- .travis.pre-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.pre-commit.yml b/.travis.pre-commit.yml index 83f1d84e3..8f142efb8 100644 --- a/.travis.pre-commit.yml +++ b/.travis.pre-commit.yml @@ -9,4 +9,4 @@ jobs: language: python python: 3.8 install: curl https://pre-commit.com/install-local.py | python3 - - script: pre-commit run --all-files -v + script: pre-commit run --all-files From b5fd6d5215f794469b7ff3121dba0fa9b2961e54 Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Fri, 15 Jan 2021 11:17:05 +0000 Subject: [PATCH 12/21] Re-enable caching for pip and enable verbose mode for pre-commit --- .pre-commit-hooks.yaml | 2 +- .travis.pre-commit.yml | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index da15b484d..57a0425e2 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -49,6 +49,6 @@ pass_filenames: false - id: checkov-helm name: Checkov - Helm check - entry: bash -c "find . -name Chart.yaml" | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % > %.yaml && checkov -f %.yaml --framework kubernetes" || true # allowed to fail + entry: echo "Hello from the checkov pre-commit hook" language: system pass_filenames: false diff --git a/.travis.pre-commit.yml b/.travis.pre-commit.yml index 8f142efb8..36c08e718 100644 --- a/.travis.pre-commit.yml +++ b/.travis.pre-commit.yml @@ -1,7 +1,7 @@ -# cache: -# directories: -# - $HOME/.cache/pip -# - $HOME/.cache/pre-commit +cache: + directories: + - $HOME/.cache/pip + # - $HOME/.cache/pre-commit jobs: include: - name: pre-commit @@ -9,4 +9,6 @@ jobs: language: python python: 3.8 install: curl https://pre-commit.com/install-local.py | python3 - - script: pre-commit run --all-files + script: + - ls /home/travis/.cache/pre-commit + - pre-commit run --all-files -v From 355535499907d1bc51dff8fc108636ca0e9e1cfa Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Fri, 15 Jan 2021 11:30:44 +0000 Subject: [PATCH 13/21] Update checkov command --- .pre-commit-hooks.yaml | 2 +- .travis.pre-commit.yml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 57a0425e2..77cedd619 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -49,6 +49,6 @@ pass_filenames: false - id: checkov-helm name: Checkov - Helm check - entry: echo "Hello from the checkov pre-commit hook" + entry: echo "Hello" | echo "World" language: system pass_filenames: false diff --git a/.travis.pre-commit.yml b/.travis.pre-commit.yml index 36c08e718..b3a740adb 100644 --- a/.travis.pre-commit.yml +++ b/.travis.pre-commit.yml @@ -9,6 +9,4 @@ jobs: language: python python: 3.8 install: curl https://pre-commit.com/install-local.py | python3 - - script: - - ls /home/travis/.cache/pre-commit - - pre-commit run --all-files -v + script: pre-commit run --all-files -v From 31995b52436f8191fb71008326daec9dc4088fda Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Fri, 15 Jan 2021 12:02:48 +0000 Subject: [PATCH 14/21] Try using separate script --- .pre-commit-hooks.yaml | 2 +- scripts/.pre-commit-hook-checkov-helm.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100755 scripts/.pre-commit-hook-checkov-helm.sh diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 77cedd619..c9941e70d 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -49,6 +49,6 @@ pass_filenames: false - id: checkov-helm name: Checkov - Helm check - entry: echo "Hello" | echo "World" + entry: ./scripts/.pre-commit-hook-checkov-helm.sh language: system pass_filenames: false diff --git a/scripts/.pre-commit-hook-checkov-helm.sh b/scripts/.pre-commit-hook-checkov-helm.sh new file mode 100755 index 000000000..c9b181e7f --- /dev/null +++ b/scripts/.pre-commit-hook-checkov-helm.sh @@ -0,0 +1 @@ +find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % > %.yaml && checkov -f %.yaml --framework kubernetes" \ No newline at end of file From 9e99ab1b93265bc9afd7ba3371ddda06d5783eff Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Fri, 15 Jan 2021 12:45:05 +0000 Subject: [PATCH 15/21] Revert script approach --- .pre-commit-hooks.yaml | 2 +- scripts/.pre-commit-hook-checkov-helm.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100755 scripts/.pre-commit-hook-checkov-helm.sh diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index c9941e70d..027fa3905 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -49,6 +49,6 @@ pass_filenames: false - id: checkov-helm name: Checkov - Helm check - entry: ./scripts/.pre-commit-hook-checkov-helm.sh + entry: bash -c 'echo "Hello" | echo "World"' language: system pass_filenames: false diff --git a/scripts/.pre-commit-hook-checkov-helm.sh b/scripts/.pre-commit-hook-checkov-helm.sh deleted file mode 100755 index c9b181e7f..000000000 --- a/scripts/.pre-commit-hook-checkov-helm.sh +++ /dev/null @@ -1 +0,0 @@ -find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % > %.yaml && checkov -f %.yaml --framework kubernetes" \ No newline at end of file From 877651ce4ac1f48bc55b34f486e345d4ce5e8033 Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Fri, 15 Jan 2021 12:48:55 +0000 Subject: [PATCH 16/21] Try wrapping in single quotes --- .pre-commit-hooks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 027fa3905..8070d448f 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -49,6 +49,6 @@ pass_filenames: false - id: checkov-helm name: Checkov - Helm check - entry: bash -c 'echo "Hello" | echo "World"' + entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % > %.yaml && checkov -f %.yaml --framework kubernetes"' language: system pass_filenames: false From 6ffd16f46604a17b77b0c637f0c3902593508f1a Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Fri, 15 Jan 2021 12:54:33 +0000 Subject: [PATCH 17/21] Wrap all bash commands --- .pre-commit-hooks.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 8070d448f..f6d23e733 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -5,38 +5,38 @@ files: \.travis.*\.y(a?)ml$ - id: helm-deps name: Helm Dependency Update - entry: bash -c 'find . -name Chart.yaml' | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% helm dep up % + entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% helm dep up %' language: system pass_filenames: false - id: helm-lint name: Helm Lint - entry: bash -c "find . -name Chart.yaml" | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% helm lint % + entry: bash -c 'find . -name Chart.yaml' | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% helm lint %' language: system pass_filenames: false - id: kubepug-minimum name: KubePug - k8s v1.15 minimum - entry: bash -c "find . -name Chart.yaml" | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% env K8S_TARGET_VERSION=v1.15.0 bash -c 'helm template % --api-versions $K8S_TARGET_VERSION | kubepug --error-on-deleted --k8s-version $K8S_TARGET_VERSION' + entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% env K8S_TARGET_VERSION=v1.15.0 bash -c "helm template % --api-versions $K8S_TARGET_VERSION | kubepug --error-on-deleted --k8s-version $K8S_TARGET_VERSION"' language: system pass_filenames: false - id: kubepug-recommended name: KubePug - k8s v1.18 recommended - entry: bash -c "find . -name Chart.yaml" | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% env K8S_TARGET_VERSION=v1.18.0 bash -c 'helm template % --api-versions $K8S_TARGET_VERSION | kubepug --error-on-deleted --k8s-version $K8S_TARGET_VERSION' + entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% env K8S_TARGET_VERSION=v1.18.0 bash -c "helm template % --api-versions $K8S_TARGET_VERSION | kubepug --error-on-deleted --k8s-version $K8S_TARGET_VERSION"' language: system pass_filenames: false - id: kubepug-latest name: KubePug - k8s latest - entry: bash -c "find . -name Chart.yaml" | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % | kubepug --error-on-deleted" || true # allowed to fail + entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % | kubepug --error-on-deleted"' language: system pass_filenames: false - id: plantuml-svg name: PlantUML SVG converter - entry: bash -c "for FILE in $@; do cat $FILE | docker run --rm -i think/plantuml > ${FILE%.*}.svg; done" + entry: bash -c 'for FILE in $@; do cat $FILE | docker run --rm -i think/plantuml > ${FILE%.*}.svg; done' language: system types: [file] files: \.puml$ - id: plantuml-png name: PlantUML PNG converter - entry: bash -c "for FILE in $@; do cat $FILE | docker run --rm -i think/plantuml -tpng > ${FILE%.*}.png; done" + entry: bash -c 'for FILE in $@; do cat $FILE | docker run --rm -i think/plantuml -tpng > ${FILE%.*}.png; done' language: system types: [file] files: \.puml$ From f3a68968a9874f86a79c728f4596501dfecf179e Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Fri, 15 Jan 2021 12:57:15 +0000 Subject: [PATCH 18/21] Fix typo --- .pre-commit-hooks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index f6d23e733..5f56f66fb 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -10,7 +10,7 @@ pass_filenames: false - id: helm-lint name: Helm Lint - entry: bash -c 'find . -name Chart.yaml' | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% helm lint %' + entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% helm lint %' language: system pass_filenames: false - id: kubepug-minimum From 65c395ddf0ab508d133ce2258fe948c8cea7923b Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Fri, 15 Jan 2021 14:36:28 +0000 Subject: [PATCH 19/21] Pass API version directly --- .pre-commit-hooks.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 5f56f66fb..b681198fd 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -15,12 +15,12 @@ pass_filenames: false - id: kubepug-minimum name: KubePug - k8s v1.15 minimum - entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% env K8S_TARGET_VERSION=v1.15.0 bash -c "helm template % --api-versions $K8S_TARGET_VERSION | kubepug --error-on-deleted --k8s-version $K8S_TARGET_VERSION"' + entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % --api-versions v1.15.0 | kubepug --error-on-deleted --k8s-version v1.15.0"' language: system pass_filenames: false - id: kubepug-recommended name: KubePug - k8s v1.18 recommended - entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% env K8S_TARGET_VERSION=v1.18.0 bash -c "helm template % --api-versions $K8S_TARGET_VERSION | kubepug --error-on-deleted --k8s-version $K8S_TARGET_VERSION"' + entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % --api-versions v1.18.0 | kubepug --error-on-deleted --k8s-version v1.18.0"' language: system pass_filenames: false - id: kubepug-latest From 248ed666eeed61f767cb9273d297cf4f5de8bc4b Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Fri, 15 Jan 2021 16:27:50 +0000 Subject: [PATCH 20/21] Update kubepug commands to use stdin rather than checking running cluster --- .pre-commit-hooks.yaml | 6 +++--- .travis.pre-commit.yml | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index b681198fd..84a4fe465 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -15,17 +15,17 @@ pass_filenames: false - id: kubepug-minimum name: KubePug - k8s v1.15 minimum - entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % --api-versions v1.15.0 | kubepug --error-on-deleted --k8s-version v1.15.0"' + entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % --api-versions v1.15.0 | kubepug --error-on-deprecated --error-on-deleted --k8s-version v1.15.0 --input-file /dev/stdin"' language: system pass_filenames: false - id: kubepug-recommended name: KubePug - k8s v1.18 recommended - entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % --api-versions v1.18.0 | kubepug --error-on-deleted --k8s-version v1.18.0"' + entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % --api-versions v1.18.0 | kubepug --error-on-deprecated --error-on-deleted --k8s-version v1.18.0 --input-file /dev/stdin"' language: system pass_filenames: false - id: kubepug-latest name: KubePug - k8s latest - entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % | kubepug --error-on-deleted"' + entry: bash -c 'find . -name Chart.yaml | xargs -n1 -I% bash -c "dirname %" | xargs -t -n1 -I% bash -c "helm template % | kubepug --error-on-deprecated --error-on-deleted --input-file /dev/stdin"' language: system pass_filenames: false - id: plantuml-svg diff --git a/.travis.pre-commit.yml b/.travis.pre-commit.yml index b3a740adb..ef674c13e 100644 --- a/.travis.pre-commit.yml +++ b/.travis.pre-commit.yml @@ -1,7 +1,6 @@ cache: directories: - $HOME/.cache/pip - # - $HOME/.cache/pre-commit jobs: include: - name: pre-commit @@ -9,4 +8,6 @@ jobs: language: python python: 3.8 install: curl https://pre-commit.com/install-local.py | python3 - - script: pre-commit run --all-files -v + script: + - rm -rf ~/.cache/pre-commit + - pre-commit run --all-files From a6d578626cd6fc963f28c511a547e0d23f3ded96 Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Mon, 18 Jan 2021 16:31:29 +0000 Subject: [PATCH 21/21] Revert the changes to caching behaviour --- .travis.pre-commit.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.pre-commit.yml b/.travis.pre-commit.yml index ef674c13e..b1065ff47 100644 --- a/.travis.pre-commit.yml +++ b/.travis.pre-commit.yml @@ -1,6 +1,7 @@ cache: directories: - $HOME/.cache/pip + - $HOME/.cache/pre-commit jobs: include: - name: pre-commit @@ -8,6 +9,4 @@ jobs: language: python python: 3.8 install: curl https://pre-commit.com/install-local.py | python3 - - script: - - rm -rf ~/.cache/pre-commit - - pre-commit run --all-files + script: pre-commit run --all-files