Procedure
To add a devfile:
-
Get the name of the Kubernetes pod that hosts the devfile registry container. To do this, filter the
app=che-devfile-registrylabel:$ DEVFILE_REG_POD=$(kubectl get -o custom-columns=NAME:.metadata.name \ --no-headers -l app=che-devfile-registry pod)
-
Create the new devfile directory in the devfile registry container, if it does not exist.
$ STACK="my-stack" $ kubectl exec $\{DEVFILE_REG_POD} -i -t -- \ mkdir -p /var/www/html/devfiles/$\{STACK} -
Copy the
devfile.yamlfile and themeta.yamlfile to the container.$ LOCAL_META="$(PWD)/meta.yaml" $ LOCAL_DEVFILE="$(PWD)/devfile.yaml" $ kubectl cp "$\{LOCAL_META}" \ $\{DEVFILE_REG_POD}:/var/www/html/devfiles/$\{STACK} $ kubectl cp "$\{LOCAL_DEVFILE}" \ $\{DEVFILE_REG_POD}:/var/www/html/devfiles/$\{STACK} -
Update the
index.jsonfile of the registry.$ kubectl exec $\{DEVFILE_REG_POD} -i -t -- \ /var/www/html/index.sh > /var/www/html/devfiles/index.json