Skip to content

Commit

Permalink
move files into correct path; add missing section re: command palette…
Browse files Browse the repository at this point in the history
… for git clone

Change-Id: I1b0dd74a32acbb30f05dd67cc85bc6a3a8d78a99
Signed-off-by: nickboldt <[email protected]>
  • Loading branch information
nickboldt committed Jul 2, 2019
1 parent cf6150f commit b2cce59
Show file tree
Hide file tree
Showing 8 changed files with 271 additions and 47 deletions.
12 changes: 3 additions & 9 deletions src/main/_data/sidebars/che_7_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ entries:
- title: End-user Guide
output: web
folderitems:
- title: Creating a workspace from code samples
url: creating-starting-workspaces.html
output: web
- title: Creating a workspace by importing source code of your project
url: ide-projects.html
output: web
- title: Using developer environments - workspaces
url: using-developer-environments-workspaces.html
output: web
Expand Down Expand Up @@ -93,9 +87,9 @@ entries:
#- title: Che FAQ
#url: che-faq.html
#output: web
#- title: End-user tasks
#url: end-user-tasks.html
#output: web
- title: End-user tasks
url: end-user-tasks.html
output: web
- title: Contributor tasks
url: contributor-tasks.html
output: web
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/images/workspaces/git-clone-command.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/images/workspaces/welcome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: End-user tasks
keywords:
keywords:
tags: []
sidebar: che_7_docs
permalink: che-7/end-user-tasks.html
folder: che-7/hands-on-guidance
summary:
summary:
---

:parent-context-of-end-user-tasks: {context}
Expand Down Expand Up @@ -33,15 +33,15 @@ include::proc_creating-a-workspace-by-importing-source-code-of-your-project.adoc

include::proc_configuring-a-che-workspace-using-a-devfile.adoc[leveloffset=+1]

include::proc_importing-a-kubernetes-application-into-a-che-worskspace.adoc[leveloffset=+1]
// include::proc_importing-a-kubernetes-application-into-a-che-worskspace.adoc[leveloffset=+1]

include::proc_using-a-visual-studio-code-extension-in-che.adoc[leveloffset=+1]
// include::proc_using-a-visual-studio-code-extension-in-che.adoc[leveloffset=+1]

include::proc_configuring-plug-ins.adoc[leveloffset=+1]
// include::proc_configuring-plug-ins.adoc[leveloffset=+1]

include::proc_remotely-accessing-your-workspace.adoc[leveloffset=+1]
// include::proc_remotely-accessing-your-workspace.adoc[leveloffset=+1]

include::proc_configuring-your-vcs-credentials-for-your-workspaces.adoc[leveloffset=+1]
// include::proc_configuring-your-vcs-credentials-for-your-workspaces.adoc[leveloffset=+1]



Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,87 @@
[id="configuring-a-che-workspace-using-a-devfile_{context}"]
= Configuring a Che workspace using a Devfile

This paragraph is the procedure module introduction: a short description of the procedure.
This section will show how to select a workspace, loading in the required stack and a sample project, all in one step.

Please refer to the link:using-developer-environments-workspaces.html#making-a-workspace-portable-using-a-devfile_using-developer-environments-workspaces[Devfile user guide] and link:https://redhat-developer.github.io/devfile/devfile[Devfile specifications] for detailed information how to add or remove components, or how to set memory and environment variables.

[discrete]
== Prerequisites

* A bulleted list of conditions that must be satisfied before the user starts following this assembly.
* You can also link to other modules or assemblies the user must follow before starting this assembly.
* Delete the section title and bullets if the assembly has no prerequisites.
* You need an OKD, OCP, or OSD cluster, if using Che on Openshift. See below for use of link:https://www.okd.io/minishift/[Minishift].
* Or, you need a Kubernetes cluster such as link:https://github.com/kubernetes/minikube#installation[Minikube] to use Che on Kubernetes.

[discrete]
== Procedure

. Start each step with an active verb.
=== Importing a project and workspace in one step using a devfile

In Che 7, stacks are defined as link:using-developer-environments-workspaces.html#making-a-workspace-portable-using-a-devfile_using-developer-environments-workspaces[devfiles], instead of container images. This affords more flexibility when defining the project(s), IDE, commands, tools, and application runtimes needed in your workspace.

