您认为可以引用两个不同名称、两个不同路径的同一个BitBucket存储库来实现和触发两个不同的阶段吗?我想在K8s上构建和发布7种不同的微服务,但是repos只有3种(在子文件夹中被分割),这是可以实现的吗?其想法是为每个微服务创建不同的模板块。但是,在模板期间,只签出3宏存储库(用于开发目的)。让我给你看看我的想法。
resources:
repositories:
############## 3 BITBUCKET BIG REPOS ##############
- repository: omni-omsf-api
type: bitbucket
endpoint: OMNI-OMSF-BitBucket-SC
name: ovsdev/omni-omsf-api
trigger: none
- repository: omni-omsf-extension
type: bitbucket
endpoint: OMNI-OMSF-BitBucket-SC
name: ovsdev/omni-omsf-extension
trigger: none
- repository: omni-omsf-core
type: bitbucket
endpoint: OMNI-OMSF-BitBucket-SC
name: ovsdev/omni-omsf-core
trigger: none
###################################################
############# 7 SUB-REPOS ONLY FOR TRIGGERING #########
- repository: ovs-api-service
type: bitbucket
endpoint: OMNI-OMSF-BitBucket-SC
name: ovsdev/omni-omsf-api
trigger:
branches:
include:
- release_qa
- master
paths:
include:
- ovs-api-service/*
###################################################
stages:
- ${{ if or( and( eq( parameters.ovsapiservice, true), eq( variables['Build.Reason'], 'Manual') ), eq( variables['Build.Repository.Name'], 'ovs-api-service') ) }}:
- template: microservice-buildRelease.template.yml
parameters:
dockerFilePath: omni-omsf-api/ovs-api-service/Dockerfile
dockerImageName: ovs-api-service
tag: $(Build.BuildId)
microservicename: ovs-api-service
- ${{ else }}:
- stage:
jobs:
- job:
steps:
- task: Bash@3
displayName: Showing folder hierarchy
inputs:
targetType: 'inline'
script: |
tree $(Pipeline.Workspace)发布于 2022-11-18 07:50:35
我可以用两个不同的名称引用同一个BitBucket存储库吗?
答案是“是”,不同的别名可以从同一个存储库引用。
启用Azure DevOps服务上的自定义触发
我阅读了您提供的YAML定义,如果您讨论的是资源部分的触发器,那么的答案是NO.。
应该指出,您正在使用的用法并不存在。
请查阅这些官方文章,它们都提到了这一点:
resources.repositories.repository定义
触发器:这个存储库的触发器# CI触发器,如果跳过没有CI触发器(只适用于Azure )。
存储库资源触发器目前只适用于同一组织中的Azure Repos Git存储库。它们不适用于GitHub或Bitbucket存储库资源。
因此,通过YAML的资源部分触发是无法实现的,您只能在bitbucket端设置YAML,并且条件应该基于公共触发器比特桶侧。
https://stackoverflow.com/questions/74476229
复制相似问题