Skip to content

Commit 2af4087

Browse files
authored
Create go 1.19 stack versions (#239)
* Deprecate go 1.18 stack versions Signed-off-by: thepetk <[email protected]> * Create stack version 3.0.0 Signed-off-by: thepetk <[email protected]> * Create the 3.1.0 go stack version Signed-off-by: thepetk <[email protected]> * Finalize versioning Signed-off-by: thepetk <[email protected]> * Add debugging to go 1.2.0 Signed-off-by: thepetk <[email protected]> * Remove deprecated from 1.2.0 Signed-off-by: thepetk <[email protected]> * Add comment on default Signed-off-by: thepetk <[email protected]> * Exclude golang deprecated stacks from renovate Signed-off-by: thepetk <[email protected]> --------- Signed-off-by: thepetk <[email protected]>
1 parent 99da1e4 commit 2af4087

File tree

10 files changed

+246
-2
lines changed

10 files changed

+246
-2
lines changed

renovate.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@
3636
"stacks/java-openliberty-gradle/**",
3737
"stacks/java-websphereliberty/**",
3838
"stacks/java-websphereliberty-gradle/**",
39-
"stacks/nodejs/**"
39+
"stacks/nodejs/**",
40+
"stacks/go/1.0.2/**",
41+
"stacks/go/1.1.0/**",
42+
"stacks/go/2.0.0/**",
43+
"stacks/go/2.1.0/**"
4044
],
4145
"prHourlyLimit": 20,
4246
"prConcurrentLimit": 5

stacks/go/1.0.2/devfile.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg
77
tags:
88
- Go
9+
- Deprecated
910
projectType: Go
1011
language: Go
1112
provider: Red Hat

stacks/go/1.1.0/devfile.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg
77
tags:
88
- Go
9+
- Deprecated
910
projectType: Go
1011
language: Go
1112
provider: Red Hat

stacks/go/1.2.0/devfile.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
schemaVersion: 2.1.0
2+
metadata:
3+
name: go
4+
displayName: Go Runtime
5+
description: Go (version 1.19.x) is an open source programming language that makes it easy to build simple, reliable, and efficient software.
6+
icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg
7+
tags:
8+
- Go
9+
projectType: Go
10+
language: Go
11+
provider: Red Hat
12+
version: 1.2.0
13+
starterProjects:
14+
- name: go-starter
15+
description: A Go project with a simple HTTP server
16+
git:
17+
checkoutFrom:
18+
revision: main
19+
remotes:
20+
origin: https://github.com/devfile-samples/devfile-stack-go.git
21+
components:
22+
- container:
23+
endpoints:
24+
- name: http-go
25+
targetPort: 8080
26+
- exposure: none
27+
name: debug
28+
targetPort: 5858
29+
image: registry.access.redhat.com/ubi9/go-toolset:1.19.13-4.1697647145
30+
args: ["tail", "-f", "/dev/null"]
31+
env:
32+
- name: DEBUG_PORT
33+
value: '5858'
34+
memoryLimit: 1024Mi
35+
mountSources: true
36+
name: runtime
37+
commands:
38+
- exec:
39+
env:
40+
- name: GOPATH
41+
value: ${PROJECT_SOURCE}/.go
42+
- name: GOCACHE
43+
value: ${PROJECT_SOURCE}/.cache
44+
commandLine: go build main.go
45+
component: runtime
46+
group:
47+
isDefault: true
48+
kind: build
49+
workingDir: ${PROJECT_SOURCE}
50+
id: build
51+
- exec:
52+
commandLine: ./main
53+
component: runtime
54+
group:
55+
isDefault: true
56+
kind: run
57+
workingDir: ${PROJECT_SOURCE}
58+
id: run
59+
60+
- exec:
61+
commandLine: |
62+
GOPATH=${PROJECT_SOURCE}/.go \
63+
GOCACHE=${PROJECT_SOURCE}/.cache \
64+
dlv \
65+
--listen=127.0.0.1:${DEBUG_PORT} \
66+
--only-same-user=false \
67+
--headless=true \
68+
--api-version=2 \
69+
--accept-multiclient \
70+
debug --continue main.go
71+
component: runtime
72+
group:
73+
isDefault: true
74+
kind: debug
75+
workingDir: ${PROJECT_SOURCE}
76+
id: debug

stacks/go/2.0.0/devfile.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg
77
tags:
88
- Go
9+
- Deprecated
910
projectType: Go
1011
language: Go
1112
provider: Red Hat

stacks/go/2.1.0/devfile.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg
77
tags:
88
- Go
9+
- Deprecated
910
projectType: Go
1011
language: Go
1112
provider: Red Hat

