From b34ef8149b5f86f8a0a1e87de8b9f6b3a0de5705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Djk=C3=A1=C5=A5o?= Date: Wed, 3 Jul 2024 16:08:12 +0200 Subject: [PATCH] small refactor --- Makefile.toml | 35 ++++++++++++------- changes.sh | 4 +-- .../snippets/import-path-app-next.config.js | 2 +- emails.test.env | 9 ++--- 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/Makefile.toml b/Makefile.toml index 8fd8ac6..85e8e51 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -24,34 +24,44 @@ ALL_APPS = [ workspace = false alias = "build" +[tasks.update-repos] +workspace = false +script = ''' +git submodule foreach --recursive git reset --hard +git submodule update --recursive --remote +''' + # Overrides the default build task [tasks.build] workspace = false alias = "build-all" [tasks.build-all] -workspace = false -dependencies = [ - # "delete-images", +run_task = { name = [ + "delete-images", "build-abandoned-checkouts", "build-stripe", "build-klarna", - # "build-authorize-net", -- Error: 11.26 Type error: Cannot find module '../generated/graphql' or its corresponding type declarations. + "build-authorize-net", "build-avatax", - # "build-cms-v2", -- Error: Unable to find 'schema-ast' - # "build-crm", -- Error: Unable to find 'schema-ast' + "build-cms-v2", + "build-crm", "build-data-importer", - "build-emails-and-messages", "build-invoices", "build-klaviyo", "build-products-feed", "build-search", - # "build-segment", -- Error: Unable to find 'schema-ast' + "build-segment", "build-slack", "build-smtp", "build-taxjar", - -] +], parallel = true } +# segment: -- Error: Unable to find 'schema-ast' +# crm: -- Error: Unable to find 'schema-ast' +# cms-v2: -- Error: Unable to find 'schema-ast' +# avatax: -- x Could not find the following tasks in project: build +# authorize-net: -- Error: 11.26 Type error: Cannot find module '../generated/graphql' or its corresponding type declarations. +workspace = false [tasks.apply-changes] workspace = false @@ -80,8 +90,9 @@ docker push ${CONTAINER_PUSH_URL}/saleor-app-${APP} [tasks.delete-images] workspace = false script = ''' -for i in ${ALL_APPS[*]}; do - docker rmi -f $(docker image ls -q --filter=label=service=saleor-app-$i) 2>&1 || true +ALL_IMAGES=$(docker images -qa --filter "label=src=saleor-dockerize-all-apps" --format "{{.Repository}}:{{.Tag}}") +for i in ${ALL_IMAGES[*]}; do + docker rmi -f $i 2>&1 || true done ''' diff --git a/changes.sh b/changes.sh index 3856d24..d4cf44a 100755 --- a/changes.sh +++ b/changes.sh @@ -5,7 +5,7 @@ REDIS_APL_PATH="$CURR_PWD/changes/snippets/redis_apl.ts" OLD_REDIS_APL_PATH="$CURR_PWD/changes/snippets/redis_apl_old_sdk.ts" APPS_DOCKERFILE_PATH="$CURR_PWD/apps.Dockerfile" OTHER_DOCKERFILE_PATH="$CURR_PWD/other.Dockerfile" -DOCKERIGNORE_PATH = "$CURR_PWD/.dockerignore" +DOCKERIGNORE_PATH="$CURR_PWD/.dockerignore" app_paths=( "apps/apps/cms-v2" @@ -74,7 +74,7 @@ find ./all_apps/apps -name "saleor-app.ts" -exec cargo run --package modify-sale echo "pached all_apps/apps/**/saleor-app.ts" find ./all_apps/apps -name "next.config.js" -exec cargo run --package modify-next-config -- {} \; >/dev/null 2>&1 -echo "pached all_apps/apps/**/saleor-app.ts" +echo "pached all_apps/apps/**/next.config.js" find ./all_apps/saleor-app-abandoned-checkouts -name "saleor-app.ts" -exec cargo run --package modify-saleor-app -- {} \; >/dev/null 2>&1 echo "pached all_apps/saleor-app-abandoned-checkouts/**/saleor-app.ts" diff --git a/changes/snippets/import-path-app-next.config.js b/changes/snippets/import-path-app-next.config.js index 71674eb..6e161f5 100644 --- a/changes/snippets/import-path-app-next.config.js +++ b/changes/snippets/import-path-app-next.config.js @@ -1 +1 @@ -const path = require("path"); +import * as path from "path"; diff --git a/emails.test.env b/emails.test.env index f86ddf8..84a4c55 100644 --- a/emails.test.env +++ b/emails.test.env @@ -1,6 +1,7 @@ -REDIS_URL=redis://redis-apl:6379/1 +REDIS_URL=redis://localhost:6380/2 +PORT=3010 APL=redis SECRET_KEY=idS8Oedýžfmg90S87Edfgnm90S87Dmfgiosuhbfs -APP_IFRAME_BASE_URL=https://app-emails.kremik.sk -APP_API_BASE_URL=https://app-emails.kremik.sk -APP_LOG_LEVEL=info +APP_IFRAME_BASE_URL=http://10.100.110.21:3010 +APP_API_BASE_URL=http://10.100.110.21:3010 +APP_LOG_LEVEL=trace