Using Bamboo with PHP

I have a simple PHP project that requires no building or compiling. I keep all code in Bitbucket server. All I want bamboo to do is check out the code then send it up to the codedeploy module. Sounds incredibly simple but I can't seem to figure out how to get bamboo to do this.

In Bamboo I created a project (lets call it project1) with a plan (call it plan1). This plan looks at a GIT repo (Bitbucket server) with 3 branches (lets call the branches dev, stage, prod). For the build it really shouldn't have to do anything. I'm not compling code or running any unit tests (at least not yet). But bamboo complains if you don't do something so I just do a simple checkout code step. Which works fine and the build is successful.

Now I need to deploy the code to codedeploy. So in bamboo I create a new deployment project (lets call deploy1) looking at the project1->plan1. So far so good. I set up some environments dev, stage, prod. In the dev environment all I want it to do is check out the code and then package up the code to s3. So I thought simply making the task to be checkout code then the codedeploy module would be what I need. However, the checkout code only checks out the "default" branch which is set to prod not dev. This just seems wrong that I cant tell bamboo to use the branch that triggered the build. Is there something I'm missing here? I've set the trigger in the environment to be after successful build looking at the dev branch, but bamboo in the checkout I can see it changing the branch back to prod then deploying the code to S3. So its not an issue with it connecting to S3 as it does dump the zip into my s3 bucket and codedeploy kicks off its bamboo packaged up the wrong branch.

I've also tried making shared artifacts with a pattern of ** to basically say everything and in the build process but bamboo errors saying it failed tests yet I don't have any?

So what is the simple way to checkout code and slam it into the S3 codedeploy module? I can trick it by making 3 repos such as repo1-dev, repo1-stage, repo1-prod but there has to be a cleaner way to do this? Any help would be appreciated.

We are running bamboo on site (5.10.3 build 51020) Bitbucket server (v4.3.2)

 

Thanks!

1 answer

Sounds to me like you have 3 "environments" that you want to deploy, and each of them are managed by changes to 3 respective environments.  I can think of two of ways to do this:

  1. Have 3 "build plans" that are based on each branch, and have 3 deployments that are triggered off those branches.
  2. Have 1 build plan, and enable branching, enabling branches for "dev" "stage" and "prod", then have 3 deployment plans, specifying each branch as the base for those deployments.

 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,361 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you