This repository was archived by the owner on Apr 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathhosted-che-dogfooding.devfile.yaml
More file actions
148 lines (134 loc) · 4.83 KB
/
hosted-che-dogfooding.devfile.yaml
File metadata and controls
148 lines (134 loc) · 4.83 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
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
141
142
143
144
145
146
147
148
# Copyright (c) 2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# See: https://sipb.mit.edu/doc/safe-shell/
#
#
# A devfile to develpop che-theia projects on https://che.openshift.io.
# For developers who work on Theia or Che-Theia extensions and plugins.
apiVersion: 1.0.0
metadata:
name: theia-dogfooding
projects:
- name: theia
source:
location: 'https://github.com/eclipse-theia/theia.git'
type: git
branch: master
- name: che-theia
source:
location: 'https://github.com/eclipse-che/che-theia.git'
type: git
branch: main
components:
- id: eclipse/che-theia/latest
memoryLimit: 1500M
type: cheEditor
alias: theia-editor
env:
- name: NODE_TLS_REJECT_UNAUTHORIZED
value: "0"
- type: chePlugin
id: che-incubator/typescript/latest
memoryLimit: 2048M
- type: chePlugin
id: redhat/vscode-yaml/latest
- type: chePlugin
id: eclipse/che-machine-exec-plugin/latest
- type: dockerimage
image: 'quay.io/eclipse/che-theia-dev:next'
alias: che-dev
mountSources: true
endpoints:
- name: theia-dev-flow
port: 3010
attributes:
protocol: http
public: 'true'
memoryLimit: 3Gi
env:
- name: BUILD_PATH
value: /tmp
commands:
- name: '1. Init che-theia'
actions:
- workdir: /projects
type: exec
command: |
if [ ! -d "$BUILD_PATH/theia/che/che-theia" ]; then \
echo -e '\e[32mInitializing Che-Theia...\e[0m'; \
mkdir -p $BUILD_PATH/theia/che/che-theia; \
rsync -rtv /projects/theia/ $BUILD_PATH/theia/; \
rsync -rtv /projects/che-theia/ $BUILD_PATH/theia/che/che-theia/; \
cd $BUILD_PATH/theia; \
che-theia init --alias https://github.com/eclipse-che/che-theia=$BUILD_PATH/theia/che/che-theia; \
echo -e '\e[32mDone\e[0m'; \
else \
echo 'Che-Theia is already initialized.'; \
fi
component: che-dev
- name: '2. Rsync sources'
actions:
- workdir: /projects
type: exec
command: |
if [ -d "$BUILD_PATH/theia/che/che-theia" ]; then \
echo -e '\e[32mRsyncing sources...\e[0m'; \
rsync -rtv --exclude='node_mobules' --exclude='package.json' --exclude='root-compilation.tsconfig.json' /projects/theia/ $BUILD_PATH/theia/; \
rsync -rtv --exclude='node_mobules' --exclude='package.json' /projects/che-theia/ $BUILD_PATH/theia/che/che-theia/; \
echo -e '\e[32mDone\e[0m'; \
else \
echo 'Che-Theia is not initialized.'; \
echo -e 'You need to run \e[32m1. Init che-theia\e[0m command the first.'; \
fi
component: che-dev
- name: '3. Build che-theia'
actions:
- workdir: /projects
type: exec
command: |
if [ -d "$BUILD_PATH/theia/examples/assembly" ]; then \
echo -e '\e[32mBuilding che-theia...\e[0m'; \
cd $BUILD_PATH/theia; \
yarn; \
echo -e '\e[32mDone\e[0m'; \
else \
echo 'Che-Theia is not initialized.'; \
echo -e 'You need to run \e[32m1. Init che-theia\e[0m command the first.'; \
fi
component: che-dev
- name: '4.1. Prepare theia-* dirs'
actions:
- workdir: /projects
type: exec
command: |
echo -e '\e[32mPreparing theia-* dirs...\e[0m'; \
mkdir -p /projects/theia-default-plugins; \
mkdir -p /projects/theia-plugins; \
mkdir -p /projects/theia-projects-dir; \
cp -u /default-theia-plugins/* /projects/theia-default-plugins/; \
echo -e '\e[32mDone\e[0m'
component: theia-editor
- name: '4.2. Launch'
actions:
- workdir: /projects
type: exec
command: |
if [ -d "$BUILD_PATH/theia/examples/assembly" ]; then \
cd $BUILD_PATH/theia/examples/assembly; \
echo -e '\e[32mLaunching che-theia...\e[0m'; \
export CHE_PROJECTS_ROOT="/projects/theia-projects-dir"; \
export THEIA_DEFAULT_PLUGINS="local-dir:///projects/theia-default-plugins"; \
export THEIA_PLUGINS="local-dir:///projects/theia-plugins"; \
export THEIA_PLUGIN_ENDPOINT_DISCOVERY_PORT="2506"; \
yarn theia start /projects/theia-projects-dir --hostname=0.0.0.0 --port=3010; \
echo -e '\e[32mDone\e[0m'; \
else \
echo 'Che-Theia is not build.'; \
echo -e 'You need to initialize Che-Theia by \e[32m1. Init che-theia\e[0m command and then build by \e[32m3. Build che-theia\e[0m.'; \
fi
component: che-dev