Skip to content

Commit a38e70c

Browse files
committed
Initial commit
Signed-off-by: Vitaliy Gulyy <[email protected]>
1 parent f199aee commit a38e70c

File tree

11 files changed

+480
-170
lines changed

11 files changed

+480
-170
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# @redhat.vscode-devfile
22

33
With a wizard the extension provided you can easily create the Devfile.
4+
5+
![Che-Theia](media/screenshot-1.png)
6+
7+
---
8+
9+
To build the extension, use Node v16 and later.

media/generate-yaml.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Get Devfile yaml
2+
3+
Click button to save Devfile to the root of your project.

media/markdown.md

Lines changed: 0 additions & 9 deletions
This file was deleted.
File renamed without changes.

media/screenshot-1.png

81.1 KB
Loading

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@
5454
"title": "Devfile :: New Devfile"
5555
},
5656
{
57-
"command": "vscode-devfile.new-container-component",
57+
"command": "vscode-devfile.new-component",
5858
"title": "Devfile :: New Component"
5959
},
6060
{
6161
"command": "vscode-devfile.new-command",
6262
"title": "Devfile :: New Command"
6363
},
6464
{
65-
"command": "vscode-devfile.generate-devfile",
66-
"title": "Devfile :: Generate Devfile"
65+
"command": "vscode-devfile.save-devfile",
66+
"title": "Devfile :: Save Devfile"
6767
}
6868
],
6969

@@ -77,15 +77,15 @@
7777
{
7878
"id": "devfile-name",
7979
"title": "New Devfile",
80-
"description": "Start with creating a Devfile\n[New Devfile](command:vscode-devfile.new-devfile)",
80+
"description": "Start with creating a Devfile\n[Create](command:vscode-devfile.new-devfile)",
8181
"media": { "markdown": "media/new-devfile.md" },
8282
"completionEvents": ["onCommand:vscode-devfile.new-devfile"]
8383
},
8484
{
85-
"id": "add-container-component",
85+
"id": "add-component",
8686
"title": "Add Component",
87-
"description": "Adding a container component\n[New Component](command:vscode-devfile.new-container-component)",
88-
"media": { "markdown": "media/new-container-component.md" },
87+
"description": "Adding a container component\n[New Component](command:vscode-devfile.new-component)",
88+
"media": { "markdown": "media/new-component.md" },
8989
"completionEvents": []
9090
},
9191
{
@@ -97,9 +97,9 @@
9797
},
9898
{
9999
"id": "generate-devfile",
100-
"title": "Generate Devfile",
101-
"description": "You are ready to get a new Devfile\n[Get Devfile](command:vscode-devfile.generate-devfile)",
102-
"media": { "markdown": "media/markdown.md" },
100+
"title": "Save Devfile",
101+
"description": "You are ready to get a new Devfile and save it to the root of your project\n[Save](command:vscode-devfile.save-devfile)",
102+
"media": { "markdown": "media/generate-yaml.md" },
103103
"completionEvents": []
104104
}
105105
]

src/devfile-api.ts

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
2+
/**
3+
```
4+
schemaVersion: 2.2.0
5+
metadata:
6+
name: devfile-sample
7+
```
8+
*/
9+
export interface Devfile {
10+
11+
metadata: Metadata;
12+
components: Component[];
13+
14+
}
15+
16+
export interface Metadata {
17+
name: string;
18+
}
19+
20+
/**
21+
```
22+
components:
23+
- name: dev
24+
container:
25+
image: quay.io/devfile/universal-developer-image:latest
26+
memoryRequest: 256Mi
27+
memoryLimit: 2048Mi
28+
cpuRequest: 0.1
29+
cpuLimit: 0.5
30+
mountSources: true
31+
endpoints:
32+
- exposure: public
33+
name: http-demo
34+
protocol: http
35+
targetPort: 8080
36+
env:
37+
- name: WELCOME
38+
value: "Hello World"
39+
40+
```
41+
*/
42+
export interface Component {
43+
name: string;
44+
container?: ComponentContainer;
45+
}
46+
47+
export interface ComponentContainer {
48+
image: string;
49+
memoryRequest?: string;
50+
memoryLimit?: string;
51+
cpuRequest?: string;
52+
cpuLimit?: string;
53+
mountSources?: boolean;
54+
endpoints?: ExposedPort[];
55+
env?: EnvironmentVariable[];
56+
}
57+
58+
export interface ExposedPort {
59+
visibility: 'public' | 'internal';
60+
name: string;
61+
protocol: string;
62+
port: number;
63+
}
64+
65+
export interface EnvironmentVariable {
66+
name: string;
67+
value: string;
68+
}

0 commit comments

Comments
 (0)