Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,972
Community Members
 
Community Events
168
Community Groups

Deployment of same artifact to different environements

Hi All

Just wondering if anyone can give me some ideas on solving an issue we currently have with our Bamboo builds and subsequent deployments.

We have a single .Net website project that needs to be deployed in a couple of "flavours". 

  1. the main production instance
  2. a demo instance
  3. a training instance

Each of these instances have a slightly different configuration.

At the moment, when we run a release build the project esssentially gets built three times, once for each instance, which generates three seperate artifacts. This process chews up quite a lot of build time, and vastly increase the space used for build/artifact storage.

Is it possible to have the build generate a single artifact, and then in a post-build task, or pre-deployment task, make the necessary configuration changes for each instance?

 

Cheers

Phil

2 answers

1 accepted

0 votes
Answer accepted
Jimmy Seddon Community Leader Aug 10, 2020

Hi Phil,

Welcome to the Community!

At a high level you have already described exactly what needs to be done.  The question that I feel needs to be asked at this point is "what" is different configuration-wise between the three artifacts.  I know for some of our older .net websites, we are storing configuration changes per environment in a separate repository and we are using powershell scripts to replace environment specific configuration settings in the app.config and web.config files ahead of deploying to the selected environment.  Not sure if that suggestion will be helpful or not.

Good Luck!

-Jimmy

@Jimmy Seddon yes, I think it's just the configs that are being transformed as part of the build.

The thing I'm trying to solve is not building the same project over and over again.

Sorry, I'm not very clear on the build options available in Bamboo. Could we have seperate build that does the config transforms and outputs those as different artifacts? Then bring the main build artifact and the config build artifact together in a deployment plan?

 

Cheers

Phil

Jimmy Seddon Community Leader Aug 10, 2020

Hey @Phil Carter,

Ok let me try to explain what we are doing a little more clearly.  I want to preface this with what we are doing is not pretty but it works and we haven't found a better way ourselves.  We only build the .Net website once with values for the development environment, and save that as our built artifact.

Then, we have a deployment project with QA, Staging and Production environments.  When we execute one of those environments from our deployment project in Bamboo it does the following:

1. Downloads the artifact from the build plan (which contains dev values from our single build)

2. Checks out our configuration repository that contains all config values for all environments.

3. Run a PowerShell script that based on the environment we are executing does XML find & Replace to update the development values to what they should be set to for the environment we are executing.

4. Deploy the website to the correct servers.

 

So we are in fact only building it once.  We aren't using proper web.config transforms to map the configurations at build time we are doing it using a Powershell script at deployment time.

I hope that makes more sense for you.

-Jimmy

@Jimmy Seddon yep, that makes sense and will give me something to work on.

 

Cheers

Phil

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 9.0 is now available

Hey there, Data Center community! I'm Martyna Wojtas and I am the Product Manager for Bamboo Data Center. I’m excited to share that Bamboo 9.0 is now available. We purpose-built this platform to help...

310 views 0 7
Read article

Atlassian Community Events