Setting the context version in deb package post build

We currently have a build process in Bamboo that checks out our source code from the master branch in stash on commit and then builds a debian DEB package ready for deployment. Our deployment proces then pushes this DEB package to AWS S3 ready for installation on our verious servers.

The problem I have is that the context files, which is required when building a DEB package, requires a version number for the DEB file. This is used when installing a DEB package to determine if the DEB package has already been installed. The problem is that the release version number, as determined by the release version section of the deployment plan is generated too late in the process.

I would like to use the release version number created by the deployment process to stamp the version in the context file, but the DEB package is built at this point in the process. Again, I dont want to move the building of the package into the deployment process because we have different target environments in the deployment process, and because building the DEB package during deployment seems like the wrong place to do this.

Does anyone have any suggestions? Has anyone else used Bamboo to build and deploy DEB packages? How did you solve the context file version problem?

2 answers

0 vote

Perhaps you can get what you want using variables. Let's say you name your relases 1.0.<incremented_number>

You can define a Global variable, for the part of the release name you want to increment at deployment time and use it to generate release number during build.

You use the same variable in your version naming scheme and use autoincrement variable option.

Seems a bit clunky, especially as the release versioning part of Bamboo seems absolutely perfect, it's just that its not possible to get hold of the version number bamboo generates. If it were available as a bamboo variable I could at least unpack the deb file in the deployment phase, write the variable in to the context file then repackage everything again.

I'm begining to find a lot of the descisions made for Bamboo make life incredibly difficult. At least with Jenkins we had the flexibility to pass variables around willy-nilly!

deployment release name _is_ available during deployment phase: bamboo.deploy.release

Ah, interesting, thanks!

Still annoying that I'll have to build the deb file in the build phase , then unpack it in the deployment phase and then build it again :(

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
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,806 views 0 6
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