-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmagefile.go
More file actions
52 lines (45 loc) · 1.27 KB
/
magefile.go
File metadata and controls
52 lines (45 loc) · 1.27 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//go:build mage
// +build mage
package main
import (
"github.com/magefile/mage/mg"
// mage:import
"github.com/dictyBase/modware-import/internal/runner"
// mage:import stock
_ "github.com/dictyBase/modware-import/internal/runner/stock"
stock "github.com/dictyBase/modware-import/internal/runner/stock"
// mage:import ontology
_ "github.com/dictyBase/modware-import/internal/runner/ontology"
onto "github.com/dictyBase/modware-import/internal/runner/ontology"
// mage:import data
_ "github.com/dictyBase/modware-import/internal/runner/data"
data "github.com/dictyBase/modware-import/internal/runner/data"
)
var dbs = []string{"stock", "annotation", "order"}
// CleanAll deletes all data from stock,order and annotation databases
func CleanAllDB() error {
for _, db := range dbs {
mg.Deps(mg.F(runner.CleanDB, db))
}
return nil
}
// LoadData will do the following steps...
// i) Refresh ontology from github repository to s3 storage.
//
// Requires a git ref.
//
// ii) Load ontology in database
// iii) Refresh data from github repository to s3 storage.
//
// Requires a git ref.
//
// iv) Load data
func LoadData(gitref string) error {
mg.SerialDeps(
mg.F(onto.Load, "obojson", gitref),
mg.F(data.Refresh, gitref),
stock.LoadStrain,
stock.LoadPlasmid,
)
return nil
}