stacks/go/2.2.0/devfile.yaml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
schemaVersion: 2.2.0
2+
metadata:
3+
name: go
4+
displayName: Go Runtime
5+
description: Go (version 1.19.x) is an open source programming language that makes it easy to build simple, reliable, and efficient software.
6+
icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg
7+
tags:
8+
- Go
9+
projectType: Go
10+
language: Go
11+
provider: Red Hat
12+
version: 2.2.0
13+
starterProjects:
14+
- name: go-starter
15+
description: A Go project with a simple HTTP server
16+
git:
17+
checkoutFrom:
18+
revision: main
19+
remotes:
20+
origin: https://github.com/devfile-samples/devfile-stack-go.git
21+
components:
22+
- name: build
23+
image:
24+
imageName: go-image:latest
25+
dockerfile:
26+
uri: docker/Dockerfile
27+
buildContext: .
28+
rootRequired: false
29+
- name: deploy
30+
kubernetes:
31+
uri: kubernetes/deploy.yaml
32+
endpoints:
33+
- name: http-8081
34+
targetPort: 8081
35+
- container:
36+
endpoints:
37+
- name: http-go
38+
targetPort: 8080
39+
- exposure: none
40+
name: debug
41+
targetPort: 5858
42+
image: registry.access.redhat.com/ubi9/go-toolset:1.19.13-4.1697647145
43+
args: ['tail', '-f', '/dev/null']
44+
env:
45+
- name: DEBUG_PORT
46+
value: '5858'
47+
memoryLimit: 1024Mi
48+
mountSources: true
49+
name: runtime
50+
commands:
51+
- id: build-image
52+
apply:
53+
component: build
54+
- id: deployk8s
55+
apply:
56+
component: deploy
57+
- id: deploy
58+
composite:
59+
commands:
60+
- build-image
61+
- deployk8s
62+
group:
63+
kind: deploy
64+
isDefault: true
65+
- exec:
66+
env:
67+
- name: GOPATH
68+
value: ${PROJECT_SOURCE}/.go
69+
- name: GOCACHE
70+
value: ${PROJECT_SOURCE}/.cache
71+
commandLine: go build main.go
72+
component: runtime
73+
group:
74+
isDefault: true
75+
kind: build
76+
workingDir: ${PROJECT_SOURCE}
77+
id: build
78+
- exec:
79+
commandLine: ./main
80+
component: runtime
81+
group:
82+
isDefault: true
83+
kind: run
84+
workingDir: ${PROJECT_SOURCE}
85+
id: run
86+
87+
- exec:
88+
commandLine: |
89+
GOPATH=${PROJECT_SOURCE}/.go \
90+
GOCACHE=${PROJECT_SOURCE}/.cache \
91+
dlv \
92+
--listen=127.0.0.1:${DEBUG_PORT} \
93+
--only-same-user=false \
94+
--headless=true \
95+
--api-version=2 \
96+
--accept-multiclient \
97+
debug --continue main.go
98+
component: runtime
99+
group:
100+
isDefault: true
101+
kind: debug
102+
workingDir: ${PROJECT_SOURCE}
103+
id: debug

stacks/go/2.2.0/docker/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM registry.access.redhat.com/ubi9/go-toolset:1.19.13-4.1697647145
2+
3+
COPY go.mod ./
4+
RUN go mod download
5+
6+
COPY *.go ./
7+
8+
RUN go build -o ./main
9+
10+
EXPOSE 8081
11+
12+
CMD [ "./main" , "-p=8081"]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
kind: Service
2+
apiVersion: v1
3+
metadata:
4+
name: my-go-svc
5+
spec:
6+
ports:
7+
- name: http-8081
8+
port: 8081
9+
protocol: TCP
10+
targetPort: 8081
11+
selector:
12+
app: go-app
13+
---
14+
kind: Deployment
15+
apiVersion: apps/v1
16+
metadata:
17+
name: my-go
18+
spec:
19+
replicas: 1
20+
selector:
21+
matchLabels:
22+
app: go-app
23+
template:
24+
metadata:
25+
labels:
26+
app: go-app
27+
spec:
28+
containers:
29+
- name: my-go
30+
image: go-image:latest
31+
ports:
32+
- name: http
33+
containerPort: 8081
34+
protocol: TCP
35+
resources:
36+
requests:
37+
memory: "10Mi"
38+
cpu: "10m"
39+
limits:
40+
memory: "100Mi"
41+
cpu: "100m"

stacks/go/stack.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ displayName: Go Runtime
44
icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg
55
versions:
66
- version: 1.0.2
7-
default: true # should have one and only one default version
87
# 1.1.0: debug command via dlv
98
- version: 1.1.0
9+
# 1.2.0: debug command via dlv & go 1.19
10+
- version: 1.2.0
11+
default: true # should have one and only one default version
1012
- version: 2.0.0
1113
# 2.1.0: debug command via dlv
1214
- version: 2.1.0
15+
# 2.2.0: debug command via dlv & go 1.19
16+
- version: 2.2.0

0 commit comments

Comments
 (0)