Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Deployment of same artifact to different environements

Phil Carter August 10, 2020

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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 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

0 votes
Phil Carter August 10, 2020

@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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 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

Phil Carter August 10, 2020

@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
AUG Leaders

Atlassian Community Events