I am wondering actually more confused when to use the hypen in a YAML file in this case for use in Azure DevOps. I included the below YAML file as a demonstration of what I mean.
I hopefully am correct that I found out that hypens - are used when we use list items. So if I look at jobs: there are more jobs so each job is preceded with a -
Steps have tasks so the individual tasks ate preceded with a -
But when I look at variables. I would have expected them to be some sort of list ( i am not a developer) so what are they? Because the individual variables are not preceded with a -
Same as Pool: it doesn't have a hypen.
Same with inputs: I would have expected a - here as well for the individual inputs. So maybe a better question is to ask what are the indivdual pool, variables and inputs seen as why no hypen is used. I just can't seem to find an answer.
I hope I explained it clearly enough.
Regards,
John
trigger:
- none
stages:
- stage: Build
pool:
vmImage: 'windows-latest'
jobs:
- job: Build
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Pipeline.Workspace)'
artifact: 'drop'
publishLocation: 'pipeline'
- stage: Deploy
pool:
vmImage: 'windows-latest'
jobs:
- job: Deploy
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'drop'
targetPath: '$(Pipeline.Workspace)'
- task: AzureWebApp@1
inputs:
azureSubscription: 'tofreewebapp'
appType: 'webApp'
appName: 'freewebappdave'
package: '$(Pipeline.Workspace)/drop/*.*'
deploymentMethod: 'auto'