Update doc on Community target build and release procedures.

Signed-off-by: José Simões <jose.simoes@eclo.solutions>
This commit is contained in:
José Simões 2019-01-04 11:56:40 +00:00
Родитель a86056fac1
Коммит d3db55115d
1 изменённых файлов: 14 добавлений и 10 удалений

Просмотреть файл

@ -4,23 +4,21 @@
This document describes the recipe to setup the build and publish of new Community targets.
## Introduction
The build of Community targets is handled on an unconventional approach. The reason for this is that using the traditional "build matrix" provided by AppVeyor leads to several problems.
The obvious ones are: Launching a build will get a job for each target in the build matrix. The latter is even more dumb when the changes concern only one (or some) of the targets thus wasting computing resources and taking ages as the number of targets increases.
To overcome the above the AppVeyor yaml was changed so it now relies on a PowerShell script that launches the build only for the selected targets. Or for all of them, if requested. There is no build matrix anymore, the target names and the build options are stored in a collection.
The _request_ to trigger the build for a specific target is made in the commit message by adding a _token_ (or more than one) with the board name(s), or `#ALL#`. The _token_ is the board name enclosed in '#', e.g. #I2M_OXYGEN_NF#.
The build of each of the Community targets is a job in Azure Pipelines yaml.
The build of each target is triggered by adding to the commit message (or PR description) a _token_ (or more than one) or `#ALL#`. The _token_ is the board name enclosed in '#', e.g. `#ST_STM32F4_DISCOVERY#`. Note that it's possible to add more than one token to the commit message to trigger the build for the specific targets.
## Build
## Setup the build for a new target
Update the [appveyor.yml](https://github.com/nanoframework/nf-Community-Targets/blob/master/Cappveyor.yml) in the Community repository as follows:
Update the [azure-pipelines.yml](https://github.com/nanoframework/nf-Community-Targets/blob/master/azure-pipelines.yml) in the Community repository as follows:
1. Edit the PowerShell script [get-target-to-build.ps1](https://github.com/nanoframework/nf-Community-Targets/blob/master/get-target-to-build.ps1) and add to the collection of community targets the triplet: target name, build options and the requirement to generate (or not) _DFU_ files.
1. Start by adding a new job to the collection. Preferably copy/paste from a similar target.
2. Make sure to use the target name at the various places where it shows, namely: job name, condition expression and variables.
## Publish
## Setup the image publishing
Community target images are distributed through **nanoFramework** JFrog Bintray [repository](https://bintray.com/nfbot/nanoframework-images-community-targets).
@ -28,7 +26,13 @@ Community target images are distributed through **nanoFramework** JFrog Bintray
2. Go to nanoframework-images-community-targets repository [here](https://bintray.com/nfbot/nanoframework-images-community-targets)
3. Add a new package inside that repository.
- The package name must be **exactly** the same as the target name otherwise the AppVeyor publish will fail.
- The package name must be **exactly** the same as the target name otherwise the publish step will fail.
- The remaining details are to be copied from one of the other existing targets. Mind the description field to update the target name and possibly the manufacturer.
4. Go to the package main page of the recently created package and grab the markdown from the "Latest Version Badge" link there and past it in the Community targets list in the readme.
## PRs and manual builds
When merging a PR make sure to add to the commit message the token(s) for the targets to build, otherwise the merge to the master branch won't trigger a build for any board.
It's possible to manually start a build _and_ specify that it should build all targets. This is most handy, for example, after a number of changes in the nf-interpreter repo to build new images for the Community targets. Another situation is when one forgets to add the build token in the PR merge and needs to trigger a build afterwards.