Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Vitaliy Gulyy <[email protected]>
  • Loading branch information
vitaliy-guliy committed Feb 10, 2023
1 parent f199aee commit a38e70c
Show file tree
Hide file tree
Showing 11 changed files with 480 additions and 170 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# @redhat.vscode-devfile

With a wizard the extension provided you can easily create the Devfile.

![Che-Theia](media/screenshot-1.png)

---

To build the extension, use Node v16 and later.
3 changes: 3 additions & 0 deletions media/generate-yaml.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Get Devfile yaml

Click button to save Devfile to the root of your project.
9 changes: 0 additions & 9 deletions media/markdown.md

This file was deleted.

File renamed without changes.
Binary file added media/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@
"title": "Devfile :: New Devfile"
},
{
"command": "vscode-devfile.new-container-component",
"command": "vscode-devfile.new-component",
"title": "Devfile :: New Component"
},
{
"command": "vscode-devfile.new-command",
"title": "Devfile :: New Command"
},
{
"command": "vscode-devfile.generate-devfile",
"title": "Devfile :: Generate Devfile"
"command": "vscode-devfile.save-devfile",
"title": "Devfile :: Save Devfile"
}
],

Expand All @@ -77,15 +77,15 @@
{
"id": "devfile-name",
"title": "New Devfile",
"description": "Start with creating a Devfile\n[New Devfile](command:vscode-devfile.new-devfile)",
"description": "Start with creating a Devfile\n[Create](command:vscode-devfile.new-devfile)",
"media": { "markdown": "media/new-devfile.md" },
"completionEvents": ["onCommand:vscode-devfile.new-devfile"]
},
{
"id": "add-container-component",
"id": "add-component",
"title": "Add Component",
"description": "Adding a container component\n[New Component](command:vscode-devfile.new-container-component)",
"media": { "markdown": "media/new-container-component.md" },
"description": "Adding a container component\n[New Component](command:vscode-devfile.new-component)",
"media": { "markdown": "media/new-component.md" },
"completionEvents": []
},
{
Expand All @@ -97,9 +97,9 @@
},
{
"id": "generate-devfile",
"title": "Generate Devfile",
"description": "You are ready to get a new Devfile\n[Get Devfile](command:vscode-devfile.generate-devfile)",
"media": { "markdown": "media/markdown.md" },
"title": "Save Devfile",
"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)",
"media": { "markdown": "media/generate-yaml.md" },
"completionEvents": []
}
]
Expand Down
68 changes: 68 additions & 0 deletions src/devfile-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

/**
```
schemaVersion: 2.2.0
metadata:
name: devfile-sample
```
*/
export interface Devfile {

metadata: Metadata;
components: Component[];

}

export interface Metadata {
name: string;
}

/**
```
components:
- name: dev
container:
image: quay.io/devfile/universal-developer-image:latest
memoryRequest: 256Mi
memoryLimit: 2048Mi
cpuRequest: 0.1
cpuLimit: 0.5
mountSources: true
endpoints:
- exposure: public
name: http-demo
protocol: http
targetPort: 8080
env:
- name: WELCOME
value: "Hello World"
```
*/
export interface Component {
name: string;
container?: ComponentContainer;
}

export interface ComponentContainer {
image: string;
memoryRequest?: string;
memoryLimit?: string;
cpuRequest?: string;
cpuLimit?: string;
mountSources?: boolean;
endpoints?: ExposedPort[];
env?: EnvironmentVariable[];
}

export interface ExposedPort {
visibility: 'public' | 'internal';
name: string;
protocol: string;
port: number;
}

export interface EnvironmentVariable {
name: string;
value: string;
}
Loading

0 comments on commit a38e70c

Please sign in to comment.