Skip to content

Commit

Permalink
copy cdp-local-envs usb scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherjturner committed Dec 17, 2024
1 parent c2ff746 commit 2f8b625
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 13 deletions.
4 changes: 4 additions & 0 deletions docker/scripts/mongodb/10-cdp-user-service-backend-users.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ db.users.updateOne(
createdAt: "2023-10-26T12:51:00.028Z",
updatedAt: "2023-10-26T12:51:00.028Z",
teams: ["aabe63e7-87ef-4beb-a596-c810631fc474"],
scopes: [
new ObjectId("6750708d454fcbbcc1568154")
],
},
},
{ upsert: true }
Expand All @@ -35,6 +38,7 @@ db.users.updateOne(
createdAt: "2024-11-11T13:51:00.028Z",
updatedAt: "2024-11-12T13:24:00.028Z",
teams: ["44c7fa74-40e7-470d-a18a-b78a60bbef8e"],
scopes:[]
},
},
{ upsert: true }
Expand Down
69 changes: 56 additions & 13 deletions docker/scripts/mongodb/15-cdp-user-service-backend-teams.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
db = db.getSiblingDB("cdp-user-service-backend");

db.scopes.updateOne(
{
value: "externalTest"
},
{
$setOnInsert: {
_id: new ObjectId("674def9d30093e3a3aa49d35"),
userId: "90552794-0613-4023-819a-512aa9d40023",
value: "externalTest",
teams: [
"aabe63e7-87ef-4beb-a596-c810631fc474"
],
createdAt: "2024-12-02T17:34:21.295Z",
updatedAt: "2024-12-02T17:34:21.295Z"
},
},
{ upsert: true }
);

db.scopes.updateOne(
{
value: "breakglass"
},
{
$setOnInsert: {
_id: new ObjectId("6750708d454fcbbcc1568154"),
userId: "90552794-0613-4023-819a-512aa9d40023",
value: "breakGlass",
teams: [
],
createdAt: "2024-12-02T17:34:21.295Z",
updatedAt: "2024-12-02T17:34:21.295Z"
},

},
{ upsert: true }
);


db.teams.updateOne(
{
name: "Platform",
Expand All @@ -11,6 +50,9 @@ db.teams.updateOne(
description: "The team that runs the platform",
github: "cdp-platform",
users: ["90552794-0613-4023-819a-512aa9d40023"],
scopes: [
new ObjectId("674def9d30093e3a3aa49d35")
],
createdAt: "2023-10-26T12:51:00.028Z",
updatedAt: "2023-10-26T12:51:00.028Z",
},
Expand All @@ -19,19 +61,20 @@ db.teams.updateOne(
);

db.teams.updateOne(
{
{
name: "TenantTeam1",
},
{
$setOnInsert: {
_id: "44c7fa74-40e7-470d-a18a-b78a60bbef8e",
name: "TenantTeam1",
description: "A test team",
github: "cdp-tenant-1",
users: [],
scopes: [],
createdAt: "2024-10-26T12:51:00.028Z",
updatedAt: "2024-10-26T12:55:00.028Z",
},
{
$setOnInsert: {
_id: "44c7fa74-40e7-470d-a18a-b78a60bbef8e",
name: "TenantTeam1",
description: "A test team",
github: "cdp-tenant-1",
users: [],
createdAt: "2024-10-26T12:51:00.028Z",
updatedAt: "2024-10-26T12:55:00.028Z",
},
},
{ upsert: true }
},
{ upsert: true }
);

0 comments on commit 2f8b625

Please sign in to comment.