Skip to content

Getting Started

Stuart Preston edited this page May 5, 2017 · 7 revisions

These are draft notes only

Prerequisites

Chef Server

You can use these tasks with your own private Chef Server, a hosted Chef Server or a Chef Automate server installed from the Azure Marketplace. Note: If you use your own Chef Server you will most likely need to disable SSL Verification in the Chef Server endpoint.

Build phase tasks

All Build phase tasks can run on hosted VSTS agents

Release phase tasks

Release phase tasks are designed for either a private VSTS agent, or an agent running inside a Deployment Group (in preview).

To get started with the Chef Release tasks, you'll need to install both the VSTS Agent and the Chef Development Kit on a private agent. NB: We have not yet tested this on the Linux hosted preview.

What next?

From a new project here are the typical steps to success with the tasks (demo documentation to be fleshed out)

Example scenario - ASP.NET Core MVC app running on Ubuntu Linux - needs various prerequisites configured and installed

  • Clone the project locally

  • Switching your Build process versioning numbering scheme to something resembling SemVer, e.g. ``

  • Configure your Chef Server endpoint

  • Create folders for application cookbooks and deployment

  • Create Chef cookbook by cd cookbooks; chef generate cookbook myapp

  • Create application and test (e.g. cd application; dotnet new mvc; dotnet restore; dotnet run)

  • Access http://localhost:5000 in a browser to make sure it works

  • Commit and Push to master to seed the project

  • Create a build DOUBLE CHECK Do dotnet core builds ok in OOB VSTS now?

  • Add: Update Cookbook version number

  • Add: Upload Cookbook to Chef task

  • Test the build process, add tests, code coverage etc.

  • Write the recipe to install dotnet core via apt

  • Commit and Push

  • Create a Release definition

  • Use an empty template

  • Configure Release to be triggered by source (this passes the build number through which we need in the pipeline)

  • Configure your Service Principal and add an Azure ARM template deployment to it

  • Create a deployment group for the first environment e.g. "DEV"

  • ARM template should have at least one VM with both the Chef VM Extension and the Team Services Agent Extension added

  • Need to provide link to ARM fragments/examples for this

  • Set the properties correctly in the ARM template (may need mapping of variables etc.)

  • Add a Deployment Group phase, configure to run in parallel

  • Test Azure deployment and verify deployment and registration of machines into the Deployment Group

  • Add the Execute Chef Client tasks to the Deployment Group phase

  • Show logs with Chef Client run configuring machines

  • (optionally) Add the Execute InSpec task to the Deployment Group phase

  • (optionally) Add a task to publish the test results from inspec.out in the Deployment Group phase

  • Keep going with scenario making changes to source and watching them flow through to the Dev environment.

  • Clone the Dev environment as Test, parameterize any thing that needs it in the JSON and pass in via ARM parameters etc.

Clone this wiki locally