[英]How to deploy nodeJs app from Bitbucket to Azure
Bitbucket has from some time ago availability of Pipelines and I've been strugling, not from the Bitbucket part, but the Azure part as I can't find an easy way to deploy. Bitbucket从很早以前就可以使用管道,而我一直在苦苦挣扎,不是从Bitbucket部分开始,而是从Azure部分开始,因为我找不到一种简单的部署方法。
in my BitBucket, I have a bitbucket-pipelines.yml
with 在我的BitBucket中,我有一个bitbucket-pipelines.yml
与
image: node:8.9.4
pipelines:
default:
- step:
name: Build and test
caches:
- node
script: # install packages and run tests
- npm install
- npm test
- step:
name: Deploy to Azure
script:
- git push https://$AZURE_LOGIN:$AZURE_PASSWORD@$AZURE_APP_NAME.scm.azurewebsites.net/$AZURE_APP_NAME.git master
and all works well from BB part, issue is that the code sent to Azure, from that command line is the application source, and I can't find an easy way to tell Azure to run npm install
and I end up with Internal Server Error where a package was not found when I try to run the website after being deployed ... 一切都从BB部分正常运行,问题是从该命令行发送到Azure的代码是应用程序源,而我找不到一种简单的方法来告诉Azure运行npm install
并且最终导致内部服务器错误当我尝试在部署后运行网站时找不到软件包...
I've then created a VSTS account to configure Continuous Delivery in both parts... the option CD in Azure portal as well create a pipeline in VSTS... 然后,我创建了一个VSTS帐户,以在两个部分中配置连续交付 ... Azure门户中的选件CD以及在VSTS中创建管道...
(through Azure portal directly) (直接通过Azure门户)
(manually from VSTS) (从VSTS手动获得)
My question is simple... in order to avoid anything from Azure portal (seems to complicate at the moment, or it's just me as I'm more used to work with AWS and Heroku), is there a way to actually deploy from BitBucket automagically? 我的问题很简单...为了避免Azure门户带来任何麻烦(目前似乎很复杂,或者只是我,因为我更习惯使用AWS和Heroku),有没有一种方法可以从BitBucket实际部署自动地?
How to deploy nodeJs app from Bitbucket to Azure 如何将NodeJs应用程序从Bitbucket部署到Azure
A simple solution is to use Continuous Deployment, this link has details on how to set up, basically 一个简单的解决方案是使用持续部署,该链接详细介绍了如何设置
npm install
will run automatically 然后,Azure将构建新网站,在您的情况下(节点环境),新网站将自动运行npm install
I am not sure if you need VSTS, since I imagine that your workflow is something like this (based on my assumption of how CI works) 我不确定您是否需要VSTS,因为我认为您的工作流程是这样的(基于我对CI的工作原理的假设)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.