如何设置链接的工作项以在发布完成后自动更改状态。
例如,状态处于 DEV 状态,代码通过发布管道部署到 QA 分支。如果发布管道成功,我希望我的工作项自动更改状态。
tfs workitem azure-devops azure-pipelines azure-devops-rest-api
我有两个环境,preprod 和 prod,它们几乎相同。
所以我创建了一个 yaml 文件,InfurstructionTemplate.yaml
parameters:
xxxx
jobs:
- job: provision_job
Run Code Online (Sandbox Code Playgroud)
我想在我的两个环境中使用这个模板,以下是我的想法:
stages:
- stage: PreProd Environment
- template: InfurstructureTemplate.yaml
- parameters:
xxxx
- stage: Prod Environment
- template: InfurstructureTemplate.yaml
- parameters:
xxxx
Run Code Online (Sandbox Code Playgroud)
这是使用 yaml 模板的正确方法吗?当我用谷歌搜索这个时,似乎模板处于阶段级别,并且您不能将其放在阶段上。
我正在使用 AzureDevOps 构建管道,但遇到了一个奇怪的问题。
这是我的管道:
- stage: 'Test'
displayName: 'Deploy to the test environment'
dependsOn: Build
jobs:
- job: 'Deploy'
steps:
- download: current
artifact: lorehub-front
- bash: cd $(Pipeline.Workspace); echo $(ls)
- bash: cd $(Pipeline.Workspace)/lorehub-front; echo $(ls)
- task: AzureStaticWebApp@0
displayName: 'Publish to Azure Static WebApp'
inputs:
app_location: $(Pipeline.Workspace)/lorehub-front
azure_static_web_apps_api_token: xxxx
Run Code Online (Sandbox Code Playgroud)
第一个 bash 显示存在文件夹“lorehub-front”
第二个 bash 显示内部文件夹是正确的文件(index.html 等)
脚本内容:cd /home/vsts/work/1/lorehub-front;回声 $(ls)
android-chrome-192x192.png android-chrome-512x512.png apple-touch-icon.png css env-config.js favicon-16x16.png favicon-32x32.png favicon.ico 字体 index.html js site.webmanifest
但我收到此错误:
应用程序目录位置:“/home/vsts/work/1/lorehub-front”无效。无法检测到该目录。请验证您的部署配置文件反映了您的存储库结构。
我尝试在天蓝色管道上使用 sonarcube 配置代码分析。当我运行管道时,我遇到了这样的错误。
错误:“类型‘org.sonarqube.gradle.SonarQubeTask’属性‘pluginVersion’是私有的并用@Internal注释。”
Task:sonarqube FAILED
WARNING:API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
It will be removed in version 7.0 of the Android Gradle plugin.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':sonarqube' (type 'SonarQubeTask').
- Type 'org.sonarqube.gradle.SonarQubeTask' property 'pluginVersion' is private and annotated …Run Code Online (Sandbox Code Playgroud) 我可以找到任何解释 Docker@0、Docker@1 等之间差异的微软文档。我可以看到这些之间存在一些差异,例如 azureSubscription 属性仅在 Docker@0 中可用,而标签通常仅在 Docker@ 中找到2.
到目前为止,唯一可用的链接是链接
我已经尝试了 Stackoverflow 上的几篇文章和线程,但似乎没有任何进展。我试图从 YAML 步骤中调用的 .py 文件中获取一个变量,并将该变量设置为全局使用。
在我的 。我有py 文件
print(f'##vso[task.setvariable variable=AMLPipelineId;isOutput=true]{pipelineId}')
Run Code Online (Sandbox Code Playgroud)
然后在我的 YAML 管道步骤中我有
- task: AzurePowerShell@5
displayName: 'Run AML Pipeline'
inputs:
azureSubscription: '$(azureSubscription)'
ScriptType: 'InlineScript'
name: AmlPipeline
azurePowerShellVersion: 'LatestVersion'
pwsh: true
Inline: |
$username = "$(ARM_CLIENT_ID)"
$password = "$(ARM_CLIENT_SECRET)"
$tenantId = "$(ARM_TENANT_ID)"
python $(Pipeline.Workspace)/AML_Pipeline/build_aml_pipeline.py --wsName $(wsName) --resourceGroup $(ResourceGroupName) --subscriptionId $(subId)
$MLPipelineId = $AmlPipeline.AMLPipelineId
Run Code Online (Sandbox Code Playgroud)
但这个变量似乎是空的。我知道还有其他方法可以使用“设置变量”,但这是我最新的尝试,例如print('##vso[task.setvariable variable=version;]%s' % (version))
此错误开始出现在 Web 项目构建的构建任务“运行代码分析”中。我已经执行了该命令npx browserslist@latest --update-db,但没有解决问题。
“运行代码分析”似乎已完成。关于如何摆脱有关“caniuse-lite 已过时”的消息有什么建议吗?
##[error]ERROR: Browserslist: caniuse-lite is outdated. Please run:
ERROR: Browserslist: caniuse-lite is outdated. Please run:
##[error]ERROR: npx browserslist@latest --update-db
ERROR: npx browserslist@latest --update-db
ERROR:
ERROR: Why you should do it regularly:
ERROR: https://github.com/browserslist/browserslist#browsers-data-updating
Run Code Online (Sandbox Code Playgroud) 我有产品订阅,由于缺少权限,部署管道失败。我的 Azure AD 用户无权创建或删除 Azure SQL 的锁。
我想知道什么以及如何配置用户权限,以便 Azure Pipeline 可以创建、编辑或删除资源锁?
地形:
resource "azurerm_management_lock" "hellodb_lck" {
for_each = var.databases
name = "can-not-delete"
scope = azurerm_sql_database.hellodb[each.key].id
lock_level = "CanNotDelete"
}
Run Code Online (Sandbox Code Playgroud) azure terraform azure-sql-database azure-pipelines azure-rbac
我正在 azure devops 中设置构建管道。有一个名为 YarnInstaller@3 的助理任务,它允许我安装特定版本的 Yarn。但是,列出的唯一可用版本是 1.x,最新版本是 1.22。
https://yarnpkg.com/getting-started/install上有关于从 v1 迁移到 v2+ 的迁移说明,我已在本地完成此操作。由于只有yarn@1.x可用,似乎我每次运行构建时都必须迁移,例如
这似乎没有必要,特别是因为我已经提交了.yarnrc.yml和.yarn子目录。我这样说有错吗?还有另一种方法可以在我的管道中安装yarn@2+吗?
azure-pipelines ×10
azure-devops ×8
azure ×2
sonarqube ×2
tfs ×2
yaml ×2
azure-rbac ×1
docker ×1
gradle ×1
terraform ×1
workitem ×1
yarnpkg-v2 ×1