[CI] Allow to force a build to be usable for insertions. (#13563)

This change allows to have a parameter (false by default) that allows to
get a build to be able to do an insertion even when it is comming from a
not predefined branch.

Uses cases:

1. Trigger a buiild with no tests from a special branch to insert.
2. Work with the CI to test the deployment.
This commit is contained in:
Manuel de la Pena 2021-12-14 18:08:59 -05:00 коммит произвёл GitHub
Родитель 5c68aca748
Коммит 06bacc24a4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 6 добавлений и 1 удалений

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

@ -36,6 +36,11 @@ parameters:
type: boolean
default: true
- name: forceInsertion
displayName: Force Insertion
type: boolean
default: false
# We are doing some black magic. We have several templates that
# are executed with different parameters.
#
@ -254,7 +259,7 @@ stages:
enableDotnet: ${{ parameters.enableDotnet }}
# .NET 6 Release Prep and VS Insertion Stages, only execute them when the build comes from an official branch and is not a schedule build from OneLoc
- ${{ if and(ne(variables['Build.Reason'], 'Schedule'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) }}:
- ${{ if and(ne(variables['Build.Reason'], 'Schedule'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), eq(parameters.forceInsertion, true))) }}:
- template: templates/release/vs-insertion-prep.yml
# Test stages