Skip to content

Commit

Permalink
fix for build all tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
merlynomsft committed Oct 26, 2024
1 parent ef07bdb commit c5202fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ variables:
value: 'true'
${{ else }}:
value: 'false'
- name: DEPLOY_ALL_TASKSVAR
${{ if eq(parameters.deploy_all_tasks, true) }}:
value: 'true'
${{ else }}:
value: 'false'

extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
Expand Down
8 changes: 6 additions & 2 deletions ci/filter-tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ var setTaskVariables = function(tasks, tasksForDowngradingCheck) {
var buildReason = process.env['BUILD_REASON'].toLowerCase();
var forceCourtesyPush = process.env['FORCE_COURTESY_PUSH'] && process.env['FORCE_COURTESY_PUSH'].toLowerCase() === 'true';
var taskNameIsSet = process.env['TASKNAMEISSET'] && process.env['TASKNAMEISSET'].toLowerCase() === 'true';
var deployAllTasks = process.env['DEPLOY_ALL_TASKSVAR'] && process.env['DEPLOY_ALL_TASKSVAR'].toLowerCase() === 'true';

if (taskNameIsSet) {
var taskName = process.env['TASKNAME'];
Expand All @@ -240,7 +241,7 @@ const ciBuildReasonList = [AzpBuildReason.Individualci, AzpBuildReason.Batchedci

async function filterTasks () {
try {
if (ciBuildReasonList.includes(buildReason) || (forceCourtesyPush && !taskNameIsSet)) {
if (ciBuildReasonList.includes(buildReason) || (forceCourtesyPush && !taskNameIsSet && !deployAllTasks)) {
// If CI, we will compare any tasks that have updated versions.
const tasks = await getTasksToBuildForCI();
setTaskVariables(tasks, tasks);
Expand All @@ -250,7 +251,10 @@ async function filterTasks () {
const regex = /^refs\/pull\/(\d+)\/merge$/;
const prIdMatch = buildSourceBranch.match(regex);

if (buildReason == AzpBuildReason.Pullrequest) {
if (deployAllTasks)
{
setTaskVariables(makeOptions.tasks, makeOptions.tasks);
} else if (buildReason == AzpBuildReason.Pullrequest) {
// If PR, we will compare any tasks that could have been affected based on the diff.
const tasks = await getTasksToBuildForPR(null, false);
const tasksForDowngradingCheck = await getTasksToBuildForPR(null, true);
Expand Down

0 comments on commit c5202fb

Please sign in to comment.