-
Notifications
You must be signed in to change notification settings - Fork 6
/
mounts.go
69 lines (63 loc) · 1.3 KB
/
mounts.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
package question
import (
"context"
"github.com/platformsh/platformify/internal/question/models"
)
type Mounts struct{}
func (q *Mounts) Ask(ctx context.Context) error {
answers, ok := models.FromContext(ctx)
if !ok {
return nil
}
switch answers.Stack {
case models.Laravel:
answers.Disk = "2048" // in MB
answers.Mounts = map[string]map[string]string{
"storage": {
"source": "local",
"source_path": "storage",
},
"bootstrap/cache": {
"source": "local",
"source_path": "cache",
},
"/.config": {
"source": "local",
"source_path": "config",
},
}
case models.NextJS:
answers.Disk = "512" // in MB
answers.Mounts = map[string]map[string]string{
"/.npm": {
"source": "local",
"source_path": "npm",
},
}
case models.Strapi:
answers.Disk = "1024" // in MB
answers.Mounts = map[string]map[string]string{
"/.cache": {
"source": "local",
"source_path": "cache",
},
"/.tmp": {
"source": "local",
"source_path": "app",
},
"database": {
"source": "local",
"source_path": "database",
},
"extensions": {
"source": "local",
"source_path": "extensions",
},
"public/uploads": {
"source": "local",
"source_path": "uploads",
},
}
}
return nil
}