Monday, February 24, 2020

D365FO - Automatic build in azure DevOps

The build VM contains the build agent which was released as part of TFS 2015. When you deploy the Build VM, the build agent is configured by default to connect and sync with the Azure DevOps project. As a part of the Build VM configuration, the default build definition is also created and configured, as shown below.
Build1
Default build definition contains multiple tasks to perform specific operation, as described below.
  1. Configure the predefined variables parameters that will be passed to the build. To set up a clean database for every build execution, provide the name of the database backup file for the DatabaseBackupToRestore variable. The packages folder is restored at every build with a copy of a clean package folder.
    build2
  2. Build the solution to discover and build all modules under “Trunk/Main” branch as shown below.
    Build3
  3. Use “Deploy Report” task to generate reports and deploy on build VM.
  4. Use “Database Sync” task to synchronize the database to local SQL on build VM.
  5. After the build is successful, create a deployable package that can be used to update sandbox/ staging environment.
    Build4
  6. “Copy and publish build artifacts” uploads the deployable package to Azure DevOps artifacts location.
    build5
  7. For test execution, there are three default tasks “Test Setup”, “Execute Test” and “Test End”.
    build7
  8. The default build is scheduled to trigger start every day at 5 P.M. You can change trigger as per your team’s need to “Continuous” for each check-in.
    build8
You can make changes to the default configuration, and the build VM will be ready to trigger a build.

Start a build and verify the build and test execution results

After you review the default build configuration, you can manually trigger a build from Visual Studio IDE or Azure DevOps web interface.
  1. Open your browser and connect to the Azure DevOps URL.
  2. Login using your credentials.
  3. On the home page, under Recent projects and solutions, select a project.
  4. From top links options, select BUILD.
  5. On the left panel, select the default build definition instance.
  6. Right-click and select Queue Build to trigger a build for your module and test module that is already checked into the Azure DevOps source control.
image045
Success or failure for the build will display, as shown by the following examples. View all builds.
build9
Select specific completed build and view success/ failure details.
build10 Click on Test link to visualize test execution failure.
build11

No comments:

Post a Comment