Skip to content

Commit 6fcbd14

Browse files
authored
Separate tracker deployment (#1245)
Signed-off-by: Andrey Sobolev <[email protected]>
1 parent 8cd1797 commit 6fcbd14

File tree

56 files changed

+904
-215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+904
-215
lines changed

Diff for: .github/workflows/main.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
packages
7070
plugins
7171
pods
72+
products
7273
server
7374
server-plugins
7475
templates
@@ -99,6 +100,7 @@ jobs:
99100
packages
100101
plugins
101102
pods
103+
products
102104
server
103105
server-plugins
104106
templates
@@ -132,6 +134,7 @@ jobs:
132134
packages
133135
plugins
134136
pods
137+
products
135138
server
136139
server-plugins
137140
templates
@@ -165,6 +168,7 @@ jobs:
165168
packages
166169
plugins
167170
pods
171+
products
168172
server
169173
server-plugins
170174
templates
@@ -210,6 +214,7 @@ jobs:
210214
packages
211215
plugins
212216
pods
217+
products
213218
server
214219
server-plugins
215220
templates
@@ -222,9 +227,9 @@ jobs:
222227
- name: Installing...
223228
run: node common/scripts/install-run-rush.js install
224229
- name: Bundle
225-
run: node common/scripts/install-run-rush.js bundle
230+
run: node common/scripts/install-run-rush.js bundle --verbose
226231
- name: Docker build
227-
run: node common/scripts/install-run-rush.js docker:build
232+
run: node common/scripts/install-run-rush.js docker:build --verbose
228233
- name: Prepare server
229234
run: |
230235
cd ./tests
@@ -266,6 +271,7 @@ jobs:
266271
packages
267272
plugins
268273
pods
274+
products
269275
server
270276
server-plugins
271277
templates

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,5 @@ common/autoinstallers/*/.npmrc
7070
**/.rush/temp/
7171
bundle.js
7272
dist
73-
tsconfig.tsbuildinfo
73+
tsconfig.tsbuildinfo
74+
ingest-attachment-*.zip

Diff for: common/config/rush/pnpm-lock.yaml

+157-109
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: common/scripts/build_docker.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
roots='./server/server ./server/front ./pods/account'
3+
roots='./server/server ./server/front ./pods/account ./products/tracker'
44

55
for r in $roots
66
do

Diff for: dev/client-resources/src/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export default async () => {
3535
await createDeps(client)
3636
}
3737
// Check if we had dev hook for client.
38-
// Check if we had dev hook for client.
3938
const hook = getMetadata(clientPlugin.metadata.ClientHook)
4039
if (hook !== undefined) {
4140
const hookProc = await getResource(hook)

Diff for: dev/docker-compose.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,26 @@ services:
7676
- MINIO_ENDPOINT=minio
7777
- MINIO_ACCESS_KEY=minioadmin
7878
- MINIO_SECRET_KEY=minioadmin
79+
tracker-front:
80+
image: hardcoreeng/tracker-front
81+
links:
82+
- mongodb
83+
- minio
84+
- elastic
85+
- transactor
86+
ports:
87+
- 8084:8080
88+
environment:
89+
- SERVER_PORT=8080
90+
- SERVER_SECRET=secret
91+
- ACCOUNTS_URL=http://localhost:3000
92+
- FRONT_URL=http://localhost:8084
93+
- UPLOAD_URL=/files
94+
- TRANSACTOR_URL=ws://localhost:3333
95+
- ELASTIC_URL=http://elastic:9200
96+
- MINIO_ENDPOINT=minio
97+
- MINIO_ACCESS_KEY=minioadmin
98+
- MINIO_SECRET_KEY=minioadmin
7999
transactor:
80100
image: hardcoreeng/transactor
81101
links:

Diff for: dev/prod/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "prod",
2+
"name": "@anticrm/prod",
33
"version": "1.0.1",
44
"license": "EPL-2.0",
55
"scripts": {
@@ -134,6 +134,7 @@
134134
"@anticrm/presentation": "~0.6.2",
135135
"@anticrm/tracker": "~0.6.0",
136136
"@anticrm/tracker-assets": "~0.6.0",
137-
"@anticrm/tracker-resources": "~0.6.0"
137+
"@anticrm/tracker-resources": "~0.6.0",
138+
"@anticrm/text-editor": "~0.6.0"
138139
}
139140
}

Diff for: dev/prod/src/platform.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,18 @@ import '@anticrm/notification-assets'
5858
import '@anticrm/tags-assets'
5959
import '@anticrm/calendar-assets'
6060
import '@anticrm/tracker-assets'
61-
import presentation from '@anticrm/presentation'
61+
import presentation, { presentationId } from '@anticrm/presentation'
62+
import { coreId } from '@anticrm/core'
63+
import { textEditorId } from '@anticrm/text-editor'
6264

6365
import { setMetadata } from '@anticrm/platform'
66+
67+
6468
export async function configurePlatform() {
6569
const config = await (await fetch('/config.json')).json()
6670
console.log('loading configuration', config)
6771
setMetadata(login.metadata.AccountsUrl, config.ACCOUNTS_URL)
6872
setMetadata(login.metadata.UploadUrl, config.UPLOAD_URL)
69-
7073

7174
if( config.MODEL_VERSION != null) {
7275
console.log('Minimal Model version requirement', config.MODEL_VERSION)
@@ -81,6 +84,10 @@ export async function configurePlatform() {
8184

8285
setMetadata(uiPlugin.metadata.DefaultApplication, workbench.component.WorkbenchApp )
8386

87+
addLocation(coreId, async () => ({ default: async () => ({}) }))
88+
addLocation(presentationId, async () => ({ default: async () => ({}) }))
89+
addLocation(textEditorId, async () => ({ default: async () => ({}) }))
90+
8491
addLocation(clientId, () => import(/* webpackChunkName: "client" */ '@anticrm/client-resources'))
8592
addLocation(loginId, () => import(/* webpackChunkName: "login" */ '@anticrm/login-resources'))
8693
addLocation(workbenchId, () => import(/* webpackChunkName: "workbench" */ '@anticrm/workbench-resources'))
@@ -103,4 +110,6 @@ export async function configurePlatform() {
103110
addLocation(calendarId, () => import(/* webpackChunkName: "calendar" */ '@anticrm/calendar-resources'))
104111

105112
addLocation(trackerId, () => import(/* webpackChunkName: "tracker" */ '@anticrm/tracker-resources'))
113+
114+
setMetadata(workbench.metadata.PlatformTitle, 'Platform')
106115
}

Diff for: models/all/src/creation.ts

+2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ import { createDeps as createTaskDeps } from '@anticrm/model-task'
1818
import { createDeps as createLeadDeps } from '@anticrm/model-lead'
1919
import { createDeps as createRecruitDeps } from '@anticrm/model-recruit'
2020
import { createDeps as createDemoDeps } from '@anticrm/model-demo'
21+
import { createDeps as createTrackerDeps } from '@anticrm/model-tracker'
2122

2223
export async function createDeps (client: Client): Promise<void> {
2324
await createTaskDeps(client)
2425
await createLeadDeps(client)
2526
await createRecruitDeps(client)
2627
await createDemoDeps(client)
28+
await createTrackerDeps(client)
2729
}

Diff for: models/all/src/index.ts

+54-39
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414
//
1515

16-
import core, { Data, Version } from '@anticrm/core'
16+
import core, { coreId, Data, PluginConfiguration, Ref, Tx, Version } from '@anticrm/core'
1717
import jsonVersion from './version.json'
1818

1919
import { Builder } from '@anticrm/model'
@@ -58,47 +58,62 @@ export const version: Data<Version> = jsonVersion as Data<Version>
5858

5959
const builder = new Builder()
6060

61-
const builders = [
62-
coreModel,
63-
activityModel,
64-
attachmentModel,
65-
viewModel,
66-
workbenchModel,
67-
contactModel,
68-
chunterModel,
69-
taskModel,
70-
recruitModel,
71-
settingModel,
72-
telegramModel,
73-
leadModel,
74-
gmailModel,
75-
inventoryModel,
76-
presentationModel,
77-
templatesModel,
78-
textEditorModel,
79-
notificationModel,
80-
serverCoreModel,
81-
serverAttachmentModel,
82-
serverContactModel,
83-
serverNotificationModel,
84-
serveSettingModel,
85-
tagsModel,
86-
calendarModel,
87-
serverChunterModel,
88-
serverInventoryModel,
89-
serverLeadModel,
90-
serverTagsModel,
91-
serverTaskModel,
92-
serverRecruitModel,
93-
serverCalendarModel,
94-
serverGmailModel,
95-
serverTelegramModel,
96-
trackerModel,
97-
createDemo
61+
const builders: [(b: Builder) => void, string][] = [
62+
[coreModel, coreId],
63+
[activityModel, 'activity'],
64+
[attachmentModel, 'attachment'],
65+
[viewModel, 'view'],
66+
[workbenchModel, 'workbench'],
67+
[contactModel, 'contact'],
68+
[chunterModel, 'chunter'],
69+
[taskModel, 'task'],
70+
[recruitModel, 'recruit'],
71+
[settingModel, 'setting'],
72+
[telegramModel, 'telegram'],
73+
[leadModel, 'lead'],
74+
[gmailModel, 'gmail'],
75+
[inventoryModel, 'inventory'],
76+
[presentationModel, 'presentation'],
77+
[templatesModel, 'templates'],
78+
[textEditorModel, 'text-editor'],
79+
[notificationModel, 'notification'],
80+
81+
[serverCoreModel, 'server-core'],
82+
[serverAttachmentModel, 'server-attachment'],
83+
[serverContactModel, 'server-contact'],
84+
[serverNotificationModel, 'server-notification'],
85+
[serveSettingModel, 'server-setting'],
86+
[tagsModel, 'tags'],
87+
[calendarModel, 'calendar'],
88+
[serverChunterModel, 'server-chunter'],
89+
[serverInventoryModel, 'server-inventory'],
90+
[serverLeadModel, 'server-lead'],
91+
[serverTagsModel, 'server-tags'],
92+
[serverTaskModel, 'server-task'],
93+
[serverRecruitModel, 'server-recruit'],
94+
[serverCalendarModel, 'server-calendar'],
95+
[serverGmailModel, 'server-gmail'],
96+
[serverTelegramModel, 'server-telegram'],
97+
[trackerModel, 'tracker'],
98+
[createDemo, 'demo']
9899
]
99100

100-
for (const b of builders) {
101+
for (const [b, id] of builders) {
102+
const txes: Tx[] = []
103+
builder.onTx = (tx) => {
104+
txes.push(tx)
105+
}
101106
b(builder)
107+
builder.createDoc(
108+
core.class.PluginConfiguration,
109+
core.space.Model,
110+
{
111+
pluginId: id,
112+
transactions: txes.map((it) => it._id)
113+
},
114+
('plugin-configuration-' + id) as Ref<PluginConfiguration>
115+
)
116+
builder.onTx = undefined
102117
}
103118

104119
builder.createDoc(core.class.Version, core.space.Model, version, core.version.Model)

Diff for: models/core/src/core.ts

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
ClassifierKind, Collection, Doc,
2121
Domain, DOMAIN_MODEL, IndexKind, Interface, Mixin,
2222
Obj,
23+
PluginConfiguration,
2324
Ref, RefTo, Space,
2425
Timestamp,
2526
Type, Version
@@ -143,3 +144,9 @@ export class TVersion extends TDoc implements Version {
143144
minor!: number
144145
patch!: number
145146
}
147+
148+
@Model(core.class.PluginConfiguration, core.class.Doc, DOMAIN_MODEL)
149+
export class TPluginConfiguration extends TDoc implements PluginConfiguration {
150+
pluginId!: string;
151+
transactions!: Ref<Doc>[]
152+
}

Diff for: models/core/src/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
TInterface,
2626
TMixin,
2727
TObj,
28+
TPluginConfiguration,
2829
TRefTo,
2930
TType,
3031
TTypeBoolean,
@@ -81,6 +82,7 @@ export function createModel (builder: Builder): void {
8182
TArrOf,
8283
TVersion,
8384
TTypeNumber,
84-
TTypeIntlString
85+
TTypeIntlString,
86+
TPluginConfiguration
8587
)
8688
}

Diff for: models/tracker/src/creation.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ export async function createDeps (client: Client): Promise<void> {
2424
_id: tracker.team.DefaultTeam
2525
})
2626

27-
if (current === undefined) {
27+
const currentDeleted = await tx.findOne(core.class.TxRemoveDoc, {
28+
objectId: tracker.team.DefaultTeam
29+
})
30+
31+
// Create new if not deleted by customers.
32+
if (current === undefined && currentDeleted === undefined) {
2833
await tx.createDoc<Team>(
2934
tracker.class.Team,
3035
core.space.Space,

Diff for: packages/core/src/classes.ts

+9
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ export interface Class<T extends Obj> extends Classifier {
146146
sortingKey?: string
147147
}
148148

149+
/**
150+
* @public
151+
* Define a set of plugin to model document bindings.
152+
*/
153+
export interface PluginConfiguration extends Doc {
154+
pluginId: string
155+
transactions: Ref<Doc>[]
156+
}
157+
149158
/**
150159
* @public
151160
*/

0 commit comments

Comments
 (0)