-
Notifications
You must be signed in to change notification settings - Fork 99
/
.devfile.yaml
86 lines (85 loc) · 3.83 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
schemaVersion: 2.2.2
metadata:
name: ds-plugin-registry-dev
components:
- name: builder
container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
memoryRequest: 256Mi
memoryLimit: 8Gi
cpuRequest: 100m
cpuLimit: 2000m
volumeMounts:
- name: local
path: /home/user/.local/
env:
- name: CONCURRENTLY_OPTS
value: -m 1
endpoints:
- name: openvsx
exposure: internal
protocol: https
targetPort: 5432
- volume:
ephemeral: true
name: local
commands:
- id: podman-login
exec:
label: "1. Login to registry.redhat.io"
commandLine: podman login registry.redhat.io
component: builder
- id: build-publish
exec:
label: "2. Build and Publish a Custom Plugin Registry"
component: builder
workingDir: ${PROJECTS_ROOT}/devspaces/dependencies/che-plugin-registry
commandLine: |
set -o xtrace;
rm -rf output;
mkdir output;
BUILDER=podman SKIP_TEST=true SKIP_FORMAT=true SKIP_LINT=true NODE_BUILD_OPTIONS="-max-old-space-size=1024" ./build.sh &&
export IMAGE=image-registry.openshift-image-registry.svc:5000/$(kubectl get sa default -o json | jq -r '.metadata.namespace')/che-plugin-registry &&
podman tag quay.io/devspaces/pluginregistry-rhel9:next ${IMAGE} &&
podman login --tls-verify=false -u $(oc whoami | tr -d :) -p $(oc whoami -t) image-registry.openshift-image-registry.svc:5000 &&
podman push --tls-verify=false "${IMAGE}"
- id: configure-custom-plugin-registry
exec:
label: "3. Configure Che to use the Custom Plugin Registry"
component: builder
workingDir: ${PROJECTS_ROOT}/devspaces/dependencies/che-plugin-registry
commandLine: |
export IMAGE=image-registry.openshift-image-registry.svc:5000/$(kubectl get sa default -o json | jq -r '.metadata.namespace')/che-plugin-registry &&
export CHECLUSTER_NAMESPACE="$(kubectl get checluster --all-namespaces -o json | jq -r '.items[0].metadata.namespace')" &&
kubectl create secret -n "${CHECLUSTER_NAMESPACE}" docker-registry regcred --docker-server=image-registry.openshift-image-registry.svc:5000 --docker-username=$(oc whoami | tr -d :) --docker-password=$(oc whoami -t) &&
kubectl patch serviceaccount default -n "${CHECLUSTER_NAMESPACE}" -p '{"imagePullSecrets": [{"name": "regcred"}]}' &&
./patch-cluster.sh "${IMAGE}"
- id: enable-embedded-openvsx
exec:
label: "4. Configure Che to use the embedded Eclipse Open VSX server"
component: builder
workingDir: ${PROJECTS_ROOT}/devspaces/dependencies/che-plugin-registry
commandLine: |
export CHECLUSTER_NAME="$(kubectl get checluster --all-namespaces -o json | jq -r '.items[0].metadata.name')" &&
export CHECLUSTER_NAMESPACE="$(kubectl get checluster --all-namespaces -o json | jq -r '.items[0].metadata.namespace')" &&
export PATCH='{"spec":{"components":{"pluginRegistry":{"openVSXURL":""}}}}' &&
kubectl patch checluster "${CHECLUSTER_NAME}" --type=merge --patch "${PATCH}" -n "${CHECLUSTER_NAMESPACE}"
- id: build
exec:
label: "5. Build"
component: builder
workingDir: ${PROJECTS_ROOT}/devspaces/dependencies/che-plugin-registry
commandLine: |
set -o xtrace;
rm -rf output;
mkdir output;
BUILDER=podman SKIP_TEST=true SKIP_FORMAT=true SKIP_LINT=true NODE_BUILD_OPTIONS="-max-old-space-size=1024" ./build.sh
# workaround for https://github.com/eclipse-che/che/issues/22914
- id: cleanup-local-files
exec:
label: "Cleanup local files"
component: builder
commandLine: rm -rf .local/share/ /home/user/.local/share/containers/storage && /entrypoint.sh
events:
postStart:
- "cleanup-local-files"