简体   繁体   English

使用Bamboo持续部署到Azure

[英]Continuous deployment to Azure using Bamboo

I'm working with Atlassian Bamboo on Demand for Continuous Integration and it works great. 我正在使用Atlassian Bamboo on Demand进行持续集成,效果很好。

Now I'm trying to use the "Deploy" feature and the problem is that I'm working with Azure (ftp, publish, git, mercurial... I really don't care how) and I can't find a "task" which could perform it. 现在我正在尝试使用“部署”功能,问题是我正在使用Azure(ftp,发布,git,mercurial ......我真的不在乎怎么样)而且我找不到“任务“可以执行它。

Has anyone achieved this? 有没有人实现过这个?

I do automated deployments to AWS from bamboo, but the concept is pretty much the same. 我从Bamboo自动部署到AWS,但概念几乎相同。

Bamboo has no specific options for deploying to the public cloud, so you have to build or call an existing deployment tool. Bamboo没有用于部署到公共云的特定选项,因此您必须构建或调用现有的部署工具。 At the end of the day bamboo deployments provide you with meta-data over which build has been deployed to which environment, and security over who can do deploys, but its up to you have to make the actual deploy work. 在一天结束时,竹子部署为您提供了元数据,在这些元数据上,构建已部署到哪个环境,以及谁可以进行部署的安全性,但是您必须使实际部署工作。 Bamboo does give you a totally extensible engine for controlling the "how" via scripting. Bamboo确实为您提供了一个完全可扩展的引擎,用于通过脚本来控制“如何”。 The deployment engine is basically a cut down version of the CI engine with a subset of tasks. 部署引擎基本上是具有任务子集的CI引擎的缩减版本。

I resolved to build our deployment tooling due to it being fairly simple to get started and a worthwhile investment in time because this will be used often and improved over time. 我决定构建我们的部署工具,因为它很容易上手并且值得及时投资,因为这将经常使用并随着时间的推移而得到改进。 Bamboo gives me authorization and access control, and my scripts give me fine grained control of my deployments. Bamboo为我提供了授权和访问控制,我的脚本让我对我的部署进行了细致的控制。

I'm assuming you are running a bamboo agent on a windows image like me. 我假设你在像我这样的Windows图像上运行竹代理。 So powershell scripts are your friend . 所以powershell 脚本是你的朋友。 If you're running in linux you'll want to do the same with bash. 如果你在linux上运行,你会想要用bash做同样的事情。

I have a powershell scripts controlling my deployments through a controller/agent model. 我有一个PowerShell脚本通过控制器/代理模型控制我的部署。

The controller script is source controlled and maintained in mercurial repo. 控制器脚本由源控制并在mercurial repo中维护。 This is pulled by the repository task. 这是由存储库任务提取的。

The agent is a powershell script wrapped by a simple webapi rest service with a custom authentication mechanism. 代理程序是一个由简单的webapi休息服务包含的PowerShell脚本,该服务具有自定义身份验证机制。 The agent is setup when an app server instance is provisioned in ec2. 在ec2中配置应用服务器实例时,将设置代理。 We use puppet for server provisioning. 我们使用puppet进行服务器配置。

The controller does the following for a deployment 控制器执行以下部署

  • connects to the vpc 连接到vpc
  • determines the available nodes in my web farm using ec2 使用ec2确定我的Web场中的可用节点
  • selects the first node and sends the node an "upgrade database" command 选择第一个节点并向节点发送“upgrade database”命令
  • then proceeds to send "upgrade app server" command to each node 然后继续向每个节点发送“升级应用服务器”命令

The logic for doing the deploy is parameterized so it can be re-used for deployment to different environment. 执行部署的逻辑已参数化,因此可以重新用于部署到不同的环境。 I use bamboo deploy variables to manage feeding parameters for the different environments. 我使用bamboo deploy变量来管理不同环境的馈送参数。

DEV is deployed automatically, test, staging and prod are all manual click deploys which are locked down to specific users. DEV是自动部署的,测试,登台和prod都是锁定到特定用户的手动点击部署。

One option I considered but did not invest the time to look at as aws elastic beanstalk as a deployment tool. 我考虑过的一个选项,但没有花时间将aws 弹性beanstalk视为部署工具。 It has a rich api for deploys. 它具有丰富的api用于部署。 On the Azure side it looks like web deploy supports deployment to Azure IIS sites. 在Azure方面,看起来Web部署支持部署到Azure IIS站点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM