Skip to content

Commit

Permalink
Putting examples in boxes, adding missing verification steps (#1937)
Browse files Browse the repository at this point in the history
* Putting examples in boxes, adding missing verification steps

Signed-off-by: Michal Maléř <mmaler@redhat.com>

* Putting examples in boxes, adding missing verification steps

Signed-off-by: Michal Maléř <mmaler@redhat.com>

* Verification steps

Signed-off-by: Michal Maléř <mmaler@redhat.com>

* missing step

Signed-off-by: Michal Maléř <mmaler@redhat.com>

* conflict

Signed-off-by: Michal Maléř <mmaler@redhat.com>

* conflict

Signed-off-by: Michal Maléř <mmaler@redhat.com>

* the old friend Vale

Signed-off-by: Michal Maléř <mmaler@redhat.com>

* Update modules/end-user-guide/partials/proc_overriding-devfile-values-using-factory-parameters.adoc

Co-authored-by: Serhii Leshchenko <sleshche@redhat.com>

Co-authored-by: Serhii Leshchenko <sleshche@redhat.com>
Co-authored-by: Yana Hontyk <yhontyk@redhat.com>
  • Loading branch information
3 people committed Apr 8, 2021
1 parent 4010eef commit a4077d4
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Module included in the following assemblies:
//
// configuring-a-workspace-using-a-devfile
// creating-a-workspace-from-a-remote-devfile

[id="allowing-users-to-define-workspace-deployment-labels-and-annotations_{context}"]
= Allowing users to define workspace deployment labels and annotations
Expand All @@ -9,14 +9,17 @@ This section describes how to customize workspace deployment labels and annotati


.Prerequisites

* A running instance of {prod}. To install an instance of {prod}, see xref:installation-guide:installing-che.adoc[].
* A publicly accessible standalone `devfile.yaml` file. See xref:making-a-workspace-portable-using-a-devfile.adoc[] for detailed information about creating and using devfiles.

.Procedure

. Open the workspace by navigating to the following URL: `pass:c,a,q[{prod-url}/f?url=https://__<hostURL>__/devfile.yaml&workspaceDeploymentLabels=__<url_encoded_comma_separated_key_values>__&workspaceDeploymentAnnotations=__<url_encoded_comma_separated_key_values override>__]`

.Example of overriding the `deployment labels`
.Example of overriding the `deployment labels`

====
Consider the following labels to add:
[subs="+quotes"]
Expand All @@ -37,7 +40,6 @@ The resulting workspace has the following deployment labels:
[subs="+quotes"]
----
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -57,9 +59,11 @@ metadata:
spec:
...
----
====

.Example of overriding the `deployment annotations`

====
Consider the following annotations to add:
[subs="+quotes"]
Expand All @@ -81,7 +85,6 @@ The resulting workspace has the following deployment annotations:
[subs="+quotes"]
----
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -100,3 +103,53 @@ metadata:
resourceVersion: "213191"
...
----
====

.Verification steps

To display the deployment labels and annotations:

. Get the name of the user's namespace:

pass:[<!-- vale Vale.Terms = NO -->]

.. Using {prod-short} Dashboard, move to the *Workspaces* tab and read the name of the {orch-name} Namespace field.

pass:[<!-- vale Vale.Terms = YES -->]

. Log in to the cluster:

.. Retrieve the {prod-short} cluster URL from the `checluster` CR (Custom Resource), run:
+
[options="nowrap",role=white-space-pre]
----
$ oc get checluster --output jsonpath='{.items[0].status.cheURL}'
----

.. Log in:
+
[subs="+attributes,+quotes"]
----
$ oc login -u _<username>_ -p _<password>_ _<cluster_URL>_
----

pass:[<!-- vale Vale.Terms = NO -->]

. Display the deployment labels and annotations for all deployments in the namespace using the {orch-name} Namespace name from the first step:
+
[subs="+attributes,+quotes"]
----
$ oc get deployment -n __<NAMESPACE>__ -o=custom-columns="NAMESPACE:.metadata.namespace,NAME:.metadata.name,LABELS:.metadata.labels,ANNOTATIONS:.metadata.annotations"
----


////
. To display the deployment labels and annotations for a specific deploymen:
+
[subs="+attributes,+quotes"]
----
$ oc get deployment/__<deployment-name>__ -n __<NAMESPACE>__ -o=custom-columns="NAMESPACE:.metadata.namespace,NAME:.metadata.name,LABELS:.metadata.labels,ANNOTATIONS:.metadata.annotations"
----
////

pass:[<!-- vale Vale.Terms = YES -->]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Module included in the following assemblies:
//
// configuring-a-workspace-using-a-devfile
// creating-a-workspace-from-a-remote-devfile

[id="creating-a-workspace-from-a-feature-branch-of-a-git-repository_{context}"]
= Creating a workspace from a feature branch of a Git repository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
// Module included in the following assemblies:
//
// configuring-a-workspace-using-a-devfile
// creating-a-workspace-from-a-remote-devfile

[id="creating-a-workspace-from-the-default-branch-of-a-git-repository_{context}"]
= Creating a workspace from the default branch of a Git repository

It is possible to create a {prod-short} workspace by pointing to a devfile that is stored in a Git source repository. The {prod-short} instance then uses the discovered link:https://github.com/eclipse/che/blob/master/devfile.yaml[devfile.yaml] file to build a workspace using the factory URL (`/f?url=`) API.


The factory URL exist in two forms:

* the short form `/#$URL`
* long `/f?url=$URL` form that supports additional configuration parameters used in previous versions of {prod-short}

.Prerequisites

* A running instance of {prod}. To install an instance of {prod}, see xref:installation-guide:installing-che.adoc[].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Module included in the following assemblies:
//
// configuring-a-workspace-using-a-devfile
// creating-a-workspace-from-a-remote-devfile

[id="creating-a-workspace-from-a-publicly-accessible-standalone-devfile-using-http_{context}"]
= Creating a workspace from a publicly accessible standalone devfile using HTTP
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Module included in the following assemblies:
//
// configuring-a-workspace-using-a-devfile
// creating-a-workspace-from-a-remote-devfile

[id="overriding-devfile-values-using-factory-parameters_{context}"]
= Overriding devfile values using factory parameters
Expand All @@ -13,19 +13,21 @@ Values in the following sections of a remote devfile can be overridden using spe
* `attributes`

.Prerequisites

* A running instance of {prod}. To install an instance of {prod}, see xref:installation-guide:installing-che.adoc[].
* A publicly accessible standalone `devfile.yaml` file. See xref:making-a-workspace-portable-using-a-devfile.adoc[] for detailed information about creating and using devfiles.

.Procedure

. Open the workspace by navigating to the following URL: `pass:c,a,q[{prod-url}/f?url=https://__<hostURL>__/devfile.yaml&override.__<parameter.path>__=__<value>__]`

.Example of overriding the `generateName` property

====
Consider the following initial devfile:
[subs="+quotes"]
----
---
apiVersion: 1.0.0
metadata:
generateName: golang-
Expand All @@ -44,21 +46,21 @@ The resulting workspace has the following devfile model:
[subs="+quotes"]
----
---
apiVersion: 1.0.0
metadata:
generateName: myprefix
projects:
...
----
====

.Example of overriding project source branch property

====
Consider the following initial devfile:
[subs="+quotes"]
----
---
apiVersion: 1.0.0
metadata:
generateName: java-mysql-
Expand Down Expand Up @@ -92,16 +94,16 @@ projects:
branch: 1.0.x
...
----

====


.Example of overriding or creating an attribute value

====
Consider the following initial devfile:
[subs="+quotes"]
----
---
apiVersion: 1.0.0
metadata:
generateName: golang-
Expand Down Expand Up @@ -144,7 +146,6 @@ The resulting workspace has the following devfile model:
[subs="+quotes"]
----
---
apiVersion: 1.0.0
metadata:
generateName: golang-
Expand All @@ -153,3 +154,8 @@ attributes:
projects:
...
----
====

.Verification steps

. Using {prod-short} Dashboard, move to the *Devfile* tab of the newly created workspace and check its content.

0 comments on commit a4077d4

Please sign in to comment.