So where in the past you might have included a `Dockerfile` in your project's repo, now you can include a `devfile.yaml` file in the root of your git project instead.

==== The minimal devfile

The minimum content you need in a `devfile.yaml` file is:

* link:https://redhat-developer.github.io/devfile/devfile#apiversion[apiVersion]
* link:https://redhat-developer.github.io/devfile/devfile#metadata[metadata name]
* link:https://redhat-developer.github.io/devfile/devfile#projects[projects name and source]

```
apiVersion: 1.0.0
metadata:
name: che-in-che-out
projects:
- name: che
source:
type: git
location: 'https://github.com/eclipse/che.git'
```

For a more complete example, see link:https://github.com/eclipse/che/blob/master/devfile.yaml[Eclipse Che in Che devfile.yaml].


==== Creating a workspace from a devfile

. Commit a `devfile.yaml` into the root of your git repo.

. Include one command or action per step.
. Once your repo contains a `devfile.yaml`, point a running Che 7 instance at that link:https://github.com/eclipse/che[project] and it will use the discovered link:https://github.com/eclipse/che/blob/master/devfile.yaml[devfile.yaml] to build you a workspace via its Factory API, `/f?url=`.

. Use an unnumbered bullet (*) if the procedure includes only one step.
* For example, if you're using link:creating-starting-workspaces#minishift[Che inside Minishift]:

* http://che-mini-che.`your.IP.address.here`.nip.io/f?url=link:https://github.com/eclipse/che[https://github.com/eclipse/che]

image:workspaces/che-in-che-devfile.png[Che in Che]

. You can also point at a plain text file:

* http://che-mini-che.`your.IP.address.here`.nip.io/f?url=link:https://gist.githubusercontent.com/nickboldt/9551284c2c779a93ccf16bc801416205/raw/7ad1e949880d7f8ed30360e74bb9f8426450db05/devfile.yaml[https://path.to/my/devfile.yaml]

. If you are familiar with link:https://github.com/che-incubator/chectl/[chectl], you can also reference a local devfile.

* For example, if you're using link:creating-starting-workspaces#minishift[Che inside Minishift]:

```
wget https://raw.githubusercontent.com/eclipse/che/master/devfile.yaml -o /tmp/devfile.yaml
./chectl workspace:start --devfile=/tmp/devfile.yaml --chenamespace=mini-che
```
```
$➔ ./chectl workspace:start --devfile=/tmp/devfile.yaml -n mini-che
✔ Retrieving Che Server URL...http://che-mini-che.`your.IP.address.here`.nip.io
✔ Verify if Che server is running
✔ Create workspace from Devfile /tmp/devfile.yaml

Workspace IDE URL:
http://che-mini-che.`your.IP.address.here`.nip.io/dashboard/#/ide/che/che-in-che

```

[discrete]
== Additional resources

* A bulleted list of links to other material closely related to the contents of the procedure module.
* For more details on writing procedure modules, see the link:https://github.com/redhat-documentation/modular-docs#modular-documentation-reference-guide[Modular Documentation Reference Guide].
* Use a consistent system for file names, IDs, and titles. For tips, see _Anchor Names and File Names_ in link:https://github.com/redhat-documentation/modular-docs#modular-documentation-reference-guide[Modular Documentation Reference Guide].
* link:using-developer-environments-workspaces.html#making-a-workspace-portable-using-a-devfile_using-developer-environments-workspaces[Devfile user guide]
* link:https://redhat-developer.github.io/devfile/devfile[Devfile specifications]

* link:https://docs.okd.io/latest/minishift/getting-started/preparing-to-install.html[Minishift installation]
* link:https://github.com/kubernetes/minikube#installation[Minikube installation]
Original file line number Diff line number Diff line change
@@ -1,27 +1,99 @@
[id="creating-a-workspace-by-importing-source-code-of-your-project_{context}"]
= Creating a workspace by importing source code of your project

This paragraph is the procedure module introduction: a short description of the procedure.
This section is about how to create a new workspace to edit an existing codebase. There are 3 ways to do that:

* xref:creating-a-workspace-from-code-sample_{context}#change-the-workspace-configuration[Select a stack from the User Dashboard but change the project]
* Add a devfile to a git repository and starting the workspace using chectl or a factory
* Import a project in a running workspace from the editor

