Building Part 3: Creating a Build Definition

In this blog I will describe the steps you need to take in order to setup a build definition in VSTS that will run on the Build Agent installed in Part 1 and 2 on a Build Server.

All you need here is a browser.

Login to your VSTS Team Project and click on Build and Releases.

Now click on “New” to create a new build definition.

Make sure to select the correct sources to be used for building your app.

Click on Continue and select “Empty process”

Now you can start editing your build definition.

The first thing to get done is adding a PowerShell script to “Phase 1”

You do this by clicking the “+” sign

Search for “powershell” and add a PowerShell task

Click on the new PowerShell tasks on your left and populate the task as seen in this screen shoot.

You are now almost done.

We just need to publish the Artifacts from the build definition which can be done the following way.

Add a new task to Phase 1 called “Publish Build Artifact” the same way we added the PowerShell task and populate it with the following parameters.

Now we are missing one more thing and that is to decide what triggers a build.

Personally I prefer Continuous Integration which means as soon as a developer commits any code into the branch selected for this build it will trigger a fresh build of the application.

You can set that up by clicking on “Triggers” and “Enable continuous Integration”

Save your build definition.

You are now done. Every time anyone does a commit to the git repository in VSTS a new build will happen.

Here is a screen shot of the first build for this scrip while it was running.

and after a successful build you can download your app from the Artifact tab under the build

The life as a developer just got a lot easier.

Have fun setting up your own Build Server.

A special thanks to Mike Glue for sharing his great knowledge with me.

6 thoughts on “Building Part 3: Creating a Build Definition

  1. Pingback: AL Extensions: Automated Builds with VSTS | NAV Bits and Bytes

  2. ma7eoo

    Hi, I have one error “Invalid file path ‘C:\ALBuild\Scripts\build.ps1’. A path to a .ps1 file is required” after run queue. How to fix it?

    Reply
  3. Pingback: AdvaniaGIT: Configure Build and Test using Visual Studio Online – Gunnar's Blog

  4. Pingback: AdvaniaGIT: Configure Build and Test using Visual Studio Online - Gunnar's Blog - Dynamics 365 Business Central/NAV User Group - Dynamics User Group

  5. Pingback: AdvaniaGIT: Configure Build and Test using Visual Studio Online | PA

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s