by Arif Islam
• September 26, 2017
DreamFactory 2.9 introduces two brand new services – GitHub and GitLab. This feature provides an easy way to connect to your project’s Git repositories and access them from DreamFactory. The real benefit here is the ability to create a live link to your DreamFactory server-side script that you manage on your own GitHub or GitLab account.
Read more about DreamFactory’s new features.
This blog post will cover the new GitHub and GitLab services themselves. There will be a separate blog post that will demonstrate how to create an event script (pre- and post-process scripts) and a custom scripting service that links to a script file on your GitHub or GitLab repository.
GitHub and GitLab services are native DreamFactory services and support role-service-access, live API documentation, and more. Once you’ve configured your Git services in DreamFactory, all the configuration details are hidden from your client. They’re securely stored in your DreamFactory instance database. This provides a simple, standardized way to access your GitHub and GitLab repositories.
Configuring a Git service is as simple as configuring any other service in the DreamFactory admin console. Start by logging into the admin console, head over to the ‘Services’ tab, and click on the ‘Create’ button on the left sidebar. Use the ‘Service Type’ drop down to select ‘Source Control’ -> ‘GitHub Service’ / ‘GitLab Service’, complete the service configuration form and save it to create your service. The ‘Info’ tab on both GitHub and GitLab service looks like this.
Provide basic service information – Name, Label, and Description in the Info tab then click on the ‘Config’ tab.
Here’s what the GitHub ‘Config’ tab looks like.
In the ‘Config’ tab, provide the following configuration information:
As you can see, username, password, and GitHub token are all optional. At minimum, you need an account/organization name to create a GitHub service. When you configure a GitHub service with just the account name, you can access only the public repositories under this account. If you configure the service with username and password OR with username and GitHub token, then you can also access the private repositories owned by your username account under your account name.
Here’s what the GitLab ‘Config’ tab looks like.
Once you have your GitLab service configured you can access all your repositories using this service.
After you have your GitHub or GitLab service configured, head over to the API Docs tab and select your service to reveal all its endpoints. The screenshot below shows all the endpoints for a GitHub service named ‘github’. The endpoints are exactly the same for a GitLab service. In the API Docs you can click on the individual endpoints to see all the usage details.
This blog post quickly showed how to use DreamFactory to connect to your own GitHub or GitLab repository. Check out the community forum to discuss this feature or let us know what you think in the comments!
Read more about getting started with the DreamFactory API.
Join the DreamFactory newsletter list.