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

cleanup: config and makefile #4355

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,28 @@ endef
use-env-file:
$(call setup_env)

run-api: use-env-file
.PHONY: refresh-config
refresh-config:
wget "https://raw.githubusercontent.com/kubeshop/helm-charts/develop/charts/testkube-api/executors.json" -O config/executors.json &
wget "https://raw.githubusercontent.com/kubeshop/helm-charts/develop/charts/testkube-api/job-container-template.yml" -O config/job-container-template.yml &
wget "https://raw.githubusercontent.com/kubeshop/helm-charts/develop/charts/testkube-api/job-scraper-template.yml" -O config/job-scraper-template.yml &
wget "https://raw.githubusercontent.com/kubeshop/helm-charts/develop/charts/testkube-api/job-template.yml" -O config/job-template.yml &
wget "https://raw.githubusercontent.com/kubeshop/helm-charts/develop/charts/testkube-api/pvc-container-template.yml" -O config/pvc-container-template.yml &
wget "https://raw.githubusercontent.com/kubeshop/helm-charts/develop/charts/testkube-api/slack-config.json" -O config/slack-config.json &
wget "https://raw.githubusercontent.com/kubeshop/helm-charts/develop/charts/testkube-api/slack-template.json" -O config/slack-template.json

run-api: use-env-file refresh-config
TESTKUBE_DASHBOARD_URI=$(DASHBOARD_URI) APISERVER_CONFIG=testkube-api-server-config-testkube TESTKUBE_ANALYTICS_ENABLED=$(TESTKUBE_ANALYTICS_ENABLED) TESTKUBE_NAMESPACE=$(NAMESPACE) SCRAPPERENABLED=true STORAGE_SSL=true DEBUG=$(DEBUG) APISERVER_PORT=8088 go run -ldflags='$(LD_FLAGS)' cmd/api-server/main.go

run-api-race-detector: use-env-file
run-api-race-detector: use-env-file refresh-config
TESTKUBE_DASHBOARD_URI=$(DASHBOARD_URI) APISERVER_CONFIG=testkube-api-server-config-testkube TESTKUBE_NAMESPACE=$(NAMESPACE) DEBUG=1 APISERVER_PORT=8088 go run -race -ldflags='$(LD_FLAGS)' cmd/api-server/main.go

run-api-telepresence: use-env-file
run-api-telepresence: use-env-file refresh-config
TESTKUBE_DASHBOARD_URI=$(DASHBOARD_URI) APISERVER_CONFIG=testkube-api-server-config-testkube TESTKUBE_NAMESPACE=$(NAMESPACE) DEBUG=1 API_MONGO_DSN=mongodb://testkube-mongodb:27017 APISERVER_PORT=8088 go run cmd/api-server/main.go

run-mongo-dev:
docker run --name mongodb -p 27017:27017 --rm mongo


build: build-api-server build-testkube-bin

build-api-server:
Expand Down Expand Up @@ -80,7 +89,6 @@ docker-build-api:
docker-build-cli:
env SLACK_BOT_CLIENT_ID=** SLACK_BOT_CLIENT_SECRET=** ANALYTICS_TRACKING_ID=** ANALYTICS_API_KEY=** SEGMENTIO_KEY=** CLOUD_SEGMENTIO_KEY=** DOCKER_BUILDX_CACHE_FROM=type=registry,ref=docker.io/kubeshop/testkube-cli:latest ALPINE_IMAGE=alpine:3.18.0 goreleaser release -f .builds-linux.goreleaser.yml --rm-dist --snapshot


#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:
Expand Down Expand Up @@ -155,7 +163,6 @@ create-examples:
execute-testkube-cli-test-suite:
test/run.sh


test-reload-sanity-test:
kubectl delete secrets sanity-secrets -ntestkube
kubectl delete test sanity -ntestkube || true
Expand All @@ -175,7 +182,6 @@ test-api-port-forwarded:
test-api-on-cluster:
kubectl testkube run test sanity -f -p api_uri=http://testkube-api-server:8088 -p test_api_uri=http://testkube-api-server:8088 -p test_type=postman/collection -p test_name=fill-me -p execution_name=fill-me


cover:
@go test -failfast -count=1 -v -tags test -coverprofile=./testCoverage.txt ./... && go tool cover -html=./testCoverage.txt -o testCoverage.html && rm ./testCoverage.txt
open testCoverage.html
Expand All @@ -197,6 +203,7 @@ version-bump-dev:
commands-reference:
go run cmd/kubectl-testkube/main.go generate doc

.PHONY: docs
docs: commands-reference

prerelease:
Expand Down Expand Up @@ -225,7 +232,6 @@ video:

ffmpeg -y -r 30 -f image2pipe -vcodec ppm -i stream.out -b 65536K movie.mp4


port-forward-minio:
kubectl port-forward svc/testkube-minio-service-testkube 9090:9090 -ntestkube

Expand Down
Loading