AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 29.09.2017, 07:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,626 / 848 (80) +++++++
Регистрация: 28.10.2006
stoneridgesoftware: Setting Up Continuous Integrations in Dynamics 365 for Operations
Источник: https://stoneridgesoftware.com/setti...or-operations/
==============

Previously I showed you how to set up version control in Dynamics 365 for Operations. Now we will look at setting up a continuous integration build for our project.

Let’s say we need to write a method that sorts an array of ItemId values. The method should sort the array in place so we can simply pass in our array and it will be sorted afterward. We’ll start by creating new projects and models called ContinuousIntegration and ContinuousIntegration Test. These projects will consist of a single class each. The first contains a simple method that performs a bubble sort on an array of ItemIds. The second contains a unit test class.



Once we verify that the code works as expected and our unit tests all pass, we can submit it to our code repository.

Create a Build agent

Now we need to set up a build agent using the SetupBuildAgent.ps1 PowerShell script found in the C:\DynamicsSDK folder. This script requires us to authenticate to VisualStudio.com using something called a Personal access token. This token is a string of characters that replace your username and password when authenticating to the site.

In my testing, I have found that the build agent must use a Personal access token created by the administrative account for your project. If you later add a user to your project, even if that user has admin privileges for that project, you cannot use an access token from that user.

To create your Personal access token, navigate to VisualStudio.com, log in, click your user icon in the top-right corner, and choose Security.



Click the Add button to create a new Personal access token and give it a name.



Scroll to the bottom of the page and click Create Token. You must now copy your token value and store it in a safe place until you are done setting up your continuous integration server. This token will only be displayed to you once. When you leave this page you will no longer be able to see its value.

(This is not my actual token.)



On your build VM, open an administrative command prompt and change to the C:\DynamicsSDK directory.

Now we need to call the SetupBuildAgent.ps1 script and pass it the values it needs to connect to our project. At a minimum we need to provide the following parameters:
My command line would look something like this:



When you press enter, the script will download the latest version of the build agent as a Zip file, extract it to a VSOAgent folder, and create a Windows Service instance.



We can see the Build agent online if we navigate to our dashboard, click the settings button, and choose Agent pools.





If we load the services control panel on our build VM we can see the new Windows service tied to this agent.





Create a Build Definition

The last step is to create a build definition. The build definition defines what steps will be taken when our continuous integration build runs and even defines when our build will run.

To create the build definition, we will use the BuildEnvironmentReadiness.ps1 PowerShell script.



When you press enter the script will create the build definition.



To see the definition, navigate to your project home and click Build and Release > Builds.





Click the build definition name to see the details.



Then click the Edit button to see the build steps.



To enable Continuous integrations, click the Triggers tab, enable the option, and click Save.





Submitting code changes

Now that we have continuous integrations enabled, every time we submit a change our code will be built and tested. To test this, let’s assume that our requirements have changed and we now must use a quick sort to sort our ItemIds.



If we refresh our build definitions page, we can see that our continuous integration build has been triggered by our change.



If all goes well the build will be successful, tests will pass, and we can be assured that our branch is stable.







Источник: https://stoneridgesoftware.com/setti...or-operations/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
stoneridgesoftware: PrecisionForms for Document Management in Dynamics AX Blog bot DAX Blogs 0 14.09.2017 19:11
stoneridgesoftware: Using Liquid Templates and FetchXML to Retrieve Data in a Dynamics 365 Online Portal Blog bot Dynamics CRM: Blogs 0 27.07.2017 23:15
stoneridgesoftware: Data Migration Observations for Microsoft Dynamics 365 for Operations (AX7) Blog bot DAX Blogs 0 10.12.2016 02:21
german_nav_developer: Buildnummern-Übersicht Microsoft Dynamics NAV 2013 Blog bot NAV: Blogs 0 15.05.2016 18:12
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 16 Blog bot Dynamics CRM: Blogs 0 23.01.2014 03:15

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 04:09.