首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Azure DevOps -提交到发布管道上的Bitbucket存储库更新文件?

Azure DevOps -提交到发布管道上的Bitbucket存储库更新文件?
EN

Stack Overflow用户
提问于 2020-03-11 03:14:47
回答 1查看 220关注 0票数 1

我有一个npm源代码,需要建立和推送到npmjs存储库。在详细信息中,它看起来像:

构建管道:

代码语言:javascript
复制
1) Get sources from Bitbucket repository
2) Get from package.json version number (ex. 0.0.3), increase it by 0.0.1 (0.0.4) and add this value to build variables $(version)
3) Make NPM install and build.
4) Take package-0.0.4.tgz and package.json to the artifacts folder and publish it.

发布管道:

代码语言:javascript
复制
1) Download artifacts
2) Extract package-0.0.4.tgz to npm-publish folder
3) Copy package.json to npm-publish folder
4) Publish npm folder to npmjs repository.

我的问题-在发布到npmjs存储库后,是否可以将新版本的更新package.json文件提交到Bitbucket存储库?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-03-11 12:33:15

可以提交到Bitbucket存储库。您只需要添加一个脚本任务来执行git命令。

对于下面的例子。我添加了一个powershell任务来运行管道中的以下命令,以提交更改并推送到Bitbucket代码库。

代码语言:javascript
复制
- powershell: |

   git config --global user.email "you@example.com"
   git config --global user.name "user.name"

   #echo "some-text"  > filename.txt

   git add .

   git commit -m "update package version"

   git push https://username:password@bitbucket.org/name/repo.git HEAD:master -q
   #if your password or username contain @ replace it with %40

  displayName: 'push to bitbucket'
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60624478

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档