forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifests.go
131 lines (121 loc) · 1.88 KB
/
manifests.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
package maker
var fixtureMap = map[string]string{
"merged services": `
---
services:
- global-service
applications:
- name: app-with-redis-backend
services:
- nested-service
- name: app2
services:
- app2-service
`,
"local services": `
---
applications:
- name: app-with-redis-backend
services:
- work-queue
`,
"global services": `
---
services:
- work-queue
applications:
- name: app-with-redis-backend
`,
"many apps": `
---
env:
PATH: /u/apps/something/bin
SOMETHING: nothing
applications:
- name: app1
env:
SOMETHING: definitely-something
- name: app2
`,
"nulls": `
---
applications:
- name: hacker-manifesto
command: null
buildpack: null
disk_quota: null
instances: null
memory: null
env: null
`,
"single app": `
---
env:
PATH: /u/apps/my-app/bin
FOO: bar
applications:
- name: manifest-app-name
memory: 128M
instances: 1
host: manifest-host
domain: manifest-example.com
stack: custom-stack
timeout: 360
buildpack: some-buildpack
command: JAVA_HOME=$PWD/.openjdk JAVA_OPTS="-Xss995K" ./bin/start.sh run
path: ../../fixtures/example-app
env:
FOO: baz
`,
"app with absolute unix path": `
---
env:
PATH: /u/apps/my-app/bin
FOO: bar
applications:
- name: manifest-app-name
path: /absolute/path/to/example-app
`,
"app with absolute windows path": `
---
env:
PATH: /u/apps/my-app/bin
FOO: bar
applications:
- name: manifest-app-name
path: C:\absolute\path\to\example-app
`,
"invalid": `
---
env:
- PATH
- USER
services:
old-service-format:
plan: free
provider: nobody
type: deprecated
applications:
- name: bad-services
services:
old-service-format:
plan: paid
provider: somebody
type: deprecated
- name: bad-env
env:
- FOO
- BAR
`,
"invalid env": `
---
applications:
- name: app-name
env:
foo: bar
bar:
`,
}
func ManifestWithName(name string) (fixture string) {
return fixtureMap[name]
}