diff --git a/Makefile b/Makefile index 6dc9f1e..0382112 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ NOW := $(shell date +%m_%d_%Y_%H_%M) SERVICE_NAME := example-todo-model-service DEBUG ?= example* -onboard: install create-env-file deploy-to-local-cluster +onboard: install create-env-file create-env-file: ./scripts/create-env-file.sh @@ -16,40 +16,3 @@ install: open: code . - -connect-to-local-dev-cluster: - kubectl ctx $(LOCAL_DEV_CLUSTER) - kubectl port-forward --namespace default svc/sourced-mongodb 27017:27017 & - kubectl port-forward --namespace knative-eventing svc/broker-ingress 8080:80 & - -build-new-local-image: - kubectl ctx $(LOCAL_DEV_CLUSTER) - docker build -t $(SERVICE_NAME) . - docker tag $(SERVICE_NAME):latest dev.local/$(SERVICE_NAME):$(NOW) - -load-local-image-to-kind: - kubectl ctx $(LOCAL_DEV_CLUSTER) - kind --name local-dev-cluster load docker-image dev.local/$(SERVICE_NAME):$(NOW) - -deploy-to-local-cluster: - kubectl ctx $(LOCAL_DEV_CLUSTER) - helm template ./charts/$(SERVICE_NAME)/ \ - -f ./charts/$(SERVICE_NAME)/values.yaml \ - --set image.repository=dev.local/$(SERVICE_NAME),image.tag=$(NOW),local=true \ - | kubectl apply -f - - -delete-local-deployment: - kubectl ctx $(LOCAL_DEV_CLUSTER) - helm template ./charts/$(SERVICE_NAME)/ \ - -f ./charts/$(SERVICE_NAME)/values.yaml \ - --set image.repository=dev.local/$(SERVICE_NAME),image.tag=$(NOW) \ - | kubectl delete -f - - -refresh-kind-image: build-new-local-image load-local-image-to-kind deploy-to-local-cluster -hard-refresh-kind-image: delete-local-deployment build-new-local-image load-local-image-to-kind deploy-to-local-cluster - -localizer: - localizer expose default/$(SERVICE_NAME) --map 80:5002 - -stop-localizer: - localizer expose default/$(SERVICE_NAME) --stop diff --git a/README.md b/README.md index 3a90b92..22b90fa 100644 --- a/README.md +++ b/README.md @@ -71,28 +71,6 @@ To start the tests in watch mode run, which will rerun as you make code changes: npm run test:integration:watch ``` -#### Local development cluster integration tests - -To run these tests locally, first set up a [local-development-cluster](https://github.com/cloudnativeentrepreneur/local-development-cluster), and then run the following to deploy a local copy of your app that local cluster: - -```bash -make refresh-kind-image -``` - -Or - - -```bash -make hard-refresh-kind-image -``` - - -Make sure `localizer` is running (`make localizer` in the [meta repo](https://github.com/cloudnativeentrepreneur/cne-meta), then, trigger the integration tests using: - -``` -npm run test:integration -``` - ## Linting To format the code automatically and fix any automatically fixable errors, run: diff --git a/scripts/create-env-file.sh b/scripts/create-env-file.sh index e8e1ccd..30ca4ea 100755 --- a/scripts/create-env-file.sh +++ b/scripts/create-env-file.sh @@ -1,6 +1,6 @@ #!/bin/sh -export PG_PASS=$(kubectl get secret sourced.example-sourced-db-postgresql.credentials.postgresql.acid.zalan.do -o jsonpath={.data.password} | base64 -D) -export SOURCED_POSTGRESQL_URL="postgresql://sourced:${PG_PASS}@example-sourced-db-postgresql.default.svc.cluster.local:5432/sourced" +export PG_PASS=$(kubectl -n example-local-env get secret sourced.example-sourced-db-postgresql.credentials.postgresql.acid.zalan.do -o jsonpath={.data.password} | base64 -D) +export SOURCED_POSTGRESQL_URL="postgresql://sourced:${PG_PASS}@example-sourced-db-postgresql.example-local-env.svc.cluster.local:5432/sourced" cat .env > .local.env echo "\nSOURCED_POSTGRESQL_URL=${SOURCED_POSTGRESQL_URL}" >> .local.env \ No newline at end of file diff --git a/src/config.ts b/src/config.ts index d70ab64..3828d7d 100644 --- a/src/config.ts +++ b/src/config.ts @@ -4,7 +4,7 @@ export const config = { todo: { events: process.env.TODO_EVENTS_BROKER_URL || - "http://broker-ingress.knative-eventing.svc.cluster.local/default/todo-events", + "http://broker-ingress.knative-eventing.svc.cluster.local/example-local-env/todo-events", }, }, source: "example-todo-model-service",