GDK with Gitpod
GDK can be used with Gitpod using the GitLab Gitpod integration.
The main advantage of running the GDK in Gitpod is that you don't have to worry about your local environment, installing dependencies, and keeping them up to date. With Gitpod, you can run a pre-configured GDK instance in the cloud, which also makes it possible to contribute, no matter how powerful your machine is. You could even just use an iPad!
How to get started
If you are a GitLab team member, either:
- Open this link.
- Click the Gitpod button in the GitLab repository. This might require you to enable the Gitpod integration in your user settings.
If you are a community contributor:
- Fork the GitLab repository,
- Click the Gitpod button in the repository view of your fork.
Hint: If you don't see a "Gitpod" button, open the dropdown of the "Web IDE" split button.
If you have never used Gitpod before, you must:
- Create a new Gitpod account.
- Connect the Gitpod account to your GitLab account.
After that is done, you just wait 7-8 minutes for the entire setup to finish, and you see the GDK UI pop up in the right sidebar. If you see 504 Gateway Time-out error, click the reload button in the right side bar.
Sign in to GitLab using the default username root
and password 5iveL!fe
. You must
immediately change that password after you log in the first time. Every new Gitpod workspace
requires you to change the password again. Now you are ready to make or review changes.
If you have questions about the UI or if you are curious have a look at:
How to use GDK with Gitpod
The following are common tasks for using GDK in Gitpod.
Check out branches
The easiest way to switch to another branch is to use the UI functionality:
-
Click on the current branch name in the blue bottom bar.
-
A context menu appears with a list of other branches where you can type in the name of the branch you want to switch to and select it as soon as it appears in the list.
Alternatively, you can also use the terminal to check out a branch:
git fetch origin
git checkout -b "BRANCH_NAME" "origin/BRANCH_NAME"
Commit and push changes
If you have made changes to any of the files and want to push and commit them:
-
Navigate to the Source Control: Git tab in the left sidebar. There you also see all files that have been changed.
-
In this view, you can then decide which changes you want to add to the commit. Usually that would be all files, so you can just stage all changes by clicking on the "Plus" icon that appears on hover next to the Changes section.
-
When that's done and you have also entered a commit message in the text area above, you can commit by clicking the checkmark icon at the top of the Source Control section.
-
Push your changes by using the Synchronize changes action in the bottom blue toolbar. If the Gitpod UI asks you which way you want to synchronize your changes, you can just choose Push and pull.
Configure additional features
With Gitpod, the default configuration of the GDK is ready for you in just a couple of minutes, and we are actively working on making sure that as many features work out of the box. However, right now you still have to complete a couple of steps to enable advanced features.
Enable runners
- Go to Admin Area > Runners in the GitLab UI running in GDK.
- In the terminal, switch to the GDK directory
(cd ../gitlab-development-kit)
- Ensure that you're using the 3000 port and that it's set to public. You can change the port from private to public by going to the Remote Explorer tab in Gitpod UI and clicking on the lock icon next to the port name.
- Run
gitlab-runner register --run-untagged --config /workspace/gitlab-development-kit/gitlab-runner-config.toml
- As prompted, first enter the URL and then the registration token provided from the GitLab UI running in GDK.
- The description and tags are optional, you can just press Enter to skip those.
- When prompted for the executor, type
shell
and press Enter. - Run
gitlab-runner run --config /workspace/gitlab-development-kit/gitlab-runner-config.toml
Your runner is ready to pick up jobs for you! If you create a new project, the Pages/Plain HTML template contains a super simple and tiny pipeline that's great to use to verify whether the runner is actually working.
Enable feature flags
To enable feature flags:
- Run
cd ../gitlab && ./bin/rails console
. - Wait about 1 minute until you see the message that the development environment has been loaded.
- Run
Feature.enable(:feature_flag)
, replacingfeature_flag
with the name of the feature flag you want to enable. - Leave the console by typing
exit
and hitting Enter.
Enable the billing page
- Open a Rails console.
- Run
ApplicationSetting.first.update(check_namespace_plan: true)
.
The billing page is now accessible at Group > Settings > Billing.
Use Advanced Search
To use Advanced Search, you must:
- Have a premium or higher license registered in the GDK.
- Enable Elasticsearch.
To enable Elasticsearch:
-
From the command line, navigate to
/workspace/gitlab-development-kit
and opengdk.yml
for editing by usingcd /workspace/gitlab-development-kit && gp open gdk.yml
. The file might be empty. -
Add the following lines and save the file:
elasticsearch: enabled: true
-
Run
gdk reconfigure
. -
Run
gdk start elasticsearch
.
How to test features only available in higher GitLab tiers
For information on enabling higher GitLab tiers in GDK to test out features, see Use GitLab Enterprise features.
How to update the Gitpod GDK Docker image
There are two Gitpod GDK Docker images that can be built:
registry.gitlab.com/gitlab-org/gitlab-development-kit/gitpod-workspace:main
registry.gitlab.com/gitlab-org/gitlab-development-kit/gitpod-workspace:stable
main
tag
We automatically build a new Gitpod GDK Docker image every day that's tagged as
registry.gitlab.com/gitlab-org/gitlab-development-kit/gitpod-workspace:main
.
The main
tag is used because that's the name of the default Git branch for
the GDK.
stable
tag
When running Gitpod for GitLab, it uses the
registry.gitlab.com/gitlab-org/gitlab-development-kit/gitpod-workspace:stable
Docker image which uses the stable
tag.
Promote main
tag to stable
- Visit the GitPod Image Integration test MR which utilizes the
main
GDK Gitpod image. - Rebase the GitPod Image Integration test MR using the
/rebase
quick action. - Once rebased, launch a new Gitpod instance by visiting the GitPod Image Integration test Git branch and select the Gitpod button.
- Run some manual tests (manual login,
gdk update
, maybe some manual test runs of jest / RSpec). - Once everything looks good, visit GDK's scheduled CI pipelines and locate the last successful pipeline ID for the
Rebuild Gitpod workspace image
job. - Create a new comment on GitPod Image Integration test MR detailing you checked the GDK Gitpod
main
image created via the pipeline ID located in step 5. - Using the pipeline located in step 5., promote the GDK Gitpod
main
image tostable
by selecting Run on the manualdeploy-gitpod-workspace-image
job once it is available.
إرسال تعليق