-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into BC-7772-introduce-ddd-objects
- Loading branch information
Showing
380 changed files
with
10,995 additions
and
1,482 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ npm-debug.log* | |
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
*.loadtest.json | ||
|
||
# Runtime data | ||
pids | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
ansible/roles/schulcloud-server-core/templates/tldraw-migration-job.yml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: tldraw-migration-job | ||
namespace: {{ NAMESPACE }} | ||
labels: | ||
app: tldraw-migration | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
app: tldraw-migration | ||
spec: | ||
securityContext: | ||
runAsUser: 1000 | ||
runAsGroup: 1000 | ||
fsGroup: 1000 | ||
runAsNonRoot: true | ||
containers: | ||
- name: tldraw-migration-job | ||
image: {{ SCHULCLOUD_SERVER_IMAGE }}:{{ SCHULCLOUD_SERVER_IMAGE_TAG }} | ||
imagePullPolicy: IfNotPresent | ||
# this is just for this job and should not be an example for anyone else | ||
envFrom: | ||
- configMapRef: | ||
name: api-configmap | ||
- secretRef: | ||
name: api-secret | ||
- secretRef: | ||
name: api-files-secret | ||
- secretRef: | ||
name: tldraw-server-secret | ||
command: ['/bin/sh','-c'] | ||
args: ['npm run nest:start:tldraw-console -- migration run'] | ||
resources: | ||
limits: | ||
cpu: {{ TLDRAW_MIGRATION_CPU_REQUESTS|default("2000m", true) }} | ||
memory: {{ TLDRAW_MIGRATION_MEMORY_REQUESTS|default("2Gi", true) }} | ||
requests: | ||
cpu: {{ TLDRAW_MIGRATION_CPU_REQUESTS|default("100m", true) }} | ||
memory: {{ TLDRAW_MIGRATION_MEMORY_REQUESTS|default("150Mi", true) }} | ||
restartPolicy: Never | ||
backoffLimit: 5 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { createMock } from '@golevelup/ts-jest'; | ||
import { Test } from '@nestjs/testing'; | ||
import { Logger } from '@src/core/logger'; | ||
import { SyncUc } from '../uc/sync.uc'; | ||
import { SyncConsole } from './sync.console'; | ||
|
||
describe(SyncConsole.name, () => { | ||
let syncConsole: SyncConsole; | ||
let syncUc: SyncUc; | ||
|
||
beforeAll(async () => { | ||
const module = await Test.createTestingModule({ | ||
providers: [ | ||
SyncConsole, | ||
{ | ||
provide: SyncUc, | ||
useValue: createMock<SyncUc>(), | ||
}, | ||
{ | ||
provide: Logger, | ||
useValue: createMock<Logger>(), | ||
}, | ||
], | ||
}).compile(); | ||
|
||
syncConsole = module.get(SyncConsole); | ||
syncUc = module.get(SyncUc); | ||
}); | ||
|
||
describe('when sync console is initialized', () => { | ||
it('should be defined', () => { | ||
expect(syncConsole).toBeDefined(); | ||
}); | ||
}); | ||
|
||
describe('startSync', () => { | ||
const setup = () => { | ||
const target = 'tsp'; | ||
return { target }; | ||
}; | ||
|
||
it('should call startSync method of syncUc', async () => { | ||
const { target } = setup(); | ||
await syncConsole.startSync(target); | ||
|
||
expect(syncUc.startSync).toHaveBeenCalledWith(target); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Logger } from '@src/core/logger'; | ||
import { Command, Console } from 'nestjs-console'; | ||
import { SyncUc } from '../uc/sync.uc'; | ||
|
||
@Console({ command: 'sync', description: 'Prefixes all synchronization related console commands.' }) | ||
export class SyncConsole { | ||
constructor(private readonly syncUc: SyncUc, private readonly logger: Logger) { | ||
this.logger.setContext(SyncConsole.name); | ||
} | ||
|
||
@Command({ | ||
command: 'run <target>', | ||
description: 'Starts the synchronization process.', | ||
}) | ||
public async startSync(target: string): Promise<void> { | ||
await this.syncUc.startSync(target); | ||
} | ||
} |
Oops, something went wrong.