-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update stack yaml file to add new version Signed-off-by: Jordan Dubrick <[email protected]> * add dockerfile and deploy files Signed-off-by: Jordan Dubrick <[email protected]> * add devfile Signed-off-by: Jordan Dubrick <[email protected]> * add v1.3.0 for innerloop only Signed-off-by: Jordan Dubrick <[email protected]> * update stacks.yaml for new Go stack Signed-off-by: Jordan Dubrick <[email protected]> --------- Signed-off-by: Jordan Dubrick <[email protected]>
- Loading branch information
Showing
5 changed files
with
237 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
schemaVersion: 2.1.0 | ||
metadata: | ||
name: go | ||
displayName: Go Runtime | ||
description: Go (version 1.20.x) is an open source programming language that makes it easy to build simple, reliable, and efficient software. | ||
icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg | ||
tags: | ||
- Go | ||
projectType: Go | ||
language: Go | ||
provider: Red Hat | ||
version: 1.3.0 | ||
starterProjects: | ||
- name: go-starter | ||
description: A Go project with a simple HTTP server | ||
git: | ||
checkoutFrom: | ||
revision: main | ||
remotes: | ||
origin: https://github.com/devfile-samples/devfile-stack-go.git | ||
components: | ||
- container: | ||
endpoints: | ||
- name: http-go | ||
targetPort: 8080 | ||
- exposure: none | ||
name: debug | ||
targetPort: 5858 | ||
image: registry.access.redhat.com/ubi9/go-toolset:1.20.10-2.1699551725 | ||
args: ["tail", "-f", "/dev/null"] | ||
env: | ||
- name: DEBUG_PORT | ||
value: '5858' | ||
memoryLimit: 1024Mi | ||
mountSources: true | ||
name: runtime | ||
commands: | ||
- exec: | ||
env: | ||
- name: GOPATH | ||
value: ${PROJECT_SOURCE}/.go | ||
- name: GOCACHE | ||
value: ${PROJECT_SOURCE}/.cache | ||
commandLine: go build main.go | ||
component: runtime | ||
group: | ||
isDefault: true | ||
kind: build | ||
workingDir: ${PROJECT_SOURCE} | ||
id: build | ||
- exec: | ||
commandLine: ./main | ||
component: runtime | ||
group: | ||
isDefault: true | ||
kind: run | ||
workingDir: ${PROJECT_SOURCE} | ||
id: run | ||
|
||
- exec: | ||
commandLine: | | ||
GOPATH=${PROJECT_SOURCE}/.go \ | ||
GOCACHE=${PROJECT_SOURCE}/.cache \ | ||
dlv \ | ||
--listen=127.0.0.1:${DEBUG_PORT} \ | ||
--only-same-user=false \ | ||
--headless=true \ | ||
--api-version=2 \ | ||
--accept-multiclient \ | ||
debug --continue main.go | ||
component: runtime | ||
group: | ||
isDefault: true | ||
kind: debug | ||
workingDir: ${PROJECT_SOURCE} | ||
id: debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
schemaVersion: 2.2.0 | ||
metadata: | ||
name: go | ||
displayName: Go Runtime | ||
description: Go (version 1.20.x) is an open source programming language that makes it easy to build simple, reliable, and efficient software. | ||
icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg | ||
tags: | ||
- Go | ||
projectType: Go | ||
language: Go | ||
provider: Red Hat | ||
version: 2.3.0 | ||
starterProjects: | ||
- name: go-starter | ||
description: A Go project with a simple HTTP server | ||
git: | ||
checkoutFrom: | ||
revision: main | ||
remotes: | ||
origin: https://github.com/devfile-samples/devfile-stack-go.git | ||
components: | ||
- name: build | ||
image: | ||
imageName: go-image:latest | ||
dockerfile: | ||
uri: docker/Dockerfile | ||
buildContext: . | ||
rootRequired: false | ||
- name: deploy | ||
kubernetes: | ||
uri: kubernetes/deploy.yaml | ||
endpoints: | ||
- name: http-8081 | ||
targetPort: 8081 | ||
- container: | ||
endpoints: | ||
- name: http-go | ||
targetPort: 8080 | ||
- exposure: none | ||
name: debug | ||
targetPort: 5858 | ||
image: registry.access.redhat.com/ubi9/go-toolset:1.20.10-2.1699551725 | ||
args: ['tail', '-f', '/dev/null'] | ||
env: | ||
- name: DEBUG_PORT | ||
value: '5858' | ||
memoryLimit: 1024Mi | ||
mountSources: true | ||
name: runtime | ||
commands: | ||
- id: build-image | ||
apply: | ||
component: build | ||
- id: deployk8s | ||
apply: | ||
component: deploy | ||
- id: deploy | ||
composite: | ||
commands: | ||
- build-image | ||
- deployk8s | ||
group: | ||
kind: deploy | ||
isDefault: true | ||
- exec: | ||
env: | ||
- name: GOPATH | ||
value: ${PROJECT_SOURCE}/.go | ||
- name: GOCACHE | ||
value: ${PROJECT_SOURCE}/.cache | ||
commandLine: go build main.go | ||
component: runtime | ||
group: | ||
isDefault: true | ||
kind: build | ||
workingDir: ${PROJECT_SOURCE} | ||
id: build | ||
- exec: | ||
commandLine: ./main | ||
component: runtime | ||
group: | ||
isDefault: true | ||
kind: run | ||
workingDir: ${PROJECT_SOURCE} | ||
id: run | ||
|
||
- exec: | ||
commandLine: | | ||
GOPATH=${PROJECT_SOURCE}/.go \ | ||
GOCACHE=${PROJECT_SOURCE}/.cache \ | ||
dlv \ | ||
--listen=127.0.0.1:${DEBUG_PORT} \ | ||
--only-same-user=false \ | ||
--headless=true \ | ||
--api-version=2 \ | ||
--accept-multiclient \ | ||
debug --continue main.go | ||
component: runtime | ||
group: | ||
isDefault: true | ||
kind: debug | ||
workingDir: ${PROJECT_SOURCE} | ||
id: debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM registry.access.redhat.com/ubi9/go-toolset:1.20.10-2.1699551725 | ||
|
||
COPY go.mod ./ | ||
RUN go mod download | ||
|
||
COPY *.go ./ | ||
|
||
RUN go build -o ./main | ||
|
||
EXPOSE 8081 | ||
|
||
CMD [ "./main" , "-p=8081"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: my-go-svc | ||
spec: | ||
ports: | ||
- name: http-8081 | ||
port: 8081 | ||
protocol: TCP | ||
targetPort: 8081 | ||
selector: | ||
app: go-app | ||
--- | ||
kind: Deployment | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: my-go | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: go-app | ||
template: | ||
metadata: | ||
labels: | ||
app: go-app | ||
spec: | ||
containers: | ||
- name: my-go | ||
image: go-image:latest | ||
ports: | ||
- name: http | ||
containerPort: 8081 | ||
protocol: TCP | ||
resources: | ||
requests: | ||
memory: "10Mi" | ||
cpu: "10m" | ||
limits: | ||
memory: "100Mi" | ||
cpu: "100m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters