Skip to content

Commit d5548d6

Browse files
authored
feat(condo): DOMA-13398 add minimal miniapp for ecom-gateway (#7792)
* feat(ecom-gateway): DOMA-13398 add ecom-gateway service integration - Add ecom-gateway as git submodule - Configure ecom-gateway deployment URLs for development and production environments - Add ecom-gateway CI/CD pipeline with tests, migrations check, and build steps - Add ecom-gateway Docker image configuration in werf.yaml * chore(helm): DOMA-13398 update .helm submodule to working branch * chore(ecom-gateway): DOMA-13398 update submodule to latest commit * chore(ci): DOMA-13398 pin docker/login-action to commit hash for ecom-gateway job * chore(ecom-gateway): DOMA-13398 update submodule to latest commit * chore(ecom-gateway): DOMA-13398 update yarn.lock file * chore(ecom-gateway): DOMA-13398 update submodule to latest commit * chore(ci): DOMA-13398 add packages path filter to ecom-gateway job * chore(ecom-gateway): DOMA-13398 reset cache version to 1 * chore(helm): DOMA-13398 update ecom-gateway submodule to main branch * chore(helm): DOMA-13398 update helm submodule to main branch * chore(helm): DOMA-13398 temporary add .yarnrc.yml to .semgrepignore * chore(helm): DOMA-13398 temporary add nodejs.insurance.test.yml to .semgrepignore * chore(insurance): update github actions versions from tags to hashes * chore(insurance): update github actions versions from tags to hashes (main)
1 parent 3883bbd commit d5548d6

10 files changed

Lines changed: 141 additions & 2 deletions

File tree

.github/workflows/deploy_development.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ jobs:
7777
WERF_SET_CI_PROPERTY_AI_ASSISTANT_URL: "global.ci_property_ai_assistant_url=property-ai-assistant.d.doma.ai"
7878
WERF_SET_CI_B2B_PAYMENTS_GATEWAY_URL: "global.ci_b2b_payments_gateway_url=b2b-payments-gateway.d.doma.ai"
7979
WERF_SET_CI_DEBT_MANAGEMENT_URL: "global.ci_debt_management_url=debt-management.d.doma.ai"
80+
WERF_SET_CI_ECOM_GATEWAY_URL: "global.ci_ecom_gateway_url=ecom-gateway.d.doma.ai"
8081
WERF_SET_CI_NAMESPACE: "global.ci_namespace=development"
8182
WERF_NAMESPACE: "development"
8283
WERF_VIRTUAL_MERGE_FROM_COMMIT: "true"

.github/workflows/deploy_production.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ jobs:
8484
WERF_SET_CI_PROPERTY_AI_ASSISTANT_URL: "global.ci_property_ai_assistant_url=property-ai-assistant.doma.ai"
8585
WERF_SET_CI_B2B_PAYMENTS_GATEWAY_URL: "global.ci_b2b_payments_gateway_url=b2b-payments-gateway.doma.ai"
8686
WERF_SET_CI_DEBT_MANAGEMENT_URL: "global.ci_debt_management_url=debt-management.doma.ai"
87+
WERF_SET_CI_ECOM_GATEWAY_URL: "global.ci_ecom_gateway_url=ecom-gateway.doma.ai"
8788
WERF_SET_CI_NAMESPACE: "global.ci_namespace=production"
8889
WERF_NAMESPACE: "production"
8990
WERF_VIRTUAL_MERGE_FROM_COMMIT: "true"

.github/workflows/nodejs.condo.ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ jobs:
140140
pos-integration: ${{ steps.detect-changes.outputs.pos-integration }}
141141
accruals-gateway: ${{ steps.detect-changes.outputs.accruals-gateway }}
142142
resident-app: ${{ steps.detect-changes.outputs.resident-app }}
143+
ecom-gateway: ${{ steps.detect-changes.outputs.ecom-gateway }}
143144
steps:
144145
- name: Checkout code with submodules
145146
uses: actions/checkout@v4
@@ -217,6 +218,9 @@ jobs:
217218
- 'packages/**'
218219
webhooks:
219220
- 'packages/webhooks/**'
221+
ecom-gateway:
222+
- 'apps/ecom-gateway/**'
223+
- 'packages/**'
220224
221225
lint:
222226
name: Lint source code
@@ -962,6 +966,57 @@ jobs:
962966
PROMETHEUS_PASSWORD: ${{ secrets.K6_PROMETHEUS_PASSWORD }}
963967
GH_REF_NAME: ${{ github.event.pull_request.head.ref || github.ref_name }}
964968

969+
970+
run-ecom-gateway-tests:
971+
name: ecom-gateway Tests
972+
runs-on: ubuntu-22.04
973+
needs:
974+
- authorize
975+
- build-image
976+
- detect-changes
977+
if: ${{ needs.detect-changes.outputs.ecom-gateway == 'true' }}
978+
steps:
979+
- name: Login to cloud registry
980+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9
981+
with:
982+
registry: ${{ secrets.DOCKER_REGISTRY }}
983+
username: ${{ secrets.SBERCLOUD_CR_USERNAME }}
984+
password: ${{ secrets.SBERCLOUD_CR_PASSWORD }}
985+
- name: Setup PG db
986+
run: |
987+
docker run -e POSTGRES_USER=$POSTGRES_USER -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD -e POSTGRES_DB=$POSTGRES_DB -p="127.0.0.1:5432:5432" -d ${{ env.PG_IMAGE_FULL }}
988+
env:
989+
POSTGRES_USER: postgres
990+
POSTGRES_PASSWORD: postgres
991+
POSTGRES_DB: main
992+
- name: Setup Redis db
993+
run: |
994+
${{ env.REDIS_RUN_COMMAND }}
995+
- name: Run condo container with daemon
996+
run: |
997+
docker run --network="host" --name condo-container -dit ${{ env.DOCKER_IMAGE_FULL }} sh
998+
- name: Prepare apps
999+
run: |
1000+
docker exec condo-container node bin/prepare.js -f ecom-gateway
1001+
- name: Check migrations state
1002+
run: |
1003+
docker exec condo-container yarn workspace @app/ecom-gateway makemigrations --check
1004+
- name: Run apps and tests
1005+
run: |
1006+
docker exec \
1007+
-e PROMETHEUS_RW_SERVER_URL=$PROMETHEUS_RW_SERVER_URL \
1008+
-e PROMETHEUS_USER=$PROMETHEUS_USER \
1009+
-e PROMETHEUS_PASSWORD=$PROMETHEUS_PASSWORD \
1010+
-e GH_REF_NAME=$GH_REF_NAME \
1011+
condo-container sh -c "(\
1012+
yarn workspace @app/ecom-gateway start & \
1013+
node bin/wait-apps-apis.js -f ecom-gateway) && \
1014+
yarn workspace @app/ecom-gateway test"
1015+
env:
1016+
PROMETHEUS_RW_SERVER_URL: ${{ secrets.K6_PROMETHEUS_RW_SERVER_URL }}
1017+
PROMETHEUS_USER: ${{ secrets.K6_PROMETHEUS_USER }}
1018+
PROMETHEUS_PASSWORD: ${{ secrets.K6_PROMETHEUS_PASSWORD }}
1019+
GH_REF_NAME: ${{ github.event.pull_request.head.ref || github.ref_name }}
9651020
run-webhooks-tests:
9661021
name: Webhooks Tests
9671022
runs-on: ubuntu-22.04

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,6 @@
8282
[submodule "apps/debt-management"]
8383
path = apps/debt-management
8484
url = git@github.com:open-condo-software/condo-debt-management.git
85+
[submodule "apps/ecom-gateway"]
86+
path = apps/ecom-gateway
87+
url = git@github.com:open-condo-software/condo-ecom-gateway.git

