This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
/
Copy pathdevfile.yaml
39 lines (38 loc) · 1.92 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
schemaVersion: 2.2.0
metadata:
name: che-devfile-registry
components:
- name: builder
container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
memoryRequest: 256Mi
memoryLimit: 8Gi
cpuRequest: 100m
cpuLimit: 2000m
env:
- name: CONCURRENTLY_OPTS
value: -m 1
commands:
- id: build
exec:
label: 1. Build and Publish a Custom Devfile Registry
component: builder
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-devfile-registry &&
podman tag quay.io/eclipse/che-devfile-registry: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-devfile-registry
exec:
label: "2. Configure Che to use the Custom Devfile Registry"
component: builder
commandLine: |
export IMAGE=image-registry.openshift-image-registry.svc:5000/$(kubectl get sa default -o json | jq -r '.metadata.namespace')/che-devfile-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-checluster.sh "${IMAGE}"