From 48d625e60cec28d4d8e8e0876ca4b497ea7433c9 Mon Sep 17 00:00:00 2001 From: Lilla Vass Date: Wed, 11 Oct 2023 13:46:46 +0200 Subject: [PATCH] feat: evaluate environment variables in the args of gradle (#4457) --- Makefile | 2 +- contrib/executor/gradle/README.md | 12 +++++++----- contrib/executor/gradle/pkg/runner/runner.go | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index c3cbe2747a5..0f074967193 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ docker-build-cli: #make docker-build-executor EXECUTOR=zap GITHUB_TOKEN=*** DOCKER_BUILDX_CACHE_FROM=type=registry,ref=docker.io/kubeshop/testkube-zap-executor:latest #add ALPINE_IMAGE=alpine:3.18.0 env var for building of curl and scraper executor docker-build-executor: - goreleaser release -f goreleaser_files/.goreleaser-docker-build-executor.yml --rm-dist --snapshot + goreleaser release -f goreleaser_files/.goreleaser-docker-build-executor.yml --clean --snapshot dev-install-local-executors: kubectl apply --namespace testkube -f https://raw.githubusercontent.com/kubeshop/testkube-operator/main/config/samples/executor_v1_executor.yaml diff --git a/contrib/executor/gradle/README.md b/contrib/executor/gradle/README.md index 6905fdbc156..194b76818de 100644 --- a/contrib/executor/gradle/README.md +++ b/contrib/executor/gradle/README.md @@ -1,27 +1,29 @@ ![Testkube Logo](https://raw.githubusercontent.com/kubeshop/testkube/main/assets/testkube-color-gray.png) -# Welcome to TestKube Gradle Executor +# Welcome to Testkube Gradle Executor -TestKube Gradle Executor is a test executor to run Gradle tasks with [TestKube](https://testkube.io). +Testkube Gradle Executor is a test executor to run Gradle tasks with [Testkube](https://testkube.io). ## Usage You need to register and deploy the executor in your cluster. + ```bash kubectl apply -f examples/gradle-executor.yaml ``` Issue the following commands to create and start a Gradle test for a given Git repository: + ```bash kubectl testkube create test --git-uri https://github.com/lreimer/hands-on-testkube.git --git-branch main --type "gradle/test" --name gradle-test kubectl testkube run test --watch gradle-test ``` -# Issues and enchancements +# Issues and enchancements -Please follow the main [TestKube repository](https://github.com/kubeshop/testkube) for reporting any [issues](https://github.com/kubeshop/testkube/issues) or [discussions](https://github.com/kubeshop/testkube/discussions) +Please follow the main [Testkube repository](https://github.com/kubeshop/testkube) for reporting any [issues](https://github.com/kubeshop/testkube/issues) or [discussions](https://github.com/kubeshop/testkube/discussions) -# Testkube +# Testkube For more info go to [main testkube repo](https://github.com/kubeshop/testkube) diff --git a/contrib/executor/gradle/pkg/runner/runner.go b/contrib/executor/gradle/pkg/runner/runner.go index d96ef51ef6f..b171fc035b2 100644 --- a/contrib/executor/gradle/pkg/runner/runner.go +++ b/contrib/executor/gradle/pkg/runner/runner.go @@ -131,9 +131,9 @@ func (r *GradleRunner) Run(ctx context.Context, execution testkube.Execution) (r if args[i] == "" { args[i] = project } + args[i] = os.ExpandEnv(args[i]) } - output.PrintEvent("Running task: "+task, directory, gradleCommand, args) out, err := executor.Run(runPath, gradleCommand, envManager, args...) out = envManager.ObfuscateSecrets(out)