Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Continuous deployment to Azure using Bamboo

I'm working with Atlassian Bamboo on Demand for Continuous Integration and it works great.

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.

Has anyone achieved this?

like image 791
Subgurim Avatar asked Oct 20 '22 15:10

Subgurim


1 Answers

I do automated deployments to AWS from bamboo, but the concept is pretty much the same.

Bamboo has no specific options for deploying to the public cloud, so you have to build or call an existing deployment tool. 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. The deployment engine is basically a cut down version of the CI engine with a subset of tasks.

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.

I'm assuming you are running a bamboo agent on a windows image like me. So powershell scripts are your friend . If you're running in linux you'll want to do the same with bash.

I have a powershell scripts controlling my deployments through a controller/agent model.

The controller script is source controlled and maintained in 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. The agent is setup when an app server instance is provisioned in ec2. We use puppet for server provisioning.

The controller does the following for a deployment

  • connects to the vpc
  • determines the available nodes in my web farm using ec2
  • selects the first node and sends the node an "upgrade database" command
  • 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.

DEV is deployed automatically, test, staging and prod are all manual click deploys which are locked down to specific users.

One option I considered but did not invest the time to look at as aws elastic beanstalk as a deployment tool. It has a rich api for deploys. On the Azure side it looks like web deploy supports deployment to Azure IIS sites.

like image 194
Avner Avatar answered Oct 27 '22 07:10

Avner