我在Azure DevOps中的构建管道对于每次推送都运行两次

时间:2020-10-19 10:25:31

标签: azure-devops continuous-integration continuous-deployment

我试图在Azure DevOps上为我的项目构建CI / CD管道。我曾经成功了一段时间,但现在我发现我的dev分支的代码推送两次启动了构建管道,一次在master管道中,一次在dev管道中,我也我的应用中心有两个版本。我尝试在Azure DevOps的“ trigers”页面中检查触发器和所有触发器,但这没有任何帮助。外面有人可以帮助我吗?谢谢。

以下是我的YAML配置文件:

  1. 对于大师
trigger:
- master

pool:
    vmImage: 'macos-latest'

steps:
- task: Gradle@2
    inputs:
    workingDirectory: ''
    gradleWrapperFile: 'gradlew'
    gradleOptions: '-Xmx3072m'
    publishJUnitResults: false
    tasks: 'assembleRelease'

- task: AndroidSigning@3
    inputs:
    apkFiles: '**/*.apk'
    apksignerKeystoreFile: 'key store file'
    apksignerKeystorePassword: '$(keyPassword)'
    apksignerKeystoreAlias: 'alias'
    apksignerKeyPassword: '$(keyPassword)'

- task: CopyFiles@2
    inputs:
    SourceFolder: '$(Agent.BuildDirectory)'
    Contents: '**/*.apk'
    TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
    inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'artifact'
    publishLocation: 'Container'

- task: AppCenterDistribute@3
    inputs:
    serverEndpoint: 'VSAC'
    appSlug: 'app slug'
    appFile: '**/*.apk'
    symbolsOption: 'Android'
    releaseNotesOption: 'input'
    releaseNotesInput: 'CICD Release Build'
    destinationType: 'groups'
    distributionGroupId: 'dist group id'
  1. 对于开发人员
trigger:
- dev

pool:
    vmImage: 'macos-latest'

steps:
- task: Gradle@2
    inputs:
    workingDirectory: ''
    gradleWrapperFile: 'gradlew'
    gradleOptions: '-Xmx3072m'
    publishJUnitResults: false
    tasks: 'assembleRelease'

- task: AndroidSigning@3
    inputs:
    apkFiles: '**/*.apk'
    apksignerKeystoreFile: 'key store file'
    apksignerKeystorePassword: '$(keyPassword)'
    apksignerKeystoreAlias: 'alias'
    apksignerKeyPassword: '$(keyPassword)'

- task: CopyFiles@2
    inputs:
    SourceFolder: '$(Agent.BuildDirectory)'
    Contents: '**/*.apk'
    TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
    inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'artifact'
    publishLocation: 'Container'

- task: AppCenterDistribute@3
    inputs:
    serverEndpoint: 'VSAC'
    appSlug: 'app slug'
    appFile: '**/*.apk'
    symbolsOption: 'Android'
    releaseNotesOption: 'input'
    releaseNotesInput: 'CICD Release Build'
    destinationType: 'groups'
    distributionGroupId: 'dist group id'

0 个答案:

没有答案