-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
29 lines (25 loc) · 968 Bytes
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
evaluationDependsOn ":client"
evaluationDependsOn ":server"
// Assumes our test database is named "test"
task clearMongoDB(type: Exec) {
group = 'Database'
description = 'Drops the local MongoDB test database'
executable "mongo"
args = ["test", "--eval", "printjson(db.dropDatabase())"]
}
task seedToDoData(type: Exec) {
group = 'Database'
description = 'Seeds the todos collection on local test DB using todos.seed.json'
executable = "mongoimport"
args = ["-d", "test", "-c", "todos", "--file", "todos.seed.json", "--jsonArray"]
}
task seedUserData(type: Exec) {
group = 'Database'
description = 'Seeds the users collection on local test DB using users.seed.json'
executable = "mongoimport"
args = ["-d", "test", "-c", "users", "--file", "users.seed.json", "--jsonArray"]
}
task seedMongoDB { }
seedMongoDB.dependsOn(clearMongoDB)
seedMongoDB.dependsOn(seedToDoData)
seedMongoDB.dependsOn(seedUserData)