[discrete]
== Prerequisites

* A bulleted list of conditions that must be satisfied before the user starts following this assembly.
* You can also link to other modules or assemblies the user must follow before starting this assembly.
* Delete the section title and bullets if the assembly has no prerequisites.
* You need an OKD, OCP, or OSD cluster, if using Che on Openshift. See below for use of link:https://www.okd.io/minishift/[Minishift].
* Or, you need a Kubernetes cluster such as link:https://github.com/kubernetes/minikube#installation[Minikube] to use Che on Kubernetes.

[discrete]
== Procedure
== Importing from the dashboard

There are at least two ways to import a project via the User Dashboard.

From the User Dashboard, select Workspaces, then select your workspace by clicking on its name, or use the gear icon. The former will link you to the workspace's *Overview* tab, while the latter will link to the *Config* tab where you can enter your own YAML configuration.

In either case, click the *Projects* tab next.

From the *Projects* tab of your workspace's configuration page in the User Dashboard, click the Add Project button. You can then import a sample project, create a blank project, import from a git project, or import from a zip file.

image::workspaces/workspace-config-projects.png[Add projects to workspace]

=== Create a new repository

To add a link:https://github.com/che-samples/blank[blank project], give it a name and a description:

image::workspaces/add-blank-project.png[Add blank project]

[NOTE]
====
While you can add a project to a non-running workspace, you cannot delete it until you start the workspace.
====

Next, open your workspace by clicking the green *Open* button.

image::workspaces/open-blank-project.png[Your empty project]

=== Edit an existing repository

To edit an existing repository, choose the git project or zip file, and Che will load it into your workspace.

image::workspaces/add-git-project.png[Add existing git project]

Next, open your workspace by clicking the green *Open* button.

image::workspaces/open-git-project.png[Your git project]

=== Edit commands after importing a project

. Start each step with an active verb.
Once you have a project, you can add commands to it. This allows you to more easily run, debug, or launch your application in a browser.

. Include one command or action per step.
You can do this via the workpace's *Config* tab:

. Use an unnumbered bullet (*) if the procedure includes only one step.
image::workspaces/workspace-config-add-commands.png[Add commands to workspace]

Then inside the workspace, use run a command from the menu *Terminal* > *Run Task...*.

image::workspaces/run-command.png[Run task]

You can configure the commands from the menu *Terminal* > *Configure Tasks...*.

image::workspaces/configure-command.png[Configure tasks]

== Importing to a running workspace with `git clone` command

In addition to the approach above, where you can add projects via your workspace's *Projects* or *Config* tab, you can simply start a workspace, and use `git clone` from the command palette.

image::workspaces/welcome.png[Welcome screen]

Open the command palette with `F1` or `CTRL-SHIFT-P`, or from the link in the Welcome screen.

image::workspaces/git-clone-command.png[Invoke git clone command]

Enter the path to the project you want to clone.

image::workspaces/git-clone-command-2.png[Configure git clone command]

== Importing to a running workspace with `git clone` in a terminal

In addition to the approach above, where you can add projects via your workspace's *Projects* or *Config* tab, you can simply start a workspace, open a *Terminal*, and use `git clone` to pull code.

image::workspaces/git-clone-terminal.png[Run git clone in a terminal]

Note that while this approach will store code in the workspace, it will NOT update the workspace's configuration, so you will NOT see projects imported this way in the *Projects* or *Config* tab.

Similarly, if you delete a project, that you previously added via the User Dashboard, from the workspace with `rm -fr myproject`, it may still appear in the *Projects* or *Config* tab.

[discrete]
== Additional resources

* A bulleted list of links to other material closely related to the contents of the procedure module.
* For more details on writing procedure modules, see the link:https://github.com/redhat-documentation/modular-docs#modular-documentation-reference-guide[Modular Documentation Reference Guide].
* Use a consistent system for file names, IDs, and titles. For tips, see _Anchor Names and File Names_ in link:https://github.com/redhat-documentation/modular-docs#modular-documentation-reference-guide[Modular Documentation Reference Guide].
* link:https://docs.okd.io/latest/minishift/getting-started/preparing-to-install.html[Minishift installation]
* link:https://github.com/kubernetes/minikube#installation[Minikube installation]

Loading

0 comments on commit b2cce59

Please sign in to comment.