Skip to content
This repository was archived by the owner on Apr 19, 2021. It is now read-only.

Commit 364f404

Browse files
committed
[docs] Better highlight GitLab and Bitbucket support
1 parent 025afc8 commit 364f404

File tree

4 files changed

+118
-72
lines changed

4 files changed

+118
-72
lines changed

src/docs/context-urls.md

Lines changed: 50 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,89 @@
11
# Context URLs
22

3-
* [GitHub Project Context](#github-project-context)
4-
* [GitHub File Context](#github-file-context)
5-
* [GitHub Issue Context](#github-issue-context)
6-
* [GitHub Pull Request Context](#github-pull-request-context)
3+
* [Repository Context](#repository-context)
4+
* [Branch Context](#branch-context)
5+
* [Pull/Merge Request Context](#pull-merge-request-context)
6+
* [Issue Context](#issue-context)
7+
* [File Context](#file-context)
78

89
Gitpod derives the workspace context from the URL of the repository page from which it was
9-
started. Different issues, pull requests, or branches will result in different workspaces, allowing
10-
developers to easily perform individual tasks in their own isolated environments.
10+
started. Different issues, pull/merge requests, or branches will result in different workspaces, allowing
11+
developers to easily perform different tasks in different isolated environments.
1112

1213
Each workspace includes a full Linux container. From the IDE's terminal, the user can directly
1314
access all development tools of the Linux system and even install missing ones.
1415

1516
In the following we describe the supported contexts and what they do:
1617

17-
## GitHub Project Context
18+
## Repository Context
1819

19-
Creating a Gitpod workspace from the project's base URL does not carry a lot of context.
20-
Gitpod will check out the `master` branch and open the `Readme.md` if it exists.
20+
When you create a Gitpod workspace from the project's base URL (i.e. the repository URL),
21+
Gitpod will clone this repository, check out the default branch, and open the `README.md` if it exists.
2122

22-
An example for this context is:
23+
An example URL for the repository context is:
2324

2425
```
25-
https://github.com/arunoda/learnnextjs-demo
26+
gitpod.io/#https://gitlab.com/gitpod/spring-petclinic
2627
```
2728

28-
## GitHub File Context
29+
## Branch Context
2930

30-
The file context is an extension to the project context, in that Gitpod will check out the
31-
corresponding branch and open the respective file in an editor.
31+
You can also create a Gitpod workspace for a specific branch in a repository. This is similar to the repository context, except that Gitpod will automatically check out the requested branch instead of the repository's default branch.
3232

33-
An example for this context is:
33+
An example URL for the branch context is:
3434

3535
```
36-
https://github.com/arunoda/learnnextjs-demo/blob/getting-started/pages/index.js
36+
gitpod.io/#https://gitlab.com/gitpod/spring-petclinic/-/tree/my-branch
3737
```
3838

39-
When pointing to a directory, e.g.
39+
Note that this also works with specific commit SHAs:
40+
4041
```
41-
https://github.com/arunoda/learnnextjs-demo/tree/create-dynamic-pages/pages
42+
gitpod.io/#https://gitlab.com/gitpod/spring-petclinic/-/commit/426b99d57ce511022eb71a60bff8e0764806ddf5
4243
```
43-
`Readme.md` will be opened if it exists there.
4444

45-
## GitHub Issue Context
45+
## Pull/Merge Request Context
4646

47-
When starting a workspace from a GitHub issue, a local branch named `GH-{issue-number}` will be
48-
created, based on the remote's default branch. In most cases that will be `origin/master`.
47+
Starting workspaces from a Pull Request or Merge Request will clone the respective branch, and show the file
48+
changes of the PR/MR in a view on the left. The first change is opened in the diff editor.
49+
Also the `Pull Request` view on the right is configured to reflect the PR/MR information.
50+
51+
This context is meant for code reviews, or to take action on feedback you got from a reviewer.
52+
53+
## Issue Context
54+
55+
When starting a workspace from an issue, a local branch suffixed with `-{issue-number}` will be
56+
created, based on the repository's default branch. (In most cases that will be `origin/master`.)
4957

5058
In addition, the commit message is preconfigured with:
5159

5260
```
5361
fixes #{organization}/{repo}#{issue-number}
5462
```
5563

56-
This will automatically close the GitHub issue once such a commit is merged into the default branch.
64+
This will automatically close the issue once such a commit is merged into the default branch.
5765

5866
As soon as changes have been committed locally, the `Pull Request` view on the right can be used to
5967
push changes to a remote repository and create a pull request.
6068

61-
## GitHub Pull Request Context
69+
## File Context
70+
71+
The file context is an extension to the repository context, in that Gitpod will check out the
72+
corresponding branch and open the respective file in an editor.
73+
74+
An example for this context is:
75+
76+
```
77+
gitpod.io/#https://gitlab.com/gitpod/spring-petclinic/-/blob/master/src/main/java/org/springframework/samples/petclinic/owner/Pet.java
78+
```
79+
80+
When pointing to a directory, e.g.
81+
```
82+
gitpod.io/#https://gitlab.com/gitpod/spring-petclinic/-/blob/master/src/main/java/org/springframework/samples/petclinic
83+
```
84+
`README.md` will be opened if it exists there.
6285

63-
Starting workspaces from pull requests will clone the respective branch and open the file
64-
changes of the PR in a view on the left. The first change is opened in the diff editor.
65-
Also the `Pull Request` view on the right is configured to reflect the PR information.
86+
## See Also
6687

67-
This context is meant for code reviews or to take action on feedback you got from a reviewer.
88+
- [Passing environment variables via the context URL](/docs/environment-variables/#passing-in-environment-variables)
89+
- [Triggering a prebuild using a special context URL](/docs/prebuilds/#manual-execution-of-prebuild)

src/docs/getting-started.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
# Getting Started
22

3-
Gitpod delivers the IDE part for the web-based development flows of common code hosting platforms.
4-
The following example shows how to use Gitpod with a GitHub repository.
3+
Gitpod provides continuous dev environments for the development flows of common code hosting platforms.
4+
The following example shows how to use Gitpod with a source code repository.
55

6-
1. Point your browser to some GitHub repository, pull request, or issue, e.g.
7-
<a href="https://github.com/arunoda/learnnextjs-demo" target="_blank">https://github.com/arunoda/learnnextjs-demo</a>
8-
2. Either prefix the URL in the address bar of your browser with `https://gitpod.io/#` (e.g.
9-
https://gitpod.io/#https://github.com/arunoda/learnnextjs-demo) or push the _Gitpod_ button if you
10-
have installed the [Gitpod extension](/docs/browser-extension/).
6+
1. Point your browser to a GitLab, GitHub or Bitbucket repository, Pull/Merge Request, or issue, e.g.
7+
[https://gitlab.com/gitpod/spring-petclinic](https://gitlab.com/gitpod/spring-petclinic)
8+
2. Either prefix the URL in the address bar of your browser with `gitpod.io/#` (e.g.
9+
https://gitpod.io/#https://gitlab.com/gitpod/spring-petclinic) or click the _Gitpod_ button if you've installed the [Gitpod browser extension](/docs/browser-extension/).
1110

1211
![prefix github URL](./images/prefix-screenshot.png)
1312

14-
3. On first use you will have to authorize access to your GitHub account. This is necessary so you
13+
3. On first use you will have to authorize access to your GitLab, GitHub or Bitbucket account. This is necessary so you
1514
can access your data from within Gitpod.
16-
4. Gitpod will now launch a workspace container for you in the cloud, containing a full Linux system.
17-
It will also clone the GitHub repository branch based on the GitHub page you were coming from.
15+
4. Gitpod will now launch a workspace container for you in the cloud, containing a full Linux environment.
16+
It will also clone the repository, branch, or commit based on which code-hosting page you were coming from.
1817

1918
Next up you should learn about [Gitpod's IDE](/docs/ide/).

src/docs/index.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,31 @@
33
[Gitpod](https://www.gitpod.io) is frictionless coding.
44

55
Whether you just want to hack, have code to review or feel like trying something new on
6-
GitHub, Gitpod launches a ready-to-code dev environment with a single click.
6+
GitLab, GitHub, or Bitbucket, Gitpod launches a prebuilt dev environment with a single click.
77

8-
Because Gitpod is based on OSS tech like VS Code, Docker, and Kubernetes, it is familiar,
9-
comprehensive, extensible, and easy to use. With deep GitHub integration, tools for
10-
sharing, and a focus on usability, Gitpod contains your entire dev workflow in a
8+
Because Gitpod is based on open-source tech like VS Code, Docker, and Kubernetes, it is familiar,
9+
comprehensive, extensible, and easy to use. With deep code-hosting platform integrations, tools for
10+
sharing and collaborating, and a focus on usability, Gitpod contains your entire dev workflow in a
1111
browser tab.
1212

1313
![gitpod-prefix](./images/prefix-lense.png)
1414

1515
Unlike traditional cloud and desktop IDEs, Gitpod understands the context and adjusts the
16-
IDE automatically. For example, if you create a Gitpod workspace from a Pull Request,
17-
Gitpod will open in code-review mode.
16+
IDE automatically. For example, if you create a Gitpod workspace from a Pull or Merge Request,
17+
Gitpod will open the IDE in code-review mode.
1818

19-
Also, Gitpod workspaces are meant to be disposable. That is, you do not need to maintain anything.
20-
They are created when you need them, and you can forget about them when you are done. Simply go to
21-
GitHub and create a fresh workspace whenever you need one.
19+
Also, Gitpod workspaces are meant to be disposable. That is, you don't need to maintain a single workspace
20+
to prevent it from becoming outdated.
21+
Workspaces are created when you need them, and you can forget about them when you are done. Simply go to
22+
GitLab, GitHub, or Bitbucket and create a fresh workspace whenever you need one.
2223

23-
The IDE is open-source and based on [Eclipse Theia](/docs/ide/). Theia is highly extensible and
24+
The IDE itself is open-source and based on [Eclipse Theia](/docs/ide/). Theia is highly extensible and
2425
builds upon mature technologies such as TypeScript, VS Code, Webpack, and Node.js.
2526

2627
This site provides all the details on how to use Gitpod and Theia. If you have questions
2728
or want discuss something, please join the
2829
<a href="https://community.gitpod.io/" target="_blank">Gitpod community</a>.
30+
2931
## Architecture
3032

3133
Gitpod.io runs in multiple Kubernetes clusters hosted on Google Cloud infrastructure in three different regions:
@@ -36,4 +38,4 @@ When starting a workspace, Gitpod will automatically pick the cluster that is cl
3638
start a Kubernetes pod in it. The requested git repository gets cloned and the branch you need is checked out.
3739
Furthermore, Gitpod runs any scripts that are configured for that git repository state.
3840

39-
Learn more about how to configure your GitHub repository [here](/docs/configuration/).
41+
Learn more about how to configure your repository [here](/docs/configuration/).

src/docs/prebuilds.md

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,62 @@
11
# Prebuilds
22

3-
Whenever your code changes (e.g. someone pushes to GitHub), Gitpod can prebuild your workspace, i.e. run the commands in your `.gitpod.yml`.
4-
When you open a workspace on a branch/pull request for which a prebuild exists, this workspace will have all dependencies downloaded
5-
and your code will already be built.
3+
Whenever your code changes (e.g. when new commits are pushed to your repository), Gitpod can prebuild workspaces, i.e. run the init commands in your `.gitpod.yml` before you even start a workspace.
4+
5+
Then, when you do create a new workspace on a branch, or Pull/Merge Request, for which a prebuild exists, this workspace will load much faster, because all dependencies will have been already downloaded ahead of time, and your code will be already compiled.
66

77
## Enable Prebuilt Workspaces
8-
To enable prebuilt workspaces follow these steps:
98

10-
1. Go to the <a href="https://github.com/apps/gitpod-io" target="_blank">gitpod-io GitHub app</a> and click "Configure"
11-
2. Choose the organizations/accounts you want to install the Gitpod integration for, and click _install_
12-
3. You will be forwarded to Gitpod where you need to confirm the installation
9+
### On GitHub
10+
11+
To enable prebuilt workspaces for a GitHub repository, follow these steps:
12+
13+
1. Go to the <a href="https://github.com/apps/gitpod-io" target="_blank">Gitpod GitHub app</a> and click `Configure`
14+
2. Choose the organization or account you wish to install the Gitpod app for, then click `Install`
15+
3. You will be forwarded to Gitpod where you can confirm the installation
16+
17+
### On GitLab and Bitbucket
18+
19+
To enable prebuilt workspaces for a GitLab or Bitbucket repository, follow these steps:
20+
21+
1. Allow Gitpod to install repository webhooks, by granting `allow api calls` (GitLab) or `install webhooks` (Bitbucket) in [Access Control](https://gitpod.io/access-control/)
22+
2. Trigger a first prebuild manually, by prefixing the repository URL with `gitpod.io/#prebuild/` e.g. like so:
1323

14-
By default Gitpod prebuilds workspaces for all changes on the default branch (i.e. `master`) and for pull requests coming from the same repository.
24+
```
25+
gitpod.io/#prebuild/https://gitlab.com/gitpod/spring-petclinic
26+
```
27+
28+
This will [trigger a prebuild](#manual-execution-of-prebuild), and also install a webhook that will trigger new Gitpod prebuilds for every new push to your repository. See also [GitLab prebuilds](https://www.gitpod.io/blog/gitlab-support/#prebuilds).
1529

16-
> **Note**: prebuilds are executed as the user who installed the GitHub app. This means that if you want to use
17-
> prebuilds on a private repository, the user who installed the GitHub app (e.g. you) need to give access to private
18-
> repositories.
30+
## Manual execution of prebuild
31+
32+
Alternatively, it is also possible to manually trigger a new prebuild for any repository & commit by using the `gitpod.io/#prebuild/` URL prefix:
33+
34+
```
35+
https://gitpod.io/#prebuild/https://github.com/ORG/REPO
36+
```
1937

2038
## Configure prebuilds
39+
40+
By default Gitpod prebuilds workspaces for all changes on the default branch (e.g. `master`) and for Pull/Merge Requests coming from the same repository.
41+
42+
> **Note**: prebuilds are executed as the user who enabled them. This means that if you want to use
43+
> prebuilds on a private repository, you must to give Gitpod access to private repositories.
44+
2145
There are three parts to configuring prebuilds:
2246
1. the tasks that will be run during a prebuild,
23-
2. when a prebuild will be run, and
24-
3. how you will be notified by the `gitpod-io` GitHub app.
47+
2. when a prebuild should be triggered, and
48+
3. how you will be notified by the Gitpod GitHub app (GitHub only)
49+
50+
All three parts are configured in your repository's [`.gitpod.yml` file](/docs/config-gitpod-file/).
2551

26-
All three parts are configured in the `.gitpod.yml`.
27-
What tasks to be executed during the prebuilt is configured using [start tasks](/docs/config-start-tasks/).
28-
It is similar to regular workspace starts with the difference that the `command` phase is not executed and that there is a `prebuild` phase that you can use to execute additional long running tasks, e.g. run unit tests.
52+
What init tasks should be executed during the prebuild is configured using [start tasks](/docs/config-start-tasks/).
53+
It is similar to non-prebuilt workspace starts, except that the `command` phase is not executed during the prebuild (because it can potentially run forever, e.g. if you start a server). There is also a `prebuild` phase that you can use to execute additional long-running tasks during prebuilds, e.g. unit tests.
2954

30-
The rest is configured using the `github` section.
55+
## Configure the GitHub app
56+
57+
Once you have installed the [Gitpod GitHub app](https://github.com/apps/gitpod-io), you can configure its behavior in the `github` section of your repository's `.gitpod.yml`.
58+
59+
> **Note:** The Gitpod GitHub app has no equivalent for GitLab or Bitbucket yet, so this entire section is GitHub-specific for now.
3160
3261
See below for an example:
3362
```YAML
@@ -59,12 +88,6 @@ You can enable prebuilds also for all branches and for pull requests from forks.
5988
### GitHub integration
6089
Once the GitHub app is installed Gitpod can add helpful annotations to your pull requests.
6190

62-
### Manual execution of prebuild
63-
Alternatively and independantly from configuration above it is possible to trigger the prebuild using
64-
```
65-
https://gitpod.io/#prebuild/https://github.com/ORG/REPO
66-
```
67-
6891
#### Checks
6992
By default Gitpod registers itself as a check to pull requests - much like a continuous integration system would do.
7093
You can disable this behaviour in the `.gitpod.yml` file in your default/master branch:

0 commit comments

Comments
 (0)