【问题标题】:Azure web app deployment output eating up bitbucket pipelines minutesAzure Web 应用程序部署输出占用了 bitbucket 管道分钟数
【发布时间】:2018-12-10 17:08:12
【问题描述】:

我有以下 CI/CD 设置:

将代码推送到“origin/develop”分支 => bitbucket 管道运行集成测试并构建源代码 => 推送到 azure web 应用程序 => azure web 应用程序安装节点模块并启动

问题是当管道将构建的代码推送到 azure 时,远程(即 azure Web 应用程序)将部署的输出发送回管道。如下所示:

+ git push --force https://$AZURE_LOGIN:$AZURE_PASSWORD@hostname.scm.azurewebsites.net/hostname.git build
remote: Updating branch 'build'.        
remote: ...............        
remote: Updating submodules.        
remote: Preparing deployment for commit id '...'.        
remote: Generating deployment script.        
remote: Running deployment command...
remote: Handling node.js deployment.        
remote: Kudu sync from: '/home/site/repository' to: '/home/site/wwwroot'
remote: ...........        
remote: Processed 706 files...        
remote: Detecting node version spec...        
remote: Using appsetting WEBSITE_NODE_DEFAULT_VERSION value: 8.11        
remote: Node.js versions available on the platform are: 4.4.7, 4.5.0, 6.2.2, 6.6.0, 6.9.3, 6.10.3, 6.11.0, 8.0.0, 8.1.0, 8.2.1, 8.8.1, 8.9.4, 8.11.2, 9.4.0, 10.1.0.        
remote: Resolved to version 8.11.2        
remote: Detecting npm version spec...        
remote: Using default for node 8.11.2: 5.6.0        
remote: NPM versions available on the platform are: 2.15.8, 2.15.9, 3.9.5, 3.10.3, 3.10.10, 5.0.3, 5.4.2, 5.6.0, 6.0.1.        
remote: Resolved to version 5.6.0        
remote: Running "/opt/nodejs/8.11.2/bin/node" "/opt/npm/5.6.0/node_modules/npm/bin/npm-cli.js" install --production    

问题是这最后一步占用了相当多的时间(大约 8 分钟),这不必要地占用了我的管道分钟...

有没有办法在我的 bitbucket 管道中忽略来自 git 的远程输出?

谢谢!

【问题讨论】:

  • 您是否尝试在命令后添加& 以将其分离?
  • 我试过了,虽然输出被抑制了,但它似乎也破坏了 git push...

标签: git bitbucket continuous-deployment azure-web-app-service bitbucket-pipelines


【解决方案1】:

如果要构建项目,远程输出不能忽略。

如果你不想构建项目,只想部署你的项目到azure,你可以使用部署中心 .然后你可以选择Bitbucket 或其他同步代码的工具。设置团队、存储库、分支后,选择同步进行部署。这种方式不会花费太多时间。

如果您还有其他问题,请告诉我。

【讨论】:

  • 啊,是的,太简单了!实际上,这与我当前的设置非常接近,但是在管道中构建代码之后,我将其直接推送到 azure Web 应用程序。相反,我应该将其推送到 bitbucket 存储库并让 azure webhook 将其拾取以进行部署...谢谢!
猜你喜欢
  • 2017-06-14
  • 1970-01-01
  • 1970-01-01
  • 2020-06-09
  • 2017-10-17
  • 1970-01-01
  • 2017-11-03
  • 2019-11-10
  • 2018-07-14
相关资源
最近更新 更多