2016-07-26 03:59:39 +00:00
|
|
|
# Koding & GitLab
|
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
> [Introduced][ce-5909] in GitLab 8.11.
|
|
|
|
|
2016-07-26 03:59:39 +00:00
|
|
|
This document will guide you through using Koding integration on GitLab in
|
2016-08-22 14:09:15 +00:00
|
|
|
detail. For configuring and installing please follow the
|
|
|
|
[administrator guide](../../administration/integration/koding.md).
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
You can use Koding integration to run and develop your projects on GitLab. This
|
|
|
|
will allow you and the users to test your project without leaving the browser.
|
|
|
|
Koding handles projects as stacks which are basic recipes to define your
|
|
|
|
environment for your project. With this integration you can automatically
|
|
|
|
create a proper stack template for your projects. Currently auto-generated
|
|
|
|
stack templates are designed to work with AWS which requires a valid AWS
|
|
|
|
credential to be able to use these stacks. You can find more information about
|
2016-08-22 14:09:15 +00:00
|
|
|
stacks and the other providers that you can use on Koding following the
|
|
|
|
[Koding documentation][koding-docs].
|
2016-07-26 03:59:39 +00:00
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
## Enable Integration
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
You can enable Koding integration by providing the running Koding instance URL
|
2016-08-22 14:09:15 +00:00
|
|
|
in Application Settings under **Admin area > Settings** (`/admin/application_settings`).
|
2016-07-26 03:59:39 +00:00
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
![Enable Koding](img/koding_enable-koding.png)
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
Once enabled you will see `Koding` link on your sidebar which leads you to
|
2016-08-22 14:09:15 +00:00
|
|
|
Koding Landing page.
|
2016-07-26 03:59:39 +00:00
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
![Koding Landing](img/koding_landing.png)
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
You can navigate to running Koding instance from here. For more information and
|
2016-08-22 14:09:15 +00:00
|
|
|
details about configuring the integration, please follow the
|
|
|
|
[administrator guide](../../administration/integration/koding.md).
|
2016-07-26 03:59:39 +00:00
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
## Set up Koding on Projects
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
Once it's enabled, you will see some integration buttons on Project pages,
|
|
|
|
Merge Requests etc. To get started working on a specific project you first need
|
|
|
|
to create a `.koding.yml` file under your project root. You can easily do that
|
|
|
|
by using `Set Up Koding` button which will be visible on every project's
|
|
|
|
landing page;
|
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
![Set Up Koding](img/koding_set-up-ide.png)
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
Once you click this will open a New File page on GitLab with auto-generated
|
|
|
|
`.koding.yml` content based on your server and repository configuration.
|
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
![Commit .koding.yml](img/koding_commit-koding.yml.png)
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
## Run a project on Koding
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
If there is `.koding.yml` exists in your project root, you will see
|
|
|
|
`Run in IDE (Koding)` button in your project landing page. You can initiate the
|
|
|
|
process from here.
|
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
![Run on Koding](img/koding_run-in-ide.png)
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
This will open Koding defined in the settings in a new window and will start
|
2016-08-22 14:09:15 +00:00
|
|
|
importing the project's stack file.
|
2016-07-26 03:59:39 +00:00
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
![Import Stack](img/koding_stack-import.png)
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
You should see the details of your repository imported into your Koding
|
|
|
|
instance. Once it's completed it will lead you to the Stack Editor and from
|
|
|
|
there you can start using your new stack integrated with your project on your
|
|
|
|
GitLab instance. For details about what's next you can follow
|
2016-08-22 14:09:15 +00:00
|
|
|
[this guide](https://www.koding.com/docs/creating-an-aws-stack) from step 8.
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
Once stack initialized you will see the `README.md` content from your project
|
2016-08-25 21:01:43 +00:00
|
|
|
in `Stack Build` wizard, this wizard will let you build the stack and import
|
2016-07-26 03:59:39 +00:00
|
|
|
your project into it. **Once it's completed it will automatically open the
|
2016-08-22 14:09:15 +00:00
|
|
|
related vm instead of importing from scratch**.
|
2016-07-26 03:59:39 +00:00
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
![Stack Building](img/koding_start-build.png)
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
This will take time depending on the required environment.
|
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
![Stack Building in Progress](img/koding_build-in-progress.png)
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
It usually takes ~4 min. to make it ready with a `t2.nano` instance on given
|
|
|
|
AWS region. (`t2.nano` is default vm type on auto-generated stack template
|
2016-08-22 14:09:15 +00:00
|
|
|
which can be manually changed).
|
2016-07-26 03:59:39 +00:00
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
![Stack Building Success](img/koding_build-success.png)
|
2016-07-26 03:59:39 +00:00
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
You can check out the `Build Logs` from this success modal as well.
|
2016-07-26 03:59:39 +00:00
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
![Stack Build Logs](img/koding_build-logs.png)
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
You can now `Start Coding`!
|
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
![Edit On IDE](img/koding_edit-on-ide.png)
|
2016-07-26 03:59:39 +00:00
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
## Try a Merge Request on IDE
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
It's also possible to try a change on IDE before merging it. This flow only
|
|
|
|
enabled if the target project has `.koding.yml` in it's target branch. You
|
|
|
|
should see the alternative version of `Run in IDE (Koding)` button in merge
|
|
|
|
request pages as well;
|
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
![Run in IDE on MR](img/koding_run-mr-in-ide.png)
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
This will again take you to Koding with proper arguments passed, which will
|
|
|
|
allow Koding to modify the stack template provided by target branch. You can
|
|
|
|
see the difference;
|
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
![Different Branch for MR](img/koding_different-stack-on-mr-try.png)
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
The flow for the branch stack is also same with the regular project flow.
|
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
## Open GitLab from Koding
|
2016-07-26 03:59:39 +00:00
|
|
|
|
|
|
|
Since stacks generated with import flow defined in previous steps, they have
|
|
|
|
information about the repository they are belonging to. By using this
|
|
|
|
information you can access to related GitLab page from stacks on your sidebar
|
|
|
|
on Koding.
|
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
![Open GitLab from Koding](img/koding_open-gitlab-from-koding.png)
|
|
|
|
|
|
|
|
## Other links
|
|
|
|
|
|
|
|
- [YouTube video on GitLab + Koding workflow][youtube]
|
|
|
|
- [Koding documentation][koding-docs]
|
2016-07-26 03:59:39 +00:00
|
|
|
|
2016-08-22 14:09:15 +00:00
|
|
|
[ce-5909]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5909
|
|
|
|
[youtube]: https://youtu.be/3wei5yv_Ye8
|
|
|
|
[koding-docs]: https://www.koding.com/docs
|