-
Notifications
You must be signed in to change notification settings - Fork 64
/
outerloop-dockerfile-build-inlined-deploy-devfile.yaml
105 lines (105 loc) · 2.46 KB
/
outerloop-dockerfile-build-inlined-deploy-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
104
105
# Devfile based on the existing Node Sample https://github.com/nodeshift-starters/devfile-sample
schemaVersion: 2.2.0
metadata:
name: nodejs
version: 1.0.1
displayName: Node.js Runtime
description: Stack with Node.js 14
tags: ["NodeJS", "Express", "ubi8"]
projectType: "nodejs"
language: "nodejs"
variables:
CONTAINER_IMAGE: node-image:latest
COMPONENT_NAME: my-node
PORT: "3001"
components:
- name: outerloop-build
image:
imageName: "{{CONTAINER_IMAGE}}"
dockerfile:
uri: ./utils/Dockerfile
buildContext: /project
rootRequired: false
- name: outerloop-deploy
kubernetes:
inlined: |
kind: Deployment
apiVersion: apps/v1
metadata:
name: {{COMPONENT_NAME}}
spec:
replicas: 1
selector:
matchLabels:
app: node-app
template:
metadata:
labels:
app: node-app
spec:
containers:
- name: {{COMPONENT_NAME}}
image: {{CONTAINER_IMAGE}}
ports:
- name: http
containerPort: {{PORT}}
protocol: TCP
resources:
limits:
memory: "128Mi"
cpu: "500m"
- name: runtime
container:
image: registry.access.redhat.com/ubi8/nodejs-14:latest
memoryLimit: 1024Mi
mountSources: true
sourceMapping: /project
endpoints:
- name: http-3000
targetPort: 3000
commands:
- id: install
exec:
component: runtime
commandLine: npm install
workingDir: /project
group:
kind: build
isDefault: true
- id: run
exec:
component: runtime
commandLine: npm start
workingDir: /project
group:
kind: run
isDefault: true
- id: debug
exec:
component: runtime
commandLine: npm run debug
workingDir: /project
group:
kind: debug
isDefault: true
- id: test
exec:
component: runtime
commandLine: npm test
workingDir: /project
group:
kind: test
isDefault: true
- id: build-image
apply:
component: outerloop-build
- id: deployk8s
apply:
component: outerloop-deploy
- id: deploy
composite:
commands:
- build-image
- deployk8s
group:
kind: deploy