-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevfile.yaml
More file actions
75 lines (70 loc) · 1.7 KB
/
devfile.yaml
File metadata and controls
75 lines (70 loc) · 1.7 KB
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
schemaVersion: 2.2.2
metadata:
name: demo-webapi-devspaces
version: 1.0.0
displayName: Demo WebAPI (Go)
description: Red Hat Dev Spaces devfile for local development, testing, and running the demo web API.
tags:
- Go
- API
- Red Hat Dev Spaces
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:ubi9-latest
memoryLimit: 2Gi
cpuLimit: "2"
mountSources: true
endpoints:
- name: http-8080
targetPort: 8080
exposure: public
protocol: http
attributes:
controller.devfile.io/storage-type: per-workspace
commands:
- id: install
exec:
label: Install dependencies
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: go mod download
group:
kind: build
isDefault: true
- id: test
exec:
label: Run unit tests
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: go test ./...
group:
kind: test
isDefault: true
- id: build
exec:
label: Build binary
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: mkdir -p bin && go build -o bin/webapp .
group:
kind: build
- id: run
exec:
label: Run API server
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: swag init --parseDependency --parseInternal && go run .
hotReloadCapable: true
group:
kind: run
isDefault: true
- id: swagger
exec:
label: Regenerate OpenAPI docs
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: swag init --parseDependency --parseInternal
events:
postStart:
- install