Skip to content

Commit

Permalink
Merge branch 'main' into EW-1025
Browse files Browse the repository at this point in the history
  • Loading branch information
mkreuzkam-cap authored Oct 1, 2024
2 parents aabdda0 + 873e20c commit 88a0d1f
Show file tree
Hide file tree
Showing 59 changed files with 2,096 additions and 19 deletions.
6 changes: 6 additions & 0 deletions ansible/roles/common-cartridge/templates/deployment.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ kind: Deployment
metadata:
name: common-cartridge-deployment
namespace: {{ NAMESPACE }}
{% if ANNOTATIONS is defined and ANNOTATIONS|bool %}
annotations:
{% if RELOADER is defined and RELOADER|bool %}
reloader.stakater.com/auto: "true"
{% endif %}
{% endif %}
labels:
app: common-cartridge
app.kubernetes.io/part-of: schulcloud-verbund
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ kind: Deployment
metadata:
name: admin-api-deployment
namespace: {{ NAMESPACE }}
{% if ANNOTATIONS is defined and ANNOTATIONS|bool %}
annotations:
{% if RELOADER is defined and RELOADER|bool %}
reloader.stakater.com/auto: "true"
{% endif %}
{% endif %}
labels:
app: api-admin
app.kubernetes.io/part-of: schulcloud-verbund
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ kind: Deployment
metadata:
name: amqp-files-deployment
namespace: {{ NAMESPACE }}
{% if ANNOTATIONS is defined and ANNOTATIONS|bool %}
annotations:
{% if RELOADER is defined and RELOADER|bool %}
reloader.stakater.com/auto: "true"
{% endif %}
{% endif %}
labels:
app: amqp-files
app.kubernetes.io/part-of: schulcloud-verbund
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ kind: Deployment
metadata:
name: api-files-deployment
namespace: {{ NAMESPACE }}
{% if ANNOTATIONS is defined and ANNOTATIONS|bool %}
annotations:
{% if RELOADER is defined and RELOADER|bool %}
reloader.stakater.com/auto: "true"
{% endif %}
{% endif %}
labels:
app: api-files
app.kubernetes.io/part-of: schulcloud-verbund
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ kind: Deployment
metadata:
name: api-fwu-deployment
namespace: {{ NAMESPACE }}
{% if ANNOTATIONS is defined and ANNOTATIONS|bool %}
annotations:
{% if RELOADER is defined and RELOADER|bool %}
reloader.stakater.com/auto: "true"
{% endif %}
{% endif %}
labels:
app: api-fwu
app.kubernetes.io/part-of: schulcloud-verbund
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ kind: Deployment
metadata:
name: board-collaboration-deployment
namespace: {{ NAMESPACE }}
{% if ANNOTATIONS is defined and ANNOTATIONS|bool %}
annotations:
{% if RELOADER is defined and RELOADER|bool %}
reloader.stakater.com/auto: "true"
{% endif %}
{% endif %}
labels:
app: board-collaboration
app.kubernetes.io/part-of: schulcloud-verbund
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ kind: Deployment
metadata:
name: api-deployment
namespace: {{ NAMESPACE }}
{% if ANNOTATIONS is defined and ANNOTATIONS|bool %}
annotations:
{% if RELOADER is defined and RELOADER|bool %}
reloader.stakater.com/auto: "true"
{% endif %}
{% endif %}
labels:
app: api
app.kubernetes.io/part-of: schulcloud-verbund
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ kind: Deployment
metadata:
name: preview-generator-deployment
namespace: {{ NAMESPACE }}
{% if ANNOTATIONS is defined and ANNOTATIONS|bool %}
annotations:
{% if RELOADER is defined and RELOADER|bool %}
reloader.stakater.com/auto: "true"
{% endif %}
{% endif %}
labels:
app: preview-generator
app.kubernetes.io/part-of: schulcloud-verbund
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ kind: Deployment
metadata:
name: tldraw-deployment
namespace: {{ NAMESPACE }}
{% if ANNOTATIONS is defined and ANNOTATIONS|bool %}
annotations:
{% if RELOADER is defined and RELOADER|bool %}
reloader.stakater.com/auto: "true"
{% endif %}
{% endif %}
labels:
app: tldraw-server
app.kubernetes.io/part-of: schulcloud-verbund
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ kind: Deployment
metadata:
name: api-h5p-deployment
namespace: {{ NAMESPACE }}
{% if ANNOTATIONS is defined and ANNOTATIONS|bool %}
annotations:
{% if RELOADER is defined and RELOADER|bool %}
reloader.stakater.com/auto: "true"
{% endif %}
{% endif %}
labels:
app: api-h5p
app.kubernetes.io/part-of: schulcloud-verbund
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ kind: Deployment
metadata:
name: management-deployment
namespace: {{ NAMESPACE }}
{% if ANNOTATIONS is defined and ANNOTATIONS|bool %}
annotations:
{% if RELOADER is defined and RELOADER|bool %}
reloader.stakater.com/auto: "true"
{% endif %}
{% endif %}
labels:
app: management-deployment
app.kubernetes.io/part-of: schulcloud-verbund
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ kind: Deployment
metadata:
name: api-worker-deployment
namespace: {{ NAMESPACE }}
{% if ANNOTATIONS is defined and ANNOTATIONS|bool %}
annotations:
{% if RELOADER is defined and RELOADER|bool %}
reloader.stakater.com/auto: "true"
{% endif %}
{% endif %}
labels:
app: api-worker
app.kubernetes.io/part-of: schulcloud-verbund
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ kind: Deployment
metadata:
name: api-migration-systems-deployment
namespace: {{ NAMESPACE }}
{% if ANNOTATIONS is defined and ANNOTATIONS|bool %}
annotations:
{% if RELOADER is defined and RELOADER|bool %}
reloader.stakater.com/auto: "true"
{% endif %}
{% endif %}
labels:
app: api-migration-systems
app.kubernetes.io/part-of: schulcloud-verbund
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ kind: Deployment
metadata:
name: api-tsp-sync-deployment
namespace: {{ NAMESPACE }}
{% if ANNOTATIONS is defined and ANNOTATIONS|bool %}
annotations:
{% if RELOADER is defined and RELOADER|bool %}
reloader.stakater.com/auto: "true"
{% endif %}
{% endif %}
labels:
app: api-tsp-sync
app.kubernetes.io/part-of: schulcloud-verbund
Expand Down
40 changes: 40 additions & 0 deletions apps/server/src/infra/tsp-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# TSP API CLIENT