.helm

Submodule .helm updated from 1486c7c to 01932b7

.semgrepignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ ignore.*
2727

2828
README.md
2929
apps/**/docs/**/*.mdx
30+
31+
# todo(AleX83Xpert) remove next line
32+
.yarnrc.yml

apps/ecom-gateway

Submodule ecom-gateway added at db611aa

apps/insurance

werf.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,3 +1326,46 @@ shell:
13261326
docker:
13271327
ENV:
13281328
LANG: C.UTF-8
1329+
1330+
---
1331+
image: ecom_gateway
1332+
fromImage: deps
1333+
fromCacheVersion: "1"
1334+
git:
1335+
- add: /
1336+
to: /app
1337+
stageDependencies:
1338+
install:
1339+
- "yarn.lock"
1340+
- "package.json"
1341+
- "**/yarn.lock"
1342+
- "**/package.json"
1343+
setup:
1344+
- "apps/**"
1345+
- "packages/**"
1346+
- "bin/**/*"
1347+
excludePaths:
1348+
- .github
1349+
- .helm
1350+
- werf.yaml
1351+
- werf-giterminism.yaml
1352+
owner: app
1353+
group: app
1354+
1355+
shell:
1356+
setup:
1357+
- "cd /app"
1358+
- "echo '# Build time .env config!' >> /app/.env"
1359+
- "echo 'COOKIE_SECRET=undefined' >> /app/.env"
1360+
- "echo 'DATABASE_URL=undefined' >> /app/.env"
1361+
- "echo 'REDIS_URL=undefined' >> /app/.env"
1362+
- "echo 'NODE_ENV=production' >> /app/.env"
1363+
- "echo 'FILE_FIELD_ADAPTER=local' >> /app/.env"
1364+
- "yarn workspace @app/ecom-gateway build:deps"
1365+
- "yarn workspace @app/ecom-gateway build"
1366+
- "rm -rf /app/.env"
1367+
- "rm -rf /app/.config"
1368+
1369+
docker:
1370+
ENV:
1371+
LANG: C.UTF-8

