Skip to content

Commit

Permalink
Add Che7 Go stack and samples (#13176)
Browse files Browse the repository at this point in the history
* Add go stack and samples

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
  • Loading branch information
tolusha authored Apr 19, 2019
1 parent dcf1486 commit ca35952
Show file tree
Hide file tree
Showing 5 changed files with 260 additions and 21 deletions.
67 changes: 67 additions & 0 deletions ide/che-core-ide-stacks/src/main/resources/stacks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2714,5 +2714,72 @@
"name": "type-che7.svg",
"mediaType": "image/svg+xml"
}
},
{
"id": "go",
"name": "Go with Theia IDE",
"creator": "Anatolii Bazko",
"tags": [
"Theia",
"Debian",
"Go"
],
"scope": "general",
"description": "Default stack with Go 1.12.4 and Theia IDE",
"components": [
{
"version": "9",
"name": "Debian"
},
{
"version": "1.12.4",
"name": "Go"
}
],
"workspaceConfig": {
"environments": {
"default": {
"recipe": {
"content": "golang:1.12.4-stretch",
"type": "dockerimage"
},
"machines": {
"go": {
"servers": {},
"env": {
"PS1": "$(echo ${0})\\$ ",
"GOPATH": "/go:/projects",
"GOCACHE": "/tmp/.cache"
},
"volumes": {
"projects": {
"path": "/projects"
}
},
"installers": [],
"attributes": {
"memoryLimitBytes": "512000000",
"containerCommand": "['sleep']",
"containerArgs": "['infinity']"
}
}
}
}
},
"name": "default",
"defaultEnv": "default",
"description": null,
"attributes": {
"sidecar.org.eclipse.che.editor.theia.memory_limit": "512Mi",
"sidecar.ms-vscode.go.memory_limit": "512Mi",
"editor": "org.eclipse.che.editor.theia:next",
"plugins": "che-machine-exec-plugin:0.0.1,ms-vscode.go:0.9.2"
},
"links": []
},
"stackIcon": {
"name": "type-che7.svg",
"mediaType": "image/svg+xml"
}
}
]
188 changes: 170 additions & 18 deletions ide/che-core-ide-templates/src/main/resources/samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"type": "git",
"location": "https://github.com/che-samples/web-java-spring-petclinic.git",
"parameters": {
"branch":"mysql"
"branch": "mysql"
}
},
"commands": [
Expand Down Expand Up @@ -71,8 +71,7 @@
"description": "A blank project example.",
"projectType": "blank",
"mixins": [],
"attributes": {
},
"attributes": {},
"modules": [],
"problems": [],
"source": {
Expand Down Expand Up @@ -215,18 +214,26 @@
"path": "/web-go-simple",
"description": "Simple Go Hello World.",
"projectType": "golang",
"mixins": [],
"mixins": [

],
"attributes": {
"language": [
"go"
]
},
"modules": [],
"problems": [],
"modules": [

],
"problems": [

],
"source": {
"type": "git",
"location": "https://github.com/che-samples/web-go-simple.git",
"parameters": {}
"parameters": {

}
},
"commands": [
{
Expand All @@ -239,7 +246,9 @@
}
}
],
"links": [],
"links": [

],
"category": "Samples",
"tags": [
"Go"
Expand All @@ -251,18 +260,26 @@
"path": "/desktop-go-simple",
"description": "Simple Go Hello World.",
"projectType": "blank",
"mixins": [],
"mixins": [

],
"attributes": {
"language": [
"go"
]
},
"modules": [],
"problems": [],
"modules": [

],
"problems": [

],
"source": {
"type": "git",
"location": "https://github.com/che-samples/desktop-go-simple.git",
"parameters": {}
"parameters": {

}
},
"commands": [
{
Expand All @@ -275,7 +292,9 @@
}
}
],
"links": [],
"links": [

],
"category": "Samples",
"tags": [
"Go"
Expand Down Expand Up @@ -400,7 +419,6 @@
"rails"
]
},

