【发布时间】:2019-03-29 11:23:01
【问题描述】:
我正在尝试在 Azure DevOps Pipelines 上为具有自动递增版本号的 nodejs 项目的托管 Ubuntu 代理设置 CI。
我在使用 npm 版本补丁增加版本时遇到错误
[command]/opt/hostedtoolcache/node/8.12.0/x64/bin/npm run release-it
npm ERR! Git working directory not clean.
npm ERR! M package-lock.json
> identity@2.0.2 release-it /home/vsts/work/1/s
> npm version patch && git push --follow-tags
npm ERR! A complete log of this run can be found in:
即使我不推送到 git,错误仍然存在。
作为 CI 的一部分,我已经清理了 repo
resources:
- repo: self
clean: true
trigger:
batch: true
branches:
include:
- '*'
pr:
autoCancel: true
branches:
include:
- 'master'
jobs:
- job: identity_release
timeoutInMinutes: 20
workspace:
clean: all
pool:
vmImage: 'ubuntu-16.04'
demands:
- npm
condition: or(eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'Schedule'))
steps:
- script: echo The build reason is $(Build.Reason) and branch is $(Build.SourceBranch)
- template: release-build-steps.yml
我已经在 CI 中使用 shell 脚本清理了构建源目录,但无济于事。
任何方向都会有所帮助。
【问题讨论】:
标签: node.js npm azure-devops azure-pipelines azure-pipelines-build-task