@@ -318,15 +318,27 @@ stop-airgapped-local-registry:
318318 @docker stop temp-airgapped-local-registry temp-airgapped-local-registry-with-auth > /dev/null 2>&1 && \
319319 echo " Stopping docker test airgapped repo if running..." || true
320320
321+
322+ .PHONY : setup-custom-cert-for-test-cli-service
323+ setup-custom-cert-for-test-cli-service : # # Setup up the custom ca cert for the test cli service in the config file
324+ @if [ ! -d $( ROOT_DIR) /hack/central-repo/certs ]; then \
325+ wget https://storage.googleapis.com/tanzu-cli/data/testcerts/local-central-repo-testcontent.bz2 -O $(ROOT_DIR ) /hack/central-repo/local-central-repo-testcontent.bz2; \
326+ tar xjf $(ROOT_DIR ) /hack/central-repo/local-central-repo-testcontent.bz2 -C $(ROOT_DIR ) /hack/central-repo/; \
327+ fi
328+ @echo " Adding docker test cli service cert to the config file"
329+ @TANZU_CLI_CEIP_OPT_IN_PROMPT_ANSWER=" No" TANZU_CLI_EULA_PROMPT_ANSWER=" Yes" $(ROOT_DIR ) /bin/tanzu config cert delete localhost:9443 & > /dev/null || true
330+ $(ROOT_DIR ) /bin/tanzu config cert add --host localhost:9443 --ca-cert $(ROOT_DIR ) /hack/central-repo/certs/localhost.crt
331+
321332.PHONY : start-test-cli-service
322- start-test-cli-service : stop-test-cli-service # # Starts a test CLI service locally with docker
323- @docker run -d --rm --name cli-service -p 8080:80 \
333+ start-test-cli-service : stop-test-cli-service setup-custom-cert-for-test-cli-service # # Starts a test CLI service locally with docker
334+ @docker run -d --rm --name cli-service -p 9443:443 \
335+ -v $(ROOT_DIR ) /hack/central-repo/certs:/certs \
324336 -v $(ROOT_DIR ) /hack/service/install.sh:/var/www/html/cli/v1/install/install.txt \
325337 -v $(ROOT_DIR ) /hack/service/discovery:/var/www/html/cli/v1/plugin/discovery \
326338 -v $(ROOT_DIR ) /hack/service/binaries:/var/www/html/cli/v1/binary \
327339 -v $(ROOT_DIR ) /hack/service/cli-service.conf:/etc/nginx/conf.d/cli-service.conf \
328- nginx:alpine && \
329- echo " Started docker test cli service at 'localhost:8080 '"
340+ nginx:alpine > /dev/null && \
341+ echo " Started docker test cli service at 'localhost:9443 '"
330342
331343.PHONY : stop-test-cli-service
332344stop-test-cli-service : # # Stops and removes the local test CLI service
0 commit comments