layout | title | date | comments | author | author_twitter | image_title |
---|---|---|---|---|---|---|
post |
Build, Dockerize, and Deploy your GitLab Repositories with Distelli |
2016-04-21 12:00 |
true |
Alex Leventer from Distelli |
alexleventer |
/images/gitlabintegrationimage.jpg |
This is a guest post by Distelli.
Here at Distelli, we've obsessed with simplifying DevOps so developers can focus on product features, not infrastructure automation.
Today, we're excited to announce the release of the Distelli/GitLab integration. The integration makes it extremely simple to continuously deliver your application from GitLab to any server in the world. Simply push to GitLab to trigger a build, Dockerize, and deploy your application in minutes.
Below I'll demonstrate how simple it is to automate the build, test and deployment of a simple Node.js GitLab repository using Distelli.
Connecting GitLab and Distelli takes a matter of minutes.
Head over to Distelli and create an account.
Once you’ve created an account, you’ll automatically be redirected to create your first application. Select the blue Connect GitLab button.
You'll be prompted to add your GitLab host URL and API token. If you're using the hosted version of GitLab, enter https://gitlab.com
. Your token can be found in the Profile Settings > Account section of your GitLab account. Once you've added your credentials, click the blue Add Credentials button.
Next, you'll need to select a GitLab organization. I'll select my personal account.
Select a GitLab repository to associate with your Distelli application. I'll select a Hello-World Node.js repository I created for this example.
Next, you'll need to set build triggers or rules on which branches Distelli should build. For this step, you can manually select branches or set a regular expression to add branches automatically. I'm going to configure Distleli to only build on changes to my master branch.
Now, we need to set our build steps. I'll add an npm install
command in my build step to install all my Node.js package dependencies.
Finally, I'll select the Javascript build image and start my first build by clicking the blue Looks Good. Start Build! button. This tells Distelli to build my application on one of Distelli's hosted build servers inside of a Docker container with Distelli's Javascript image.
Below, we can see our first build is in-progress. The GitLab commit is linked below the commit message.
A new release of my application is created anytime a build succeeds. I specify in my PkgInclude section what files to include in my release. Now that we've created a release, let's set up an application pipeline. Click on your application's name:
Let's set up Distelli to automatically deploy to our beta environment whenever a build succeeds. Click the Add Step button on the bottom right of the page:
I've set up my beta environment to automatically be deployed to whenever a build succeeds.
Now let's rebuild our GitLab repo and test that the our application is automatically deployed when the build succeeds. Click the blue wrench icon at the top of the page to rebuild.
We can see right from the application pipeline that our build is in progress.
The application has been successfully deployed! We can click on the deployment number to see additional information on the deploy.
Questions about Distelli? Shoot us an email at [email protected].