/
main.go
91 lines (85 loc) · 1.69 KB
/
main.go
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package main
import (
"os"
"strconv"
"github.com/snowpal/pitch-building-blocks-sdk/lib/config"
"github.com/snowpal/pitch-building-blocks-sdk/lib/recipes"
log "github.com/sirupsen/logrus"
setupnewuser "github.com/snowpal/pitch-building-blocks-sdk/lib/recipes/recipe.14.setup_new_user"
)
func main() {
var err error
if config.Files, err = config.InitConfigFiles(); err != nil {
log.Fatal(err.Error())
return
}
var recipeID int
recipeIDInEnv := os.Getenv("RECIPE_ID")
if len(recipeIDInEnv) == 0 {
recipeID = 1
} else {
recipeID, err = strconv.Atoi(recipeIDInEnv)
if err != nil {
recipeID = 1
}
}
switch recipeID {
case 1:
log.Info("Run Recipe1")
recipes.RegisterFewUsers()
break
case 2:
log.Info("Run Recipe2")
recipes.GetResourceAttributes()
break
case 3:
log.Info("Run Recipe3")
recipes.CreatePrivateConversation()
break
case 4:
log.Info("Run Recipe4")
recipes.AddAndLinkResources()
break
case 5:
log.Info("Run Recipe5")
recipes.ShareBlock()
break
case 6:
log.Info("Run Recipe6")
recipes.GetAllKeys()
break
case 7:
log.Info("Run Recipe7")
recipes.AddFavorite()
break
case 8:
log.Info("Run Recipe8")
recipes.FetchScheduler()
break
case 9:
log.Info("Run Recipe9")
recipes.AddRelation()
break
case 10:
log.Info("Run Recipe10")
recipes.PublishStudentGrade()
break
case 11:
log.Info("Run Recipe11")
recipes.AddProjectList()
break
case 12:
log.Info("Run Recipe12")
recipes.GrantAclOnCustomBlock()
break
case 13:
log.Info("Run Recipe13")
recipes.UpdateAttributes()
break
case 14:
log.Info("Run Recipe14 - Set up New User")
setupnewuser.SetupNewUser()
default:
log.Info("pick a specific recipe to run")
}
}