Skip to content

Commit

Permalink
EW-1047: Add TSP System on Dev Environments
Browse files Browse the repository at this point in the history
  • Loading branch information
mkreuzkam-cap committed Oct 23, 2024
1 parent e98150b commit 677c792
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -559,5 +559,43 @@ data:

# ========== End of the Instance seed data configuration section.

# ========== Start of TSP system creation
if [[ $SC_THEME == "thr" ]]; then
echo "Adding TSP system to systems collection"

TSP_SYSTEM_OAUTH_CLIENT_SECRET=$(node scripts/secret.js -s $AES_KEY -e $TSP_SYSTEM_OAUTH_CLIENT_SECRET)
mongosh $DATABASE__URL --quiet --eval 'db.systems.insertOne(
{
"_id": ObjectId("66d707f5c5202ba10c5e6256"),
"alias": "TSP",
"displayName": "Thüringer Schulportal",
"type": "oauth",
"provisioningStrategy": "tsp",
"oauthConfig": {
"clientId": "'$TSP_SYSTEM_OAUTH_CLIENT_ID'",
"clientSecret": "'$TSP_SYSTEM_OAUTH_CLIENT_SECRET'",
"tokenEndpoint": "https://test2.schulportal-thueringen.de/auth/realms/TIS/protocol/openid-connect/token",
"grantType": "authorization_code",
"scope": "openid",
"responseType": "code",
"redirectUri": "https://{{ NAMESPACE }}.thr.dbildungscloud.dev/api/v3/sso/oauth",
"authEndpoint": "https://test2.schulportal-thueringen.de/auth/realms/TIS/protocol/openid-connect/auth",
"provider": "tsp",
"jwksEndpoint": "https://test2.schulportal-thueringen.de/auth/realms/TIS/protocol/openid-connect/certs",
"issuer": "https://test2.schulportal-thueringen.de/auth/realms/TIS"
}
}
);'

echo "Successfully added TSP system"

echo "Running TSP Sync"
npm run nest:start:sync tsp

echo "Successfully ran TSP sync"
fi

# ========== End of TSP system creation

# Database indexes synchronization, it's crucial until we have all the entities in NestJS app.
npm run syncIndexes

0 comments on commit 677c792

Please sign in to comment.