Rewrite README.md to remove rushx dev setup (#2526)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov 2023-01-24 18:36:45 +05:00 committed by GitHub
parent b5ca5e438b
commit 3daa9a3136
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 14 additions and 150 deletions

View File

@ -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

View File

@ -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

View File

@ -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"
}
}
]
}
'

View File

@ -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

View File

@ -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",

View File

@ -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()
}

View File

@ -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)

View File

@ -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

View File

@ -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",

View File

@ -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)