我有一个npm源代码,需要建立和推送到npmjs存储库。在详细信息中,它看起来像:
构建管道:
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.发布管道:
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存储库?
发布于 2020-03-11 12:33:15
可以提交到Bitbucket存储库。您只需要添加一个脚本任务来执行git命令。
对于下面的例子。我添加了一个powershell任务来运行管道中的以下命令,以提交更改并推送到Bitbucket代码库。
- 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'https://stackoverflow.com/questions/60624478
复制相似问题