-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: introduce devfile version 2 #1
Changes from 1 commit
f9ea419
d947e30
dfb7542
c4e4d4c
df12610
2765138
b9822ad
893f2bc
009ebfe
1937470
24b83b7
bbbcbea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=827846 | ||
// for the documentation about the extensions.json format | ||
"recommendations": [ | ||
"golang.go" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug current file", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "auto", | ||
"program": "${fileDirname}" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"go.lintTool": "golangci-lint", | ||
"go.lintFlags": "--fast", | ||
"go.useLanguageServer": true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
schemaVersion: 2.1.0 | ||
metadata: | ||
svor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
name: golang-echo-example | ||
projects: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we have two projects being checkout there ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are defined in the original devfile v1: https://github.com/eclipse-che/che-devfile-registry/blob/b27df2e5a731d54e169d04060533be1458e9fd02/devfiles/go/devfile.yaml#L5-L17 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok but with devfile v2 we really want to emphasis the devfile being inside the project and not being cross-project so either we merge two examples in one repository or we create one devfile per repository. It means 'two samples' There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Splited the devfile to separate projects There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer to create one devfile per repository and in go/meta.yaml use only https://github.com/che-samples/golang-echo-example/tree/devfilev2 as Getting Started sample. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine |
||
- git: | ||
checkoutFrom: | ||
revision: devfile2 | ||
remotes: | ||
origin: "https://github.com/che-samples/golang-example.git" | ||
name: golang-example | ||
- git: | ||
checkoutFrom: | ||
revision: devfile2 | ||
remotes: | ||
origin: "https://github.com/che-samples/golang-echo-example.git" | ||
name: golang-echo-example | ||
components: | ||
- name: go-cli | ||
container: | ||
# this version is used in the plugin | ||
image: quay.io/devfile/universal-developer-image:ubi8-b452131 | ||
env: | ||
- name: GOPATH | ||
# replicate the GOPATH from the plugin | ||
value: /projects | ||
- name: GOCACHE | ||
# replicate the GOCACHE from the plugin, even though the cache is not shared | ||
# between the two | ||
value: /tmp/.cache | ||
endpoints: | ||
- name: 8080-tcp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. small remark, maybe it's better to change the name as well: 8585-tcp |
||
targetPort: 27017 | ||
memoryLimit: 2Gi | ||
mountSources: true | ||
commands: | ||
- id: run-outyet | ||
exec: | ||
label: "1.1 Run outyet" | ||
component: go-cli | ||
workingDir: ${PROJECTS_ROOT}/golang-example/outyet | ||
commandLine: "go get -d && go run main.go" | ||
group: | ||
kind: run | ||
- id: stop | ||
exec: | ||
label: "1.2 Stop outyet" | ||
component: go-cli | ||
commandLine: "kill $(pidof go)" | ||
group: | ||
kind: run | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it should be removed as well no ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This command works for both projects There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but look at the name of the command (label) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you are right, renamed the command |
||
- id: test-outyet | ||
exec: | ||
label: "1.3 Test outyet" | ||
component: go-cli | ||
workingDir: ${PROJECTS_ROOT}/golang-example/outyet | ||
commandLine: "go test" | ||
group: | ||
kind: test | ||
- id: dependencies | ||
exec: | ||
label: "2.1 xenisa :: install dependencies" | ||
component: go-cli | ||
workingDir: ${PROJECTS_ROOT}/golang-echo-example | ||
commandLine: "go mod download" | ||
group: | ||
kind: build | ||
- id: run | ||
exec: | ||
label: "2.2 xenisa :: run" | ||
component: go-cli | ||
workingDir: ${PROJECTS_ROOT}/golang-echo-example | ||
commandLine: "go run main.go" | ||
group: | ||
kind: run | ||
- id: build | ||
exec: | ||
label: "2.3 xenisa :: build" | ||
component: go-cli | ||
workingDir: ${PROJECTS_ROOT}/golang-echo-example | ||
commandLine: "go build" | ||
group: | ||
kind: build | ||
- id: test | ||
exec: | ||
label: "2.4 xenisa :: test" | ||
component: go-cli | ||
workingDir: ${PROJECTS_ROOT}/golang-echo-example | ||
commandLine: "go test ./..." | ||
group: | ||
kind: test | ||
- id: file | ||
exec: | ||
label: "Run current file" | ||
component: go-cli | ||
workingDir: ${fileDirname} | ||
commandLine: "go get -d && go run ${file}" | ||
group: | ||
kind: run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need these settings ?
it's not brought automatically by the plug-in definition ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the file