From bae73123bcce7cdd41e48ffc7420fce62cb7fc58 Mon Sep 17 00:00:00 2001 From: oktetobot Date: Wed, 9 Apr 2025 14:37:35 +0000 Subject: [PATCH 1/4] Optimize deploy commands by ignoring all files and enabling remote execution --- .oktetoignore | 61 ++++++++++++++++++++++++++++++--------------------- okteto.yml | 2 +- 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/.oktetoignore b/.oktetoignore index 152f6e5b6c65..6db0a386a415 100644 --- a/.oktetoignore +++ b/.oktetoignore @@ -1,26 +1,37 @@ -/bin -/docs -/integration -/.circleci -/.git -/.github -/.vscode -/artifacts -/images -/samples -/.codecov.yml -/.copyright-header.tmpl -/.deepsource.toml -/.DEREK.yml -/.editorconfig -/.gitignore -/.golangci.yml +# Global ignores (applied to all commands) +bin/ +docs/ +.circleci/ +.git/ +.github/ +.vscode/ +artifacts/ +images/ +samples/ +.*yml +.*yaml +.*toml +.*tmpl +.editorconfig +.gitignore .oktetoignore -./mdlrc -/.pre-commit-config.yaml -/.prettierrc -/.prettierignore -/.stignore -/.yaml-lint.yml -/CODE_OF_CONDUCT.md -/CODEOWNERS +.mdlrc +.pre-commit-config.* +.prettier* +.stignore +CODE_OF_CONDUCT.md +CODEOWNERS + +# Applied to deploy commands only - ignore everything +[deploy] +* + +# Applied to destroy commands only - ignore everything +[destroy] +* + +# Applied to all test commands +[test] +docs/ +samples/ +scripts/ci/ diff --git a/okteto.yml b/okteto.yml index 4fdc556bdca0..585947f6ed18 100644 --- a/okteto.yml +++ b/okteto.yml @@ -3,7 +3,7 @@ build: context: . dockerfile: Dockerfile args: - - VERSION_STRING=$OKTETO_GIT_COMMIT + VERSION_STRING: $OKTETO_GIT_COMMIT deploy: image: $OKTETO_BUILD_CLI_IMAGE commands: From dac7b93f3254205df2282777a675ab0054e5356f Mon Sep 17 00:00:00 2001 From: oktetobot Date: Wed, 9 Apr 2025 14:43:27 +0000 Subject: [PATCH 2/4] Add test section to Okteto manifest --- okteto.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/okteto.yml b/okteto.yml index 585947f6ed18..e43693f6bfcc 100644 --- a/okteto.yml +++ b/okteto.yml @@ -5,6 +5,8 @@ build: args: VERSION_STRING: $OKTETO_GIT_COMMIT deploy: + remote: true + context: . image: $OKTETO_BUILD_CLI_IMAGE commands: - name: CLI @@ -20,3 +22,24 @@ dev: - /go/pkg/ - /root/.cache/go-build/ autocreate: true +test: + unit: + image: okteto/golang:1 + context: . + commands: + - go test ./pkg/... -v + artifacts: + - coverage.out + caches: + - /go/pkg + - /root/.cache/go-build + integration: + image: okteto/golang:1 + context: . + commands: + - go test ./integration/... -v + artifacts: + - integration-results.log + caches: + - /go/pkg + - /root/.cache/go-build From 6422aadec77e95b1fd91d42b27ba68d9524f5614 Mon Sep 17 00:00:00 2001 From: oktetobot Date: Wed, 9 Apr 2025 14:45:46 +0000 Subject: [PATCH 3/4] Add CVE scanning test using Trivy --- okteto.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/okteto.yml b/okteto.yml index e43693f6bfcc..3c5e56ab1fa6 100644 --- a/okteto.yml +++ b/okteto.yml @@ -43,3 +43,10 @@ test: caches: - /go/pkg - /root/.cache/go-build + cves: + image: aquasec/trivy:latest + context: . + commands: + - trivy image --severity HIGH,CRITICAL --output trivy-results.txt $OKTETO_BUILD_CLI_IMAGE + artifacts: + - trivy-results.txt From 256990f027d62028a757a932028726428316418e Mon Sep 17 00:00:00 2001 From: Javier Lopez Date: Thu, 10 Apr 2025 13:45:35 +0200 Subject: [PATCH 4/4] Revert "Add test section to Okteto manifest" This reverts commit dac7b93f3254205df2282777a675ab0054e5356f. Signed-off-by: Javier Lopez --- okteto.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/okteto.yml b/okteto.yml index 3c5e56ab1fa6..585947f6ed18 100644 --- a/okteto.yml +++ b/okteto.yml @@ -5,8 +5,6 @@ build: args: VERSION_STRING: $OKTETO_GIT_COMMIT deploy: - remote: true - context: . image: $OKTETO_BUILD_CLI_IMAGE commands: - name: CLI @@ -22,31 +20,3 @@ dev: - /go/pkg/ - /root/.cache/go-build/ autocreate: true -test: - unit: - image: okteto/golang:1 - context: . - commands: - - go test ./pkg/... -v - artifacts: - - coverage.out - caches: - - /go/pkg - - /root/.cache/go-build - integration: - image: okteto/golang:1 - context: . - commands: - - go test ./integration/... -v - artifacts: - - integration-results.log - caches: - - /go/pkg - - /root/.cache/go-build - cves: - image: aquasec/trivy:latest - context: . - commands: - - trivy image --severity HIGH,CRITICAL --output trivy-results.txt $OKTETO_BUILD_CLI_IMAGE - artifacts: - - trivy-results.txt