Integrating Chef into your VSTS Builds
// Chef Blog
Here at Chef we have been working with Microsoft to create integrations for Visual Studio Team Services (VSTS).
VSTS is an invaluable and versatile tool to bring together pipelines within your environments. The pipelines are made up of tasks. These tasks are either core tasks built into VSTS (e.g. created by Microsoft) or available in the VSTS Marketplace/. It is in the marketplace that you will find the Chef Integration extension.
In a recent webinar we hosted on November 17, 2017, Eugene Chuvyrov, Senior Software Engineer at Microsoft, talks about the importance of VSTS, what it is capable of, and how it is part of the larger DevOps toolset. VSTS has a number of plugins that can be installed into your account that allow it to perform a myriad of tasks. A recording of the webinar is available at the end of this post.
By installing the Chef extension into your VSTS account you get the following tasks:
- Build Phase
- Release Phase
It should be noted that although these tasks have been assigned to different build phases, they do not have to be used in those phases. Indeed the live demonstration in the webinar shows how the tasks can be used to create a Chef Cookbook pipeline. To do this the Upload Cookbook to Chef Server task is used in the release phase.
As mentioned, the live demonstration shows how VSTS can be used as a source repository for your cookbook(s), using Git, to create a build and release pipeline. The workflow for this is shown below:
As can be seen from the figure above there are a number of build tasks that can be triggered either manually, by a code checkin or on a schedule (think nightly builds). This will then create a cookbook artifact which is placed in a drop location so that the Release process can get hold of it.
A Release can be created on a trigger, e.g. when a new artifact has been published. This is not the same as performing a release, it just creates the release from which deployments are performed. Of course it is possible to have an automatic deployment when a release is created, but this would be a trigger on the release enviornment itself.
We are continually developing and enhancing the VSTS extension. Things that are in the backlog at the moment are:
- Ensure the extension works on Windows
- Create an 'Install ChefDK' task
- Create tasks to perform linting operations so that it is not a command line task
- Create task to run Test Kitchen
To see the tasks that are being worked on please refer to the VSTS Chef Extension Issues page.
For information on how to use the tasks please refer to the VSTS Chef Extension Wiki.
For a step by step guide of what is performed in the webinar please refer to the blog post Chef Cookbook Pipeline with VSTS. Please note that this was created before the 'Publish to Supermarket' task was available.
If you would like to see the webinar again or you missed it the first time around please find it below.
Read in my feedly