Skip to content

Commit

Permalink
add workspace loader flow for code contribution
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii <[email protected]>
  • Loading branch information
olexii4 committed Aug 14, 2019
1 parent c31a25e commit 595623e
Showing 1 changed file with 84 additions and 3 deletions.
87 changes: 84 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ For the whole workflows, we will need a workspace with such containers:

All containers have `/projects` folder mounted, which is shared among them.


Developer workflow:

1. Start the workspace with the devfile, it is cloning Che repo.
Expand All @@ -77,9 +76,8 @@ The devfile could be started using `chectl`:
```
chectl workspace:start -f https://raw.githubusercontent.com/eclipse/che/master/dashboard/devfile.yaml
```
At workspace start, Che will clone Che source code (including the dashboard)


At workspace start, Che will clone Che source code (including the dashboard)

#### Step 2: Build

Expand Down Expand Up @@ -113,6 +111,89 @@ You can use the che command `dashboard_dev_server` (command pallette > Run task
$ node_modules/.bin/gulp serve --server=<che_api_url>
```

### Workspace Loader
Workspace loader source code is located in [<this.repo>/workspace-loader](./workspace-loader/) folder.
Here is the developer workflow if you want to contribute to it:

#### Devfile for workspace loader development

The devfile: [<this.repo>/workspace-loader/devfile.yaml](./workspace-loader/devfile.yaml)

In this section, we show how to setup a Che 7 environment to work on the che workspace loader, and how to use it.
For the whole workflows, we will need a workspace with such containers:

- Workspace Loader Dev container (a.k.a ws-loader-dev) is a all in one container for running commands such as build, test or start the workspace loader server.

All containers have `/projects` folder mounted, which is shared among them.

Developer workflow:

1. Start the workspace with the devfile, it is cloning Che repo.
2. Install dependencies
3. Build
4. Code ...
5. Run unit test
6. Start workspace loader server and preview

#### Step 1: Start the workspace with the devfile, it is cloning Che repo.
In this section we are going to start a new workspace to work on workspace loader. The new workspace will clone the `che` project. It will also setup the containers and commands in the `My workspace` view. We will use these commands in the next steps.

The workspace could be created and started from a devfile using `chectl`:

```bash
chectl workspace:start --devfile=https://raw.githubusercontent.com/eclipse/che/master/workspace-loader/devfile.yaml
```

or as a factory `https://<CheInstance>/f?url=https://raw.githubusercontent.com/eclipse/che/master/workspace-loader/devfile.yaml`

At workspace start, Che will clone Che source code (including the workspace-loader)

#### Step 2: Install dependencies

In this section we are going to install workspace loader dependencies.

You can use the che command `[workspace loader] install dependencies` (command pallette > Run task > … or containers view)
Basically, this command will run

```bash
# [ws-loader-dev]
$ yarn
```

#### Step 3: Build

In this section we are going to build the workspace loader project.

You can use the che command `[workspace loader] run build` (command pallette > Run task > … or containers view)
Basically, this command will run

```bash
# [ws-loader-dev]
$ yarn build
```

#### Step 4: Code ...

#### Step 5: Run unit test (optional)
In this step, we will run the Workspace Lloader unit tests:

You can use the che command `[workspace loader] run tests` (command pallette > Run task > … or containers view)
Basically, this command will run

```bash
# [ws-loader-dev]
$ yarn test
```

#### Step 6: Start workspace loader server and preview
In this step, we will run the workspace loader server and see the live reloadable preview.

You can use the che command `[workspace loader] start dev server` (command pallette > Run task > … or containers view)

```bash
# [ws-loader-dev]
$ yarn start --disable-host-check --public=$(echo ${server.dev-server} | sed -e s/https:\\/\\/// -e s/http:\\/\\/// -e s/\\///) --host="0.0.0.0" --env.target=${CHE_API_EXTERNAL%????}
```

### Che server a.k.a WS master
To be provided soon.

0 comments on commit 595623e

Please sign in to comment.