Create a new project or use an existing one to upload your Habitat based application so that a build process can be created around it.
NOTE: In this example the default project that is created when a new Azure DevOps account is created will be used. This is called ‘MyFirstProject’.
- From the ‘Build and Release’ drop down, select ‘Builds’.
- Click on the ‘New Definition’ button.
- Click the ‘Empty Process’ link
- Select the ‘Default agent queue’ that will be used to build this definition
- Add the following tasks to the definition
- Install Habitat
- Leave everything as default
- Signing Origin Key (Habitat)
- Select the Habitat Origin that was created in Create Habitat Endpoint from the drop down menu
- Expose Habitat Build Variables
- Select ‘Set Build Number’ which will make Azure DevOps take the build number from Habitat
- Build Plan (Habitat)
- For the purposes of this demo the values can be left as default. However if the project being built has a different project structure then path to the plan and the source directory can be modified if required.
- Copy Files
- Set the ‘Display Name’ to something useful
- Set the ‘Source Folder’ to the path that the hart file and the build number file will be set. In this demo the path is
NOTE: The path will not be selectable from the ellipsis as this project has not been built yet thus the results folder will not exist.
- Set the ‘Contents’, which is a list of the files that need to be copied to the artifacts directory. As the HART and environment variables file is required the following should be set:
- Set the ‘Target Folder’ to
- Publish Build Artifacts
- Set the ‘Display name’ to something useful
- Set the ‘Path to Publish’ to the same value as the Target Folder in the last task, so in this example it will be
- Leave the ‘Artifact Type’ as Server.
- Install Habitat
- Now click on ‘Save and queue’ and select the option to ‘Save’ the new definition.
- Complete the summary of changes that have been made if so desired.
- Queue a new build by clicking on the ‘Queue’ button at the near the top right of the screen.