{
"name": "nodejs-hello-world",
"displayName": "nodejs-hello-world",
Expand Down Expand Up @@ -867,7 +885,7 @@
"type": "git",
"location": "https://github.com/Microsoft/TypeScriptSamples.git",
"parameters": {
"keepDir":"greeter",
"keepDir": "greeter",
"keepVcs": "false",
"convertToTopLevelProject": "true"
}
Expand All @@ -876,7 +894,8 @@
"links": [],
"category": "Samples",
"tags": [
"TypeScript","ts"
"TypeScript",
"ts"
]
},
{
Expand All @@ -886,8 +905,7 @@
"description": "A Ceylon 'Hello World' project example that runs on all supported backends.",
"projectType": "blank",
"mixins": [],
"attributes": {
},
"attributes": {},
"modules": [],
"problems": [],
"source": {
Expand Down Expand Up @@ -1279,5 +1297,139 @@
"tags": [
"Python", "Django"
]
},
{
"name": "go-web-sample",
"displayName": "go-web-sample",
"path": "/go-web-sample",
"description": "Go Web Sample.",
"projectType": "go",
"mixins": [],
"attributes": {
"language": [
"go"
]
},
"modules": [],
"problems": [],
"source": {
"type": "git",
"location": "https://github.com/che-samples/go-web-sample",
"parameters": {}
},
"commands": [
{
"name": "run",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/go-web-sample && go run main.go",
"attributes": {
"goal": "Run"
}
},
{
"name": "build",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/go-web-sample && go build",
"attributes": {
"goal": "Build"
}
},
{
"name": "test",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/go-web-sample && go test ./...",
"attributes": {
"goal": "Test"
}
}
],
"links": [],
"category": "Samples",
"tags": [
"Go"
]
},
{
"name": "go-realworld-example-app",
"displayName": "go-realworld-example-app",
"path": "/src/github.com/xesina/golang-echo-realworld-example-app",
"description": "Go Real World Sample.",
"projectType": "go",
"mixins": [],
"attributes": {
"language": [
"go"
]
},
"modules": [],
"problems": [],
"source": {
"type": "git",
"location": "https://github.com/xesina/golang-echo-realworld-example-app",
"parameters": {}
},
"commands": [
{
"name": "install dependency management tool",
"type": "custom",
"commandLine": "curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh",
"attributes": {
"goal": "Run"
}
},
{
"name": "install dependencies",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/src/github.com/xesina/golang-echo-realworld-example-app && dep ensure -v",
"attributes": {
"goal": "Run"
}
},
{
"name": "go run",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/src/github.com/xesina/golang-echo-realworld-example-app && go run main.go",
"attributes": {
"goal": "Run"
}
},
{
"name": "go build",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/src/github.com/xesina/golang-echo-realworld-example-app && go build",
"attributes": {
"goal": "Build"
}
},
{
"name": "go test",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/src/github.com/xesina/golang-echo-realworld-example-app && go test ./...",
"attributes": {
"goal": "Test"
}
},
{
"name": "user create",
"type": "custom",
"commandLine": "curl --header \"Content-Type: application/json\" --request POST --data '\"'\"'{\"user\": {\"Username\":\"user\", \"Email\":\"user@user.user\", \"Password\": \"password\"}}'\"'\"' localhost:1323/api/users",
"attributes": {
"goal": "Test"
}
},
{
"name": "user login",
"type": "custom",
"commandLine": "curl --header \"Content-Type: application/json\" --request POST --data '\"'\"'{\"user\": {\"Email\":\"user@user.user\", \"Password\": \"password\"}}'\"'\"' localhost:1323/api/users/login",
"attributes": {
"goal": "Test"
}
}
],
"links": [],
"category": "Samples",
"tags": [
"Go"
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,13 @@ public enum Stack {
CEYLON_WITH_JAVA_JAVASCRIPT("ceylon-java-javascript-dart-centos"),
CHE_7_PREVIEW("che7-preview"),
CHE_7_PREVIEW_DEV("che7-preview-plugin-dev"),
CHE_7_THEIA_DEV("che7-development-che-theia-and-theia-plugins"),
DEBIAN("debian"),
DEBIAN_LSP("debianlsp"),
ECLIPSE_CHE("che-in-che"),
ECLIPSE_VERTX("vert.x"),
GO("go-default"),
GO_DEFAULT("go-default"),
GO("go"),
JAVA_CENTOS("java-centos"),
JAVA_GRADLE("java-gradle"),
JAVA_MAVEN("java-maven"),
Expand Down
Loading

0 comments on commit ca35952

Please sign in to comment.