As any Coral template, this template have a README.md
and two folders: artifacts
and namespaces
.
The README.md
is to give a description to the users of the template after it has been registered. The artifacts
are files used to ait the creation of the resources and namespaces
defines the resources that the template will create.
The Respository.yml
defines the Azure DevOps repository to create and also the policies that will be attached to it.
The Pipelines.yml
defines the Azure DevOps pipelines for build and release.
The first thing to look at is what input the template requires from the user. We can deduce this by looking at the non-hidden parameters of each namespace.
parameters: # Repository.yml
- id: RepositoryName
type: string
display: Repository name
- id: RequiredReviewers
type: validator
display: Required reviewers email
valueProvider: local://aad/parameters/email?type=group&mailenabled=true&security=true
parameters: # Pipelines.yml
- id: QueueId
display: Agent Queue
valueProvider: local://vsts/parameters/agentqueues
placeHolder: Select the queue for build and release pipelines with linux container support
- id: SecureFileId
display: Strong name key file
placeHolder: Select the secure file to use for strong name signing
valueProvider: local://vsts/parameters/securefiles
- id: EsrpEndpointId
display: Esrp Service Endpoint
placeHolder: Select the endpoint to use for signing
valueProvider: local://vsts/parameters/serviceendpoints?type=PRSS
So in total there are 5 inputs required by a user of this template that can have impact on how easy it is to reuse. The two from the Repository.yml
has little impact, but all three from the Pipelines.yml
indicates dependencies:
So for this template to work out-of-the-box these dependencies will have to be present for the project.
Other things to look for are hard-coded values in the artifacts
and namespace
folders. This template should not have any of those.
In order to fork a template repository, whether it is in the same account or not, we recommend the following approach:
CoralTemplates
project of your account.git remote add msfast https://msfast.visualstudio.com/DefaultCollection/Coral/_git/DotNet-Template && git fetch msfast
git merge msfast/master && git push origin master
You should now have your own copy of the template, but you can, at any time remerge with the remote, as they now share a common history.
You might have noticed, as you browsed the template that the Repository.yml
referred to a baseline in the repository resource declaration.
payload:
repositories:
- id: repository
name: '{RepositoryName}'
stage: Incubation
# This is the baseline
baseline: 'https://msfast.visualstudio.com/DefaultCollection/Coral/_git/DotNet-Baseline'
defaultBranch: master
As you can see this refers back to the account from which the template originated. The reason this cannot be reused, is that Coral is unable to authenticate across accounts. Hence, the baseline must also be forked into your own account. To do this, follow the same steps as for the template.
CoralTemplates
project of your account.git remote add msfast https://msfast.visualstudio.com/DefaultCollection/Coral/_git/DotNet-Baseline && git fetch msfast
git merge msfast/master && git push origin master
Refer to the how-to register template in Coral and register the Dotnet-Template
repository from the CoralTemplates
project.