yarn.lock

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,32 @@ __metadata:
10471047
languageName: unknown
10481048
linkType: soft
10491049

1050+
"@app/ecom-gateway@workspace:apps/ecom-gateway":
1051+
version: 0.0.0-use.local
1052+
resolution: "@app/ecom-gateway@workspace:apps/ecom-gateway"
1053+
dependencies:
1054+
"@ecom-gateway/domains": "link:./domains"
1055+
"@faker-js/faker": ^7.6.0
1056+
"@graphql-tools/graphql-file-loader": ^7.5.17
1057+
"@graphql-tools/load": ^8.1.0
1058+
"@open-condo/apollo-server-client": "workspace:^"
1059+
"@open-condo/cli": "workspace:^"
1060+
"@open-condo/codegen": "workspace:^"
1061+
"@open-condo/config": "workspace:^"
1062+
"@open-condo/keystone": "workspace:^"
1063+
"@types/react": ^18.3.1
1064+
cross-env: ^7.0.3
1065+
express: ^4.21.2
1066+
graphql: ^16.10.0
1067+
jest: ^29.7.0
1068+
lodash: ^4.17.21
1069+
mkdirp: ^3.0.1
1070+
openid-client: 5.7.1
1071+
pluralize: ^8.0.0
1072+
react: ^18.3.1
1073+
languageName: unknown
1074+
linkType: soft
1075+
10501076
"@app/employee-bot@workspace:apps/employee-bot":
10511077
version: 0.0.0-use.local
10521078
resolution: "@app/employee-bot@workspace:apps/employee-bot"
@@ -6105,6 +6131,12 @@ __metadata:
61056131
languageName: node
61066132
linkType: hard
61076133

6134+
"@ecom-gateway/domains@link:./domains::locator=%40app%2Fecom-gateway%40workspace%3Aapps%2Fecom-gateway":
6135+
version: 0.0.0-use.local
6136+
resolution: "@ecom-gateway/domains@link:./domains::locator=%40app%2Fecom-gateway%40workspace%3Aapps%2Fecom-gateway"
6137+
languageName: node
6138+
linkType: soft
6139+
61086140
"@emnapi/runtime@npm:^1.4.4":
61096141
version: 1.4.4
61106142
resolution: "@emnapi/runtime@npm:1.4.4"

0 commit comments

Comments
 (0)