> A short introduction how this module can be used and the api client is generated.
## How to use the api client

The clients for the different Tsp endpoints should be created through TspClientFactory.
Through the create methods of the factory the basic configuration will be set. Currently the
factory sets the base url and generates the JWT used for the requests. You can use the client
like this:

```typescript
export class MyNewService {
// inject the factory into the constructor
constructor(private readonly tspClientFactory: TspClientFactory) {}

public async doSomeStuff(): Promise<void> {
// this will create a fully initialized client
const exportClient = tspClientFactory.createExportClient();

// calling the api
const versionResponse = await exportClient.version();


// do other stuff...
}
}
```

## How the code generation works

We are using the openapi-generator-cli to generate apis, models and supporting files in the
`generated` directory. **DO NOT** modify anything in the `generated` folder, because it will
be deleted on the next client generation.

The client generation is done with the npm command `npm run generate-client:tsp-api`. This
will delete the old and create new files. We are using the `tsp-api` generator configuration
from the `openapitools.json` found in the repository root. You can add new endpoints by
extending the `FILTER` list in the `openapiNormalizer` section with new `operationId` entries.
New models must be added to the list of `models` in the `globalProperty` section.
4 changes: 4 additions & 0 deletions apps/server/src/infra/tsp-client/generated/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
wwwroot/*.js
node_modules
typings
dist
1 change: 1 addition & 0 deletions apps/server/src/infra/tsp-client/generated/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.gitignore
.npmignore
.openapi-generator-ignore
api.ts
api/export-api.ts
base.ts
common.ts
configuration.ts
git_push.sh
index.ts
models/index.ts
models/robj-export-klasse.ts
models/robj-export-lehrer-migration.ts
models/robj-export-lehrer.ts
models/robj-export-schueler-migration.ts
models/robj-export-schueler.ts
models/robj-export-schule.ts
models/version-response.ts
18 changes: 18 additions & 0 deletions apps/server/src/infra/tsp-client/generated/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* TIP-Rest Api v1
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/



export * from './api/export-api';

Loading

0 comments on commit 88a0d1f

Please sign in to comment.