-
Notifications
You must be signed in to change notification settings - Fork 2
/
devfile-cai.yaml
140 lines (128 loc) · 3.69 KB
/
devfile-cai.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
schemaVersion: 2.2.0
metadata:
name: CAI
#attributes:
# controller.devfile.io/storage-type: ephemeral
components:
- name: tools
container:
image: alm-repos.sogei.it/devfile/universal-developer-image:ubi8-4407fa4_v2.4
env:
- name: spring_profiles_active
value: devspaces
# - name: MAVEN_OPTS
# value: "-Dmaven.wagon.http.ssl.insecure=true"
endpoints:
- exposure: none
name: debug
protocol: tcp
targetPort: 5005
- exposure: public
name: app
protocol: http
targetPort: 8080
path: /
volumeMounts:
- name: m2
path: /home/user/.m2
memoryLimit: 4G
memoryRequest: 2G
cpuLimit: 1500m
cpuRequest: 400m
mountSources: true
- name: m2
volume:
size: 2G
# - name: kafka
# container:
# image: docker.io/lsnidero/kafka
# endpoints:
# - name: kafka-broker
# targetPort: 9092
# - name: zookeeper
# targetPort: 2181
# exposure: internal
# volumeMounts:
# - name: zookeeper-vol
# path: /var/lib/zookeeper
# memoryLimit: 768Mi
# mountSources: true
#
#
# - name: zookeeper-vol
# volume:
# size: 1G
# ephemeral: true
#
# - name: kafka-ui
# container:
# image: provectuslabs/kafka-ui:v0.5.0
# endpoints:
# - name: kafka-ui
# targetPort: 8888
# memoryLimit: 1024Mi
# cpuLimit: 500m
# cpuRequest: 10m
# env:
# - name: KAFKA_CLUSTERS_0_NAMEl
# value: local
# - name: KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS
# value: localhost:9092
# - name: KAFKA_CLUSTERS_0_ZOOKEEPER
# value: localhost:2181
# - name: KAFKA_CLUSTERS_0_READONLY
# value: "false"
# - name: SERVER_PORT
# value: "8888"
#
# - name: oracle
# container:
# image: 'alm-repos.sogei.it/ptt/oracle-init:1.1'
# command:
# - sleep
# - infinity
# memoryLimit: 768Mi
# mountSources: true
commands:
- id: setup-environment
exec:
label: 0.1 - Initial Environment Setup
component: tools
workingDir: ${PROJECTS_ROOT}
commandLine: |
# set java version
. /home/user/.sdkman/bin/sdkman-init.sh
JAVA_V=17.0.3-tem
sdk install java $JAVA_V
sdk default java $JAVA_V
# configure settings.xml and .npmrc
setup_configurations_files(){
MVN_SETTINGS_REMOTE="https://alm-repos.sogei.it/repository/codeready-plugins/assets/settings-https-v3.xml"
mkdir -p /home/user/.m2
wget -q --no-check-certificate $MVN_SETTINGS_REMOTE -O /home/user/.m2/settings.xml
echo registry=https://alm-repos.sogei.it/repository/npm-group/ > /home/user/.npmrc
echo cafile=/etc/pki/ca-trust/source/anchors/alm-repos.sogei.it-ca.crt >> /home/user/.npmrc
}
setup_configurations_files
# configure git credential.helper
git config --global credential.helper 'cache --timeout 36000'
- id: download-repos
exec:
label: 0.2 - Download Repos
component: tools
workingDir: ${PROJECTS_ROOT}
commandLine: curl -s https://alm-repos.sogei.it/repository/codeready-plugins/assets/scripts/cai/setup-cai-v1.sh | bash
- id: run-debug
exec:
label: 1 - Run Debug
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: |
mvn spring-boot:run -DskipTests \
-Dspring-boot.run.jvmArguments='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005,quiet=y'
group:
kind: run
isDefault: true
events:
postStart:
- setup-environment