From 3daa9a3136b664a5fe6a3b5b46760a4fe45864a4 Mon Sep 17 00:00:00 2001 From: Vyacheslav Tumanov Date: Tue, 24 Jan 2023 18:36:45 +0500 Subject: [PATCH] Rewrite README.md to remove rushx dev setup (#2526) Signed-off-by: Vyacheslav Tumanov --- README.md | 33 +++++++----------- deploy/README.md | 2 -- deploy/setup-es-attachment-pipeline.sh | 32 ------------------ dev/prod/.env | 3 -- dev/prod/package.json | 1 - dev/prod/src/main-dev.ts | 5 +-- dev/prod/src/platform-dev.ts | 47 -------------------------- products/tracker/.env | 3 +- products/tracker/package.json | 1 - products/tracker/src/platform-dev.ts | 37 -------------------- 10 files changed, 14 insertions(+), 150 deletions(-) delete mode 100755 deploy/setup-es-attachment-pipeline.sh diff --git a/README.md b/README.md index fa46e62318..3b724092f5 100644 --- a/README.md +++ b/README.md @@ -6,35 +6,17 @@ Anticrm Platform is a framework that help building business applications (such a You need Microsoft's [rush](https://rushjs.io) to install application. Install [rush](https://rushjs.io) with `$ npm install -g @microsoft/rush` command and run `$ rush install` from the repository root, followed by `$ rush build`. -## Run in development mode - -``` -cd dev/prod -rushx dev -``` - -Then go to http://localhost:8080/login:component:LoginApp and use following credentials to login into the system: - -- login: rosamund@hc.engineering -- pass: 1111 -- workspace: trx40 - -To connect to running local server `dev-server` command should be used instead. - ## Build and run inside docker It is possible to setup all environment required with local docker containers. Supported both amd64 and armv8 containers. ```bash +cd ./dev/ rush build # Will build all required packages. rush bundle # Will prepare bundles. rush docker:build # Will build docker containers for all applications. -cd ./dev/ docker-compose up -d --force-recreate # Will setup all containers - -# wait a few seconds delay, to be sure elastic is up and running. -./deploy/setup-es-attachment-pipeline.sh # Setup elastic search plugin configuration. ``` By default docker volumes `dev_db` `dev_elastic` `dev_files` will be created for mongo/elastic/minio instances. @@ -42,13 +24,22 @@ By default docker volumes `dev_db` `dev_elastic` `dev_files` will be created for Before we could start we need to create workspace/account and associate it with workspace. ```bash -cd ./dev/tool +cd ./tool rushx run-local create-workspace ws1 -o DevWorkspace # Create workspace rushx run-local create-account user1 -p 1234 -f John -l Appleseed # Create account rushx run-local assign-workspace user1 ws1 # Assign worksapce to user ``` -Following URL http://localhost:8087/login:component:LoginApp will lead us to app. +Following URL http://localhost:8087/login:component:LoginApp will lead us to app in production mode. + +## Run in development mode + +``` +cd dev/prod +rushx dev-server +``` + +Then go to http://localhost:8080/login:component:LoginApp ## Update project structure and database diff --git a/deploy/README.md b/deploy/README.md index d1533e14fc..8bb248aea6 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -4,8 +4,6 @@ We need [MongoDb](https://www.mongodb.com), [Elastic Search](https://www.elastic.co), and [MinIO](https://www.min.io) servers installed on the network/cloud. You should have credentials to access these servers to continue deployment. -ElasticSearch should have `ingest` plugin installed. - ## Secrets `secret.yaml` provide exemplary configuration values to access data storage servers. Provide correct values and diff --git a/deploy/setup-es-attachment-pipeline.sh b/deploy/setup-es-attachment-pipeline.sh deleted file mode 100755 index 7e232589d5..0000000000 --- a/deploy/setup-es-attachment-pipeline.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# -# Copyright © 2020, 2021 Anticrm Platform Contributors. -# Copyright © 2021 Hardcore Engineering Inc. -# -# Licensed under the Eclipse Public License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. You may -# obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# -# See the License for the specific language governing permissions and -# limitations under the License. -# - -curl -XPUT "localhost:9200/_ingest/pipeline/attachment?pretty" -H 'Content-Type: application/json' -d' -{ - "description" : "Field for processing file attachments", - "processors" : [ - { - "attachment" : { - "field" : "data" - }, - "remove" : { - "field" : "data" - } - } - ] -} -' diff --git a/dev/prod/.env b/dev/prod/.env index 5250084f4b..78e6b5d079 100644 --- a/dev/prod/.env +++ b/dev/prod/.env @@ -1,9 +1,6 @@ LOGIN_ENDPOINT=ws://localhost:3333 -LOGIN_TOKEN_DEV=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6InJvc2FtdW5kQGhjLmVuZ2luZWVyaW5nIiwid29ya3NwYWNlIjoidHJ4NDAifQ.dYsCF2VRbuc-zmRt0yLAww1_--xtX4P1EqPFREEzCjQ -LOGIN_ENDPOINT_DEV=wss://transactor.hc.engineering/ - TELEGRAM_URL=http://localhost:8086 FRONT_URL=http://localhost:8080 diff --git a/dev/prod/package.json b/dev/prod/package.json index dd0764c20b..d65d932a58 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -7,7 +7,6 @@ "build": "rm -rf ./dist && cross-env NODE_ENV=production webpack --stats-error-details && echo 'done'", "analyze": "cross-env NODE_ENV=production webpack --json > stats.json", "show": "webpack-bundle-analyzer stats.json dist", - "dev": "cross-env CLIENT_TYPE=dev webpack serve", "dev-server": "cross-env CLIENT_TYPE=dev-server webpack serve", "start": "cross-env NODE_ENV=production webpack serve", "preformat-svelte": "prettier -w src/**/*.svelte", diff --git a/dev/prod/src/main-dev.ts b/dev/prod/src/main-dev.ts index c4c3974c5b..84d9b7a909 100644 --- a/dev/prod/src/main-dev.ts +++ b/dev/prod/src/main-dev.ts @@ -16,12 +16,9 @@ import { createApp } from '@hcengineering/ui' import { configurePlatform } from './platform' -import { configurePlatformDev, configurePlatformDevServer } from './platform-dev' +import { configurePlatformDevServer } from './platform-dev' configurePlatform().then(() => { - if (process.env.CLIENT_TYPE === 'dev') { - configurePlatformDev() - } if (process.env.CLIENT_TYPE === 'dev-server') { configurePlatformDevServer() } diff --git a/dev/prod/src/platform-dev.ts b/dev/prod/src/platform-dev.ts index 9628b24d34..3c89fbbea3 100644 --- a/dev/prod/src/platform-dev.ts +++ b/dev/prod/src/platform-dev.ts @@ -14,58 +14,11 @@ // import { addLocation } from '@hcengineering/platform' - import login from '@hcengineering/login' -import { clientId } from '@hcengineering/client' -import { serverAttachmentId } from '@hcengineering/server-attachment' -import { serverContactId } from '@hcengineering/server-contact' -import { serverNotificationId } from '@hcengineering/server-notification' -import { serverSettingId } from '@hcengineering/server-setting' -import { serverChunterId } from '@hcengineering/server-chunter' -import { serverInventoryId } from '@hcengineering/server-inventory' -import { serverLeadId } from '@hcengineering/server-lead' -import { serverRecruitId } from '@hcengineering/server-recruit' -import { serverTaskId } from '@hcengineering/server-task' -import { serverTrackerId } from '@hcengineering/server-tracker' -import { serverTagsId } from '@hcengineering/server-tags' -import { serverCalendarId } from '@hcengineering/server-calendar' -import { serverGmailId } from '@hcengineering/server-gmail' -import { serverTelegramId } from '@hcengineering/server-telegram' -import { serverHrId } from '@hcengineering/server-hr' -import { serverRequestId } from '@hcengineering/server-request' - import { setMetadata } from '@hcengineering/platform' - import devmodel, { devModelId } from '@hcengineering/devmodel' import client from '@hcengineering/client' -export function configurePlatformDev() { - setMetadata(login.metadata.OverrideLoginToken, process.env.LOGIN_TOKEN_DEV) - setMetadata(login.metadata.OverrideEndpoint, process.env.LOGIN_ENDPOINT_DEV) - console.log('Use DEV server') - addLocation(clientId, () => import(/* webpackChunkName: "client-dev" */ '@hcengineering/dev-client-resources')) - - addLocation(serverAttachmentId, () => import(/* webpackChunkName: "server-attachment" */ '@hcengineering/server-attachment-resources')) - addLocation(serverContactId, () => import(/* webpackChunkName: "server-contact" */ '@hcengineering/server-contact-resources')) - addLocation(serverNotificationId, () => import(/* webpackChunkName: "server-notification" */ '@hcengineering/server-notification-resources')) - addLocation(serverSettingId, () => import(/* webpackChunkName: "server-setting" */ '@hcengineering/server-setting-resources')) - addLocation(serverChunterId, () => import(/* webpackChunkName: "server-chunter" */ '@hcengineering/server-chunter-resources')) - addLocation(serverInventoryId, () => import(/* webpackChunkName: "server-inventory" */ '@hcengineering/server-inventory-resources')) - addLocation(serverLeadId, () => import(/* webpackChunkName: "server-lead" */ '@hcengineering/server-lead-resources')) - addLocation(serverRecruitId, () => import(/* webpackChunkName: "server-recruit" */ '@hcengineering/server-recruit-resources')) - addLocation(serverTaskId, () => import/* webpackChunkName: "server-task" */ ('@hcengineering/server-task-resources')) - addLocation(serverTrackerId, () => import/* webpackChunkName: "server-tracker" */ ('@hcengineering/server-tracker-resources')) - addLocation(serverTagsId, () => import/* webpackChunkName: "server-tags" */ ('@hcengineering/server-tags-resources')) - addLocation(serverCalendarId, () => import/* webpackChunkName: "server-calendar" */ ('@hcengineering/server-calendar-resources')) - addLocation(serverGmailId, () => import/* webpackChunkName: "server-gmail" */ ('@hcengineering/server-gmail-resources')) - addLocation(serverTelegramId, () => import/* webpackChunkName: "server-telegram" */ ('@hcengineering/server-telegram-resources')) - addLocation(serverHrId, () => import(/* webpackChunkName: "server-hr" */ '@hcengineering/server-hr-resources')) - addLocation(serverRequestId, () => import(/* webpackChunkName: "server-request" */ '@hcengineering/server-request-resources')) - // Set devmodel to hook client to be able to present all activity - enableDevModel() -} - - export function configurePlatformDevServer() { console.log('Use Endpoint override:', process.env.LOGIN_ENDPOINT) setMetadata(login.metadata.OverrideEndpoint, process.env.LOGIN_ENDPOINT) diff --git a/products/tracker/.env b/products/tracker/.env index b47965b311..704c6cb146 100644 --- a/products/tracker/.env +++ b/products/tracker/.env @@ -1,8 +1,7 @@ LOGIN_ENDPOINT=ws://localhost:3333 -LOGIN_TOKEN_DEV=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6InJvc2FtdW5kQGhjLmVuZ2luZWVyaW5nIiwid29ya3NwYWNlIjoidHJ4NDAifQ.dYsCF2VRbuc-zmRt0yLAww1_--xtX4P1EqPFREEzCjQ -LOGIN_ENDPOINT_DEV=wss://transactor.hc.engineering/ + TELEGRAM_URL=http://localhost:8086 FRONT_URL=http://localhost:8080 diff --git a/products/tracker/package.json b/products/tracker/package.json index 0ec5227e74..1cc938ab54 100644 --- a/products/tracker/package.json +++ b/products/tracker/package.json @@ -12,7 +12,6 @@ "*docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/tracker-front", "analyze": "cross-env NODE_ENV=production webpack --json > stats.json", "show": "webpack-bundle-analyzer stats.json dist", - "dev": "cross-env CLIENT_TYPE=dev webpack serve", "dev-server": "cross-env CLIENT_TYPE=dev-server webpack serve", "start": "cross-env NODE_ENV=production webpack serve", "preformat-svelte": "prettier -w src/**/*.svelte", diff --git a/products/tracker/src/platform-dev.ts b/products/tracker/src/platform-dev.ts index 9be8307447..3c89fbbea3 100644 --- a/products/tracker/src/platform-dev.ts +++ b/products/tracker/src/platform-dev.ts @@ -14,48 +14,11 @@ // import { addLocation } from '@hcengineering/platform' - import login from '@hcengineering/login' -import { clientId } from '@hcengineering/client' -import { serverAttachmentId } from '@hcengineering/server-attachment' -import { serverContactId } from '@hcengineering/server-contact' -import { serverNotificationId } from '@hcengineering/server-notification' -import { serverSettingId } from '@hcengineering/server-setting' -import { serverChunterId } from '@hcengineering/server-chunter' -import { serverTaskId } from '@hcengineering/server-task' -import { serverTrackerId } from '@hcengineering/server-tracker' -import { serverCalendarId } from '@hcengineering/server-calendar' -import { serverGmailId } from '@hcengineering/server-gmail' -import { serverTelegramId } from '@hcengineering/server-telegram' - - import { setMetadata } from '@hcengineering/platform' - import devmodel, { devModelId } from '@hcengineering/devmodel' import client from '@hcengineering/client' -export function configurePlatformDev() { - setMetadata(login.metadata.OverrideLoginToken, process.env.LOGIN_TOKEN_DEV) - setMetadata(login.metadata.OverrideEndpoint, process.env.LOGIN_ENDPOINT_DEV) - console.log('Use DEV server') - addLocation(clientId, () => import(/* webpackChunkName: "client-dev" */ '@hcengineering/dev-client-resources')) - - addLocation(serverAttachmentId, () => import(/* webpackChunkName: "server-attachment" */ '@hcengineering/server-attachment-resources')) - addLocation(serverContactId, () => import(/* webpackChunkName: "server-contact" */ '@hcengineering/server-contact-resources')) - addLocation(serverNotificationId, () => import(/* webpackChunkName: "server-notification" */ '@hcengineering/server-notification-resources')) - addLocation(serverSettingId, () => import(/* webpackChunkName: "server-setting" */ '@hcengineering/server-setting-resources')) - addLocation(serverChunterId, () => import(/* webpackChunkName: "server-chunter" */ '@hcengineering/server-chunter-resources')) - addLocation(serverTaskId, () => import/* webpackChunkName: "server-task" */ ('@hcengineering/server-task-resources')) - addLocation(serverTrackerId, () => import/* webpackChunkName: "server-tracker" */ ('@hcengineering/server-tracker-resources')) - addLocation(serverCalendarId, () => import/* webpackChunkName: "server-calendar" */ ('@hcengineering/server-calendar-resources')) - addLocation(serverGmailId, () => import/* webpackChunkName: "server-gmail" */ ('@hcengineering/server-gmail-resources')) - addLocation(serverTelegramId, () => import/* webpackChunkName: "server-telegram" */ ('@hcengineering/server-telegram-resources')) - - // Set devmodel to hook client to be able to present all activity - enableDevModel() -} - - export function configurePlatformDevServer() { console.log('Use Endpoint override:', process.env.LOGIN_ENDPOINT) setMetadata(login.metadata.OverrideEndpoint, process.env.LOGIN_ENDPOINT)