Multiple checks with if else and or in yaml

Viewed 113

I am trying to utilize one YAML file for multiple environments with different configuration settings.

Below is the yaml example:

parameters:
- name: environment
  displayName: Build Environment
  type: string
  default: Staging
  values:
  - Staging
  - Release
  - Production

variables: 
  - name: certificatename
  ${{ if eq(parameters.environment, 'Staging') }}:
  value: 'cert1.p12'
  ${{ if eq(parameters.environment, 'Release') }}:
  value: 'cert2.p12'

Is there a way to club release and prod in one go?

like ${{ if eq(parameters.environment, 'Release'), eq(parameters.environment, 'Production') }}: however, I keep getting errors. If anyone knows of any way to the club this statement, would appreciate the input.

1 Answers
Related