提问人:geekZ 提问时间:10/13/2023 更新时间:10/13/2023 访问量:19
使用 ADO 管道生成多个 SSIS 项目 (.dtproj)
Build multiple SSIS projects (.dtproj) with ADO pipeline
问:
大家好(我真的需要帮助) 主要的 goad 是构建几个 SSIS 项目 (.dtproj),它们与 yaml 文件位于同一存储库中,基本上我有 3 个文件,如下所示: 1 - 主 YAML
trigger:
- none
pool:
vmImage: windows-latest
steps:
- powershell: |
# PowerShell script goes here
$projectFile = "SSIS/project_paths.txt"
$projects = Get-Content $projectFile -Raw
$projectList = $projects -split "`n" | ForEach-Object { $_.Trim() }
# Set the parameter name
$parameterName = "MyParameter"
$formattedProjects = $projectList | ForEach-Object { "##vso[task.setvariable variable=$parameterName;issecret=false]$_" }
# Print each item in the list
$projectList | ForEach-Object { Write-Host $_ }
displayName: 'Set Pipeline Parameter and Print'
- template: CI/template.yaml
parameters:
projects: $projectList
2 - YAML 模板
parameters:
- name: projects
type: object
steps:
- ${{ each projectPath in parameters.projects }}:
- task: SSIS.ssis-devops-tools.ssis-build-task.SSISBuild@1
displayName: 'Build SSIS for ${{ projectPath }}'
inputs:
projectPath: ${{ projectPath }}
stripSensitive: true
outputPath: '$(Build.ArtifactStagingDirectory)'
continueOnError: true # Continue building even if some projects fail (optional)
- task: PublishBuildArtifacts@1
displayName: 'Publish Build Artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'YourArtifactName'
publishLocation: 'Container'```
3 - text file
项目路径1 项目路径2
the goal is to launch the main pipeline which will read the project paths from the text file then the store in a parameter then launch the template with the list of project paths and loop over the build task but i always got an error in the build section ! what i'm trying to do is correct ? or is technicaly impossible?
chatgpt didnt help me that much :p
答: 暂无答案
评论