我需要使用 Node.js 的 Visual Studio Team Services 客户端 (vso-node-api) 创建 VSTS 工作项,请提供相关示例吗?
tfs-sdk node.js azure-devops azure-pipelines-build-task azure-pipelines
我尝试WPF在 Visual Studio Online ( VSTS) 中设置我们的应用程序构建,但出现错误:
警告MSB3327:无法在当前用户的 Windows 证书存储中找到代码签名证书。要更正此问题,请禁用 ClickOnce 清单签名或将证书安装到证书存储中。
错误MSB3326:无法导入以下密钥文件:。密钥文件可能受密码保护。要更正此问题,请尝试再次导入证书或将证书手动导入到当前用户的个人证书存储中。
我们在生产中使用代码签名,因此我无法禁用此选项或<manifestkeyfile>从csproj. 有什么办法可以导入这个证书吗VSTS?找不到任何有关此的信息...
实际上,我只需要构建它(无需部署),但看起来我无法关闭特定配置的签名。
我想在来自自托管构建服务器的 Azure Devops 发布管道中从 powershell 脚本执行 git push 。
它在构建管道中工作,但从发布管道中我最终遇到身份验证错误。“允许脚本访问 OAuth 令牌”已激活,并且构建机器具有贡献权限(正如我所说,它在构建管道中工作)。
这是我在 devops protal 中看到的错误:
git : remote: 001f# service=git-receive-pack
At C:\Builds\A1\_work\r1\a\Source\Scripts\CreateTagFromPipeline.ps1:11 char:1
+ git push
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (remote: 001f# service=git-receive-pack:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
PowerShell exited with code '1'.
Run Code Online (Sandbox Code Playgroud)
如果我通过远程桌面登录到机器并手动推送,我会得到一些更好的错误:
$ git push
remote: 001f# service=git-receive-pack
remote: 0000000000aaTF401027: You need the Git 'GenericContribute' permission to perform this action. Details: identity 'Build\58bb64d7-d065-4522-94e2-a153b9fdadd6', scope 'repository'.
remote: TF401027: You need the Git 'GenericContribute' permission to …Run Code Online (Sandbox Code Playgroud) 在我的 Azure DevOps 构建任务中,我运行了 Cypress 测试。如果测试失败,则取消构建。但是我想在赛普拉斯发布测试结果后运行另一个任务。
我已经在我的 pipeline.yml 文件中尝试了这个任务:
- task: PowerShell@2
inputs:
targetType: "inline"
script: "yarn test:cypress"
errorActionPreference: "continue"
displayName: "start server and run cypress"
Run Code Online (Sandbox Code Playgroud)
但这似乎没有任何影响。
我试过添加-ErrorAction 'Continue'到脚本”
"start": "npm-run-all -s build:shared-web run:shell",
"cy:run": "cypress run -ErrorAction 'Continue'",
"test:cypress": "start-server-and-test start http://localhost:3000 cy:run"
Run Code Online (Sandbox Code Playgroud)
但这失败了:
错误:未知选项:-E
看起来赛普拉斯将ErrorAction视为赛普拉斯参数。
那么,如果任务失败,继续构建的正确方法是什么?
如何覆盖管道变量或如何从作业创建管道变量?
我正在运行一个prepare作业,我将当前的 git 标签提取到一个我在后续作业中需要的变量中,所以我决定创建一个管道变量并在第一个作业中覆盖它的值:
variables:
GIT_TAG: v0.0.1
jobs:
- job: job1
pool:
vmImage: 'ubuntu-16.04'
steps:
- powershell: |
Write-Host "##vso[task.setvariable variable=GIT_TAG]$(git describe --tags --always)"
Run Code Online (Sandbox Code Playgroud)
但是,在下一个作业GIT_TAG中的初始值为v0.0.1。
我的 Azure DevOps 管道使用来自两个不同存储库的 yaml 模板,其配置如下。
模板存储库作为根模板中的资源被引用。我没有找到只检出模板存储库一次然后在所有管道阶段使用模板和脚本的方法。现在,我必须在需要使用其他模板或脚本的每个阶段手动克隆模板存储库。在每个阶段结束时,Azure Devops 会清除克隆的存储库。是否有一种简单的方法可以只检出模板 repo 一次,或者以其他方式从子阶段引用其资源?
在 Azure DevOps 中,我使用多阶段 YAML 管道进行构建和部署。屏幕截图显示了当前的管道设置。我希望单独拥有 sandbox1 而不依赖于 Build。
trigger: none
pr: none
stages:
- stage: 'Build'
jobs:
- job: 'Build'
pool:
vmImage: ubuntu-16.04
steps:
- checkout: none
- powershell: |
echo "Hello Testing"
- stage: 'Sandbox'
jobs:
- job: 'Sandbox'
pool:
vmImage: ubuntu-16.04
steps:
- checkout: none
- powershell: |
echo "Hello Testing"
- stage: 'DEV'
jobs:
- job: 'DEV'
pool:
vmImage: ubuntu-16.04
steps:
- checkout: none
- powershell: |
echo "Hello Testing"
- stage: 'QA'
dependsOn: ['DEV','DEV1']
jobs: …Run Code Online (Sandbox Code Playgroud) 我已经非常接近我的模板和使用它的部署 yaml。但是我遇到了错误
意外值“变量”意外值“阶段”
我确信我的语法是错误的,但我一生都无法理解为什么。
这是我的模板的开始
#File: template.yml
parameters:
- name: repositoryName
type: string
default: ''
variables:
tag: '$(Build.BuildId)'
buildVmImage: 'ubuntu-latest'
deployPool: 'deploy-pool'
stages:
- stage: Build
jobs:
- job: Build
pool:
vmImage: $(buildVmImage)
steps:
- checkout: self
submodules: recursive
Run Code Online (Sandbox Code Playgroud)
这是使用它的部署 yaml
# Repo: Organization/Project
# File: azure-pipelines.yml
trigger:
- develop
- next
- master
resources:
repositories:
- repository: template
type: git
name: AzureDevOps/AzureDevOps
jobs:
- template: template.yml@template
parameters:
repositoryName: 'exampleName'
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激。我确定它就在我的鼻子前,但我已经挣扎了好几天,所以我认为是时候寻求帮助了。
我们正在尝试在 Azure Pipeline 中自动化 Teams Tab 应用程序,但我们想知道这是否可能。我们已经为应用程序创建了 zip 文件,该文件可以通过 App Studio 上传并且可以正常工作。但是我们不希望客户通过 App Studio 这样做,相反,我们希望在他们的管道上自动化这个过程。为此,我们创建了以下 powershell:
# Generate zip file for deployment
$compress = @{
Path = "color.png", "outline.png", "manifest.json"
CompressionLevel = "Fastest"
DestinationPath = "app.zip"
}
Compress-Archive @compress -Update
Run Code Online (Sandbox Code Playgroud)
然后我们检查是否MicrosoftTeams安装了模块,否则我们安装它:
# Checks whether MicrosoftTeams module is available
if (Get-Module -ListAvailable -Name "MicrosoftTeams") {
Write-Verbose "MicrosoftTeams module already installed."
}
else {
Write-Verbose "Installing module MicrosoftTeams - https://docs.microsoft.com/en-us/powershell/module/teams/?view=teams-ps."
Install-Module MicrosoftTeams
}
Write-Verbose "Importing module MicrosoftTeams."
Import-Module MicrosoftTeams
Run Code Online (Sandbox Code Playgroud)
我们与 …
我有以下模板可以进行多阶段部署:
parameters:
- name: Stage
type: string
- name: Environment
type: string
- name: Enabled
type: boolean
default: false
- name: WebAppName
type: string
- name: ArtifactName
type: string
stages:
- stage: ${{ parameters.Stage }}
displayName: '${{ parameters.Stage }} Stage'
dependsOn: '${{ parameters.DependsOn }}'
jobs:
- deployment: ${{ parameters.Environment }}
timeoutInMinutes: 70
environment: '${{ parameters.Environment }} Environment'
pool:
vmImage: $(vmImageName)
strategy:
runOnce:
deploy:
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: ${{ parameters.ArtifactName }}
downloadPath: '$(System.ArtifactsDirectory)'
- task: …Run Code Online (Sandbox Code Playgroud) 我有 Azure Pipeline,它创建 VM、存储、NIC 等。我希望如果管道中的任何任务失败,应删除这些资源。如何实现这一点,我是否需要在 YAML 中使用脚本或者是否有任何可用的扩展?
我需要将基于Excel的测试用例导入VSTS并将测试用例从VSTS导出到MS Excel.VSTS(非TFS)
excel visual-studio-2010 microsoft-test-manager azure-pipelines azure-pipelines-release-pipeline
azure-pipelines ×12
azure-devops ×10
automation ×1
azure ×1
azure-pipelines-release-pipeline ×1
excel ×1
git ×1
node.js ×1
powershell ×1
tfs-sdk ×1
yaml ×1