|
| 1 | +schemaVersion: 2.2.0 |
| 2 | +metadata: |
| 3 | + name: ds-plugin-registry-dev |
| 4 | +components: |
| 5 | + - name: builder |
| 6 | + container: |
| 7 | + image: quay.io/devfile/universal-developer-image:ubi8-latest |
| 8 | + memoryRequest: 256Mi |
| 9 | + memoryLimit: 8Gi |
| 10 | + cpuRequest: 100m |
| 11 | + cpuLimit: 2000m |
| 12 | + env: |
| 13 | + - name: CONCURRENTLY_OPTS |
| 14 | + value: -m 1 |
| 15 | + endpoints: |
| 16 | + - name: openvsx |
| 17 | + exposure: internal |
| 18 | + targetPort: 5432 |
| 19 | +commands: |
| 20 | + - id: podman-login |
| 21 | + exec: |
| 22 | + label: "1. Login to registry.redhat.io" |
| 23 | + commandLine: podman login registry.redhat.io |
| 24 | + component: builder |
| 25 | + - id: build |
| 26 | + exec: |
| 27 | + label: "2. Build and Publish a Custom Plugin Registry" |
| 28 | + component: builder |
| 29 | + workingDir: ${PROJECTS_ROOT}/devspaces/dependencies/che-plugin-registry |
| 30 | + commandLine: | |
| 31 | + set -o xtrace; |
| 32 | + rm -rf output; |
| 33 | + mkdir output; |
| 34 | + BUILDER=podman SKIP_TEST=true SKIP_FORMAT=true SKIP_LINT=true NODE_BUILD_OPTIONS="-max-old-space-size=1024" ./build.sh && |
| 35 | + export IMAGE=image-registry.openshift-image-registry.svc:5000/$(kubectl get sa default -o json | jq -r '.metadata.namespace')/che-plugin-registry && |
| 36 | + podman tag quay.io/devspaces/pluginregistry-rhel8:next ${IMAGE} && |
| 37 | + podman login --tls-verify=false -u $(oc whoami | tr -d :) -p $(oc whoami -t) image-registry.openshift-image-registry.svc:5000 && |
| 38 | + podman push --tls-verify=false "${IMAGE}" |
| 39 | + - id: configure-custom-plugin-registry |
| 40 | + exec: |
| 41 | + label: "3. Configure Che to use the Custom Plugin Registry" |
| 42 | + component: builder |
| 43 | + workingDir: ${PROJECTS_ROOT}/devspaces/dependencies/che-plugin-registry |
| 44 | + commandLine: | |
| 45 | + export IMAGE=image-registry.openshift-image-registry.svc:5000/$(kubectl get sa default -o json | jq -r '.metadata.namespace')/che-plugin-registry && |
| 46 | + export CHECLUSTER_NAMESPACE="$(kubectl get checluster --all-namespaces -o json | jq -r '.items[0].metadata.namespace')" && |
| 47 | + 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) && |
| 48 | + kubectl patch serviceaccount default -n "${CHECLUSTER_NAMESPACE}" -p '{"imagePullSecrets": [{"name": "regcred"}]}' && |
| 49 | + ./patch-cluster.sh "${IMAGE}" |
| 50 | + - id: enable-embedded-openvsx |
| 51 | + exec: |
| 52 | + label: "4. Configure Che to use the embedded Eclipse Open VSX server" |
| 53 | + component: builder |
| 54 | + workingDir: ${PROJECTS_ROOT}/devspaces/dependencies/che-plugin-registry |
| 55 | + commandLine: | |
| 56 | + export CHECLUSTER_NAME="$(kubectl get checluster --all-namespaces -o json | jq -r '.items[0].metadata.name')" && |
| 57 | + export CHECLUSTER_NAMESPACE="$(kubectl get checluster --all-namespaces -o json | jq -r '.items[0].metadata.namespace')" && |
| 58 | + export PATCH='{"spec":{"components":{"pluginRegistry":{"openVSXURL":""}}}}' && |
| 59 | + kubectl patch checluster "${CHECLUSTER_NAME}" --type=merge --patch "${PATCH}" -n "${CHECLUSTER_NAMESPACE}" |
0 commit comments