diff --git a/.env b/.env new file mode 100644 index 0000000..25b5e72 --- /dev/null +++ b/.env @@ -0,0 +1,6 @@ +PORT_API_ORG=9090 +PORT_API_PROFILE=9091 +PORT_API_LICENSE=9092 +PORT_DB_ORG=15432 +PORT_DB_PROFILE=15433 +PORT_DB_LICENSE=15434 \ No newline at end of file diff --git a/Makefile b/Makefile index 2c60ea1..b3bef43 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ check_pkgx: .PHONY: all all: check_pkgx stop pkgx temporal@latest server start-dev & - sleep 2 + pkgx eb -x 20 -- lsof -i :7233 pkgx task@latest run:all .PHONY: stop diff --git a/Taskfile.yml b/Taskfile.yml index 582bf9b..6187dc9 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,5 +1,7 @@ version: "3" +dotenv: ['.env'] + includes: buf: taskfile: ./taskfiles/buf.yml diff --git a/docker-compose.yml b/docker-compose.yml index 5fb4396..1d067a9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: POSTGRES_PASSWORD: postgrespassword restart: always ports: - - "127.0.0.1:15432:5432" + - "127.0.0.1:${PORT_DB_ORG}:5432" volumes: - pg_data_org:/var/lib/postgresql/data healthcheck: @@ -18,13 +18,13 @@ services: db-profile: <<: *db_org ports: - - "127.0.0.1:15433:5432" + - "127.0.0.1:${PORT_DB_PROFILE}:5432" volumes: - pg_data_profile:/var/lib/postgresql/data db-license: <<: *db_org ports: - - "127.0.0.1:15434:5432" + - "127.0.0.1:${PORT_DB_LICENSE}:5432" volumes: - pg_data_license:/var/lib/postgresql/data diff --git a/docs/upstreams.md b/docs/upstreams.md index e26670b..6186a14 100644 --- a/docs/upstreams.md +++ b/docs/upstreams.md @@ -5,38 +5,39 @@ worker. Some quick curl commands to communicate with each of the 3 microservices. -### License Service +### Org Service ```shell -curl -v http://localhost:9090/license.v1beta1.LicenseService/CreateLicense \ +curl -v http://localhost:9090/org.v1beta1.OrgService/CreateOrg \ -H "Content-Type: application/json" \ - -d '{"name": "L1"}' + -d '{"name": "Org1"}' http POST \ - http://localhost:9090/license.v1beta1.LicenseService/CreateLicense \ - name="L1" + http://localhost:9090/org.v1beta1.OrgService/CreateOrg \ + name="Org1" ``` -### Org Service +### Profile Service ```shell -curl -v http://localhost:9091/org.v1beta1.OrgService/CreateOrg \ +curl -v http://localhost:9091/profile.v1beta1.ProfileService/CreateProfile \ -H "Content-Type: application/json" \ - -d '{"name": "Org1"}' + -d '{"full_name": "Kevin Chen"}' http POST \ - http://localhost:9091/org.v1beta1.OrgService/CreateOrg \ - name="Org1" + http://localhost:9091/profile.v1beta1.ProfileService/CreateProfile \ + full_name="Kevin Chen" ``` -### Profile Service +### License Service ```shell -curl -v http://localhost:9092/profile.v1beta1.ProfileService/CreateProfile \ +curl -v http://localhost:9092/license.v1beta1.LicenseService/CreateLicense \ -H "Content-Type: application/json" \ - -d '{"name": "Kevin Chen"}' + -d '{"start": "2023-11-16T12:00:00Z", "end": "2024-01-16T12:00:00Z"}' http POST \ - http://localhost:9092/profile.v1beta1.ProfileService/CreateProfile \ - name="Kevin Chen" -``` + http://localhost:9092/license.v1beta1.LicenseService/CreateLicense \ + start="2023-11-16T12:00:00Z" \ + end="2024-01-16T12:00:00Z" +``` \ No newline at end of file diff --git a/taskfiles/run.yml b/taskfiles/run.yml index 4accac7..cca13b7 100644 --- a/taskfiles/run.yml +++ b/taskfiles/run.yml @@ -1,12 +1,6 @@ version: '3' vars: - PORT_API_ORG: 9091 - PORT_API_LICENSE: 9090 - PORT_API_PROFILE: 9092 - PORT_DB_ORG: 15432 - PORT_DB_PROFILE: 15433 - PORT_DB_LICENSE: 15434 SCHEMA_ORG: org.hcl SCHEMA_PROFILE: profile.hcl SCHEMA_LICENSE: license.hcl