Skip to content

Commit e1c0e82

Browse files
authored
Add AWS Amplify Console build schema (amplify.json), positive test, and catalog entry. (#5323)
1 parent 979bb17 commit e1c0e82

File tree

3 files changed

+229
-0
lines changed

3 files changed

+229
-0
lines changed

src/api/json/catalog.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
"fileMatch": ["accelerator.yaml"],
6666
"url": "https://www.schemastore.org/accelerator.json"
6767
},
68+
{
69+
"name": "amplify.yml",
70+
"description": "AWS Amplify Console build settings file",
71+
"fileMatch": ["amplify.yml", "amplify.yaml"],
72+
"url": "https://www.schemastore.org/amplify.json"
73+
},
6874
{
6975
"name": "Applicant Profile Protocol",
7076
"description": "Structured JSON format for professional profiles, resumes, and CVs with skills, experience, education, and certifications",

src/schemas/json/amplify.json

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://json.schemastore.org/amplify.json",
4+
"title": "AWS Amplify build specification (amplify.yml)",
5+
"type": "object",
6+
"properties": {
7+
"version": {
8+
"description": "Schema version (integer as in AWS examples)",
9+
"type": "integer"
10+
},
11+
"env": {
12+
"type": "object",
13+
"properties": {
14+
"variables": {
15+
"type": "object",
16+
"additionalProperties": {
17+
"type": "string"
18+
}
19+
}
20+
},
21+
"additionalProperties": true
22+
},
23+
"backend": {
24+
"type": "object",
25+
"properties": {
26+
"phases": {
27+
"type": "object",
28+
"patternProperties": {
29+
".*": {
30+
"$ref": "#/definitions/phase"
31+
}
32+
},
33+
"additionalProperties": false
34+
}
35+
},
36+
"additionalProperties": true
37+
},
38+
"frontend": {
39+
"type": "object",
40+
"properties": {
41+
"buildpath": {
42+
"type": "string"
43+
},
44+
"phases": {
45+
"type": "object",
46+
"patternProperties": {
47+
".*": {
48+
"$ref": "#/definitions/phase"
49+
}
50+
},
51+
"additionalProperties": false
52+
},
53+
"artifacts": {
54+
"type": "object",
55+
"properties": {
56+
"files": {
57+
"type": "array",
58+
"items": {
59+
"type": "string"
60+
}
61+
},
62+
"discard-paths": {
63+
"type": "boolean"
64+
},
65+
"baseDirectory": {
66+
"type": "string"
67+
}
68+
},
69+
"additionalProperties": false
70+
},
71+
"cache": {
72+
"type": "object",
73+
"properties": {
74+
"paths": {
75+
"type": "array",
76+
"items": {
77+
"type": "string"
78+
}
79+
}
80+
},
81+
"additionalProperties": false
82+
}
83+
},
84+
"additionalProperties": true
85+
},
86+
"test": {
87+
"type": "object",
88+
"properties": {
89+
"phases": {
90+
"type": "object",
91+
"patternProperties": {
92+
".*": {
93+
"$ref": "#/definitions/phase"
94+
}
95+
},
96+
"additionalProperties": false
97+
},
98+
"artifacts": {
99+
"type": "object",
100+
"properties": {
101+
"files": {
102+
"type": "array",
103+
"items": {
104+
"type": "string"
105+
}
106+
},
107+
"configFilePath": {
108+
"type": "string"
109+
},
110+
"baseDirectory": {
111+
"type": "string"
112+
}
113+
},
114+
"additionalProperties": false
115+
}
116+
},
117+
"additionalProperties": true
118+
}
119+
},
120+
"definitions": {
121+
"phase": {
122+
"type": "object",
123+
"properties": {
124+
"commands": {
125+
"type": "array",
126+
"items": {
127+
"type": "string"
128+
}
129+
},
130+
"runtime-versions": {
131+
"description": "Optional object to specify runtime versions (e.g. nodejs: 12)",
132+
"type": "object",
133+
"additionalProperties": {
134+
"type": "string"
135+
}
136+
}
137+
},
138+
"additionalProperties": true
139+
}
140+
},
141+
"additionalProperties": true,
142+
"examples": [
143+
{
144+
"version": 1,
145+
"env": {
146+
"variables": {
147+
"key": "value"
148+
}
149+
},
150+
"backend": {
151+
"phases": {
152+
"preBuild": {
153+
"commands": ["enter command"]
154+
},
155+
"build": {
156+
"commands": ["enter command"]
157+
},
158+
"postBuild": {
159+
"commands": ["enter command"]
160+
}
161+
}
162+
},
163+
"frontend": {
164+
"buildpath": "",
165+
"phases": {
166+
"preBuild": {
167+
"commands": ["cd react-app", "npm ci"]
168+
},
169+
"build": {
170+
"commands": ["npm run build"]
171+
}
172+
},
173+
"artifacts": {
174+
"files": ["location"],
175+
"discard-paths": true,
176+
"baseDirectory": "location"
177+
},
178+
"cache": {
179+
"paths": ["path"]
180+
}
181+
},
182+
"test": {
183+
"phases": {
184+
"preTest": {
185+
"commands": ["enter command"]
186+
},
187+
"test": {
188+
"commands": ["enter command"]
189+
},
190+
"postTest": {
191+
"commands": ["enter command"]
192+
}
193+
},
194+
"artifacts": {
195+
"files": ["location"],
196+
"configFilePath": "location",
197+
"baseDirectory": "location"
198+
}
199+
}
200+
}
201+
]
202+
}

src/test/amplify/amplify.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# yaml-language-server: $schema=../../schemas/json/amplify.json
2+
version: 1
3+
applications:
4+
- appRoot: 'frontend'
5+
frontend:
6+
phases:
7+
preBuild:
8+
commands:
9+
- yarn install
10+
build:
11+
commands:
12+
- yarn build
13+
artifacts:
14+
baseDirectory: build
15+
files:
16+
- '**/*'
17+
cache:
18+
paths:
19+
- node_modules/**
20+
backend:
21+
someKey: someValue

0 commit comments

Comments
 (0)