scala - YAML azure-pipelines.yml 语法为所有步骤添加 azureSubscription
问题描述
我需要azureSubscription: 'AWSMavenReadOnly'
为所有步骤添加“全局”。我试图避免使用完整的task
语法。我如何将其添加为所有这些脚本的输入?
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- script: sbt clean
displayName: 'Running $ sbt clean'
- script: sbt update
displayName: 'Running $ sbt update'
- script: sbt compile
displayName: 'Running $ sbt compile'
- script: sbt test
displayName: 'Running $ sbt test'
解决方案
我有点得到这个工作:
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: AWSShellScript@1
inputs:
awsCredentials: 'AWSMavenReadOnly'
regionName: 'eu-central-1'
scriptType: 'inline'
inlineScript: 'sbt clean update compile'
displayName: 'Running $ sbt clean update compile'
- task: AWSShellScript@1
inputs:
awsCredentials: 'AWSMavenReadOnly'
regionName: 'eu-central-1'
scriptType: 'inline'
inlineScript: 'sbt test'
displayName: 'Running $ sbt test'
现在我需要弄清楚如何使用 java11 而不是可用的默认 jreubuntu-latest
推荐阅读
- react-native - 如何在实际依赖项上提升一个笑话依赖项模拟?
- php - php foreach 作为更改变量名
- android - Android - 检测我的应用的其他用户是否在附近
- javascript - 单击标签时不检查单选按钮
- ios - 如何根据条件使用户无法访问主页中的标签栏
- c# - 与 IMediatR 库一起使用时无法在类型化客户端中注入 HttpClient
- elasticsearch - ElasticSearch:在 NEST 中用户提供的查询之上应用过滤器
- android - Android Koin NoBeanDefFoundException 仅在应用程序的发布版本中
- apache-spark - Spark Kafka流0.8间接流KafkaUtils.createStream updateWaterMark是否将偏移量保存到Zookeeper?
- javascript - AngularJS将数据发布到PHP - 试图获取非对象的属性