-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐳 : add scripts to initiate mongo database
- Loading branch information
1 parent
cdf3d2e
commit 3aff994
Showing
7 changed files
with
136 additions
and
5 deletions.
There are no files selected for viewing
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,3 @@ | ||
FROM mongo | ||
|
||
COPY /src/test/resources/db/*.js /docker-entrypoint-initdb.d/ |
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 |
---|---|---|
@@ -1,10 +1,15 @@ | ||
version: "3" | ||
services: | ||
gaia: | ||
image: gaia | ||
build: . | ||
image: gaia | ||
ports: | ||
- '8080:8080' | ||
- '8080:8080' | ||
environment: | ||
- "GAIA_MONGODB_URI=mongodb://mongo/gaia" | ||
- "GAIA_MONGODB_URI=mongodb://mongo/gaia" | ||
|
||
mongo: | ||
image: mongo | ||
build: | ||
context: . | ||
dockerfile: ./Dockerfile-db | ||
image: gaia-db |
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,10 @@ | ||
let gaia = db.getSiblingDB('gaia'); | ||
gaia.team.drop(); | ||
gaia.team.insert([ | ||
{ | ||
"_id": "Ze Team" | ||
}, | ||
{ | ||
"_id": "Not Ze Team" | ||
} | ||
]); |
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,12 @@ | ||
gaia = db.getSiblingDB('gaia'); | ||
gaia.user.drop(); | ||
gaia.user.insert([ | ||
{ | ||
"_id": "admin", | ||
"team": {"$ref": "team", "$id": "Ze Team"} | ||
}, | ||
{ | ||
"_id": "Mary J", | ||
"team": {"$ref": "team", "$id": "Not Ze Team"} | ||
} | ||
]); |
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 @@ | ||
gaia = db.getSiblingDB('gaia'); | ||
gaia.terraformModule.drop(); | ||
gaia.terraformModule.insert([ | ||
{ | ||
"_id": "e01f9925-a559-45a2-8a55-f93dc434c676", | ||
"name": "terraform-docker-mongo", | ||
"description": "A sample terraform 🌍 module for running a mongodb 🍃 database inside a docker 🐳 container", | ||
"gitRepositoryUrl": "https://github.com/juwit/terraform-docker-mongo.git", | ||
"directory": null, | ||
"gitBranch": "master", | ||
"cliVersion": "0.11.14", | ||
"authorizedTeams": [{"$ref": "team", "$id": "Ze Team"}], | ||
"estimatedMonthlyCost": 0.99, | ||
"estimatedMonthlyCostDescription": "Kamoulox", | ||
"variables": [ | ||
{ | ||
"name": "mongo_container_name", | ||
"description": "the name of the docker container", | ||
"defaultValue": null, | ||
"editable": true | ||
}, | ||
{ | ||
"name": "mongo_exposed_port", | ||
"description": "the exposed port of the mongo container", | ||
"defaultValue": null, | ||
"editable": true | ||
} | ||
] | ||
}, | ||
{ | ||
"_id": "845543d0-20a5-466c-8978-33c9a4661606", | ||
"name": "terraform-docker-mongo-limited", | ||
"description": "A module only visible by admin and team Not Ze Team", | ||
"gitRepositoryUrl": "https://github.com/juwit/terraform-docker-mongo.git", | ||
"directory": null, | ||
"gitBranch": "master", | ||
"cliVersion": "0.11.14", | ||
"authorizedTeams": [{"$ref": "team", "$id": "Not Ze Team"}], | ||
"estimatedMonthlyCost": 9.99, | ||
"estimatedMonthlyCostDescription": "Not Ze Team! Not Ze Team!", | ||
"variables": [] | ||
}, | ||
]); |
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,52 @@ | ||
gaia = db.getSiblingDB('gaia'); | ||
gaia.stack.drop(); | ||
gaia.stack.insert([ | ||
{ | ||
"_id": "5a215b6b-fe53-4afa-85f0-a10175a7f264", | ||
"moduleId": "e01f9925-a559-45a2-8a55-f93dc434c676", | ||
"name": "mongo-instance-1", | ||
"description": "first instance of mongo module", | ||
"variableValues": { | ||
"mongo_container_name": "test", | ||
"mongo_exposed_port": "27117" | ||
}, | ||
"providerSpec": "provider \"docker\" {\n host = \"unix:///var/run/docker.sock\"\n}", | ||
"state": "NEW", | ||
"ownerTeam": {"$ref": "team", "$id": "Ze Team"}, | ||
"estimatedRunningCost": null, | ||
"createdBy": {"$ref": "user", "$id": "admin"}, | ||
"createdAt": new Date(), | ||
"updatedBy": null, | ||
"updatedAt": null | ||
}, | ||
{ | ||
"_id": "143773fa-4c2e-4baf-a7fb-79d23e01c5ca", | ||
"moduleId": "e01f9925-a559-45a2-8a55-f93dc434c676", | ||
"name": "mongo-instance-2", | ||
"description": "second instance of mongo module", | ||
"variablesValues": {}, | ||
"providerSpec": null, | ||
"state": "NEW", | ||
"ownerTeam": {"$ref": "team", "$id": "Ze Team"}, | ||
"estimatedRunningCost": null, | ||
"createdBy": {"$ref": "user", "$id": "admin"}, | ||
"createdAt": new Date(), | ||
"updatedBy": null, | ||
"updatedAt": null | ||
}, | ||
{ | ||
"_id": "845543d0-20a5-466c-8978-33c9a4661606", | ||
"moduleId": "845543d0-20a5-466c-8978-33c9a4661606", | ||
"name": "mongo-instance-limited", | ||
"description": "instance of mongo module for team Not Ze Team", | ||
"variablesValues": {}, | ||
"providerSpec": null, | ||
"state": "NEW", | ||
"ownerTeam": {"$ref": "team", "$id": "Not Ze Team"}, | ||
"estimatedRunningCost": null, | ||
"createdBy": {"$ref": "user", "$id": "Mary J"}, | ||
"createdAt": new Date(), | ||
"updatedBy": null, | ||
"updatedAt": null | ||
} | ||
]); |