Похожие чаты

Hey guys! need help pls I have a pipeline MyPipeline, where

I go to UI and do the following
Azure UI:
Pipelines --> MyPipeline --> Variables -->
excludedProjs = 'Proj1,Proj2,Proj3'
I proceed with the following in the yml file:
variables:
- name: doDeployment
value: $[and(ne(variables['Build.Reason'], 'PullRequest'), or(eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.SourceBranch'], '${{ parameters.triggerBranch }}')))]
- name: doProj1Deployment
value: $[and(variables['doDeployment'], ne('${{ containsValue(split({excludedProjs_set_from_ui}, ','), 'Proj1') }}', 'true'))]
- name: doProj2Deployment
value: $[and(variables['doDeployment'], ne('${{ containsValue(split({excludedProjs_set_from_ui}, ','), 'Proj2') }}', 'true'))]
- name: doProj3Deployment
value: $[and(variables['doDeployment'], ne('${{ containsValue(split({excludedProjs_set_from_ui}, ','), 'Proj3') }}', 'true'))]
- name: doProj4Deployment
value: $[and(variables['doDeployment'], ne('${{ containsValue(split({excludedProjs_set_from_ui}, ','), 'Proj4') }}', 'true'))]

the problem is that I can't get it working after like 15 iterations. I just want to provide a list of projects to exclude the jobs related to them in the pipeline from running. is there a way to do this?

1 ответов

8 просмотров

Azure DevOps doesn't support a containsValue function out of the box. You'll need to modify your logic to make it work. Here's a revised example using in for string matching: yaml variables: - name: doDeployment value: $[and(ne(variables['Build.Reason'], 'PullRequest'), or(eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.SourceBranch'], '${{ parameters.triggerBranch }}')))] - name: doProj1Deployment value: $[and(variables['doDeployment'], not(in('Proj1', variables['excludedProjs'])))] - name: doProj2Deployment value: $[and(variables['doDeployment'], not(in('Proj2', variables['excludedProjs'])))] - name: doProj3Deployment value: $[and(variables['doDeployment'], not(in('Proj3', variables['excludedProjs'])))] - name: doProj4Deployment value: $[and(variables['doDeployment'], not(in('Proj4', variables['excludedProjs'])))] Key Changes: 1. Replaced containsValue with in for string matching. 2. Replaced {excludedProjs_set_from_ui} with variables['excludedProjs'] to reference the variable set from the Azure UI.

Похожие вопросы

Обсуждают сегодня

@LGCYMan @JustinKKW Q/A List 1. this part confuses me on #8: "From there, a bridge between erc20 LGXY and erc20 LGXY will be out once that swap is closed." does this mean ...
Sig | LGCY | BattleVerse L1 | BitWin
1
Did @Beeker really get banned? That's ridiculous. He's one of the few left here with half a brain and you might not always like his narrative @dgb_ycagel , but he often keeps ...
Leroy Gerrits
1
async login(req: Request, res: Response, next: NextFunction): Promise<void> { try { const { errors, input } = await RequestValidator(LoginRequest, req.body...
. .
1
Anyone here suffers from unexplained aural migraines, who would be up for talking for a bit? Doesn't *have* to be aural, but I am not asking about headaches, I mean actual mi...
Martin Rys
55
hello friends. Do you know how can I learn getx? I have a software project that I should deliver it up to 5 weeks later and I need to learn firebase too. I will be thankfull
AmirHossein Razavi
15
Hello guys, I have staked Matic as stMatic via Lido nearly a year ago and recently I wanted to unstake but the platform offered me to unstake via Kyberswap for a faster trans...
Mike
7
Привет, нужен совет старших товарищей. Есть глобальная переменная var DefaultDataFolder:string; инициализируем DefaultDataFolder:='a:\_OUT\'; есть примитивная процедур...
Max Otto
14
A couple thoughts from a random internet stranger: 1. If you want this project to gain traction you cannot keep being negative. If I just came here after finding out about Kd...
Eric Wild
46
We heading to 1.1$ 🤔?
CryptoBo$$
35
lazarus-3.2.0/gtk, linux патч "имя проекта по умолчанию project1 -> prj" день добрый не нравится "именя проекта по умолчанию" (project1), к.раз приходится переименовывать (н...
livontiy
5
Карта сайта