-
Notifications
You must be signed in to change notification settings - Fork 91
/
devfile.yaml
103 lines (102 loc) · 2.48 KB
/
devfile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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.12-3.1713832665
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