# How can I ensure one configuration finishes before another starts?

**URL:** https://www.finalbuilder.com/forums/t/how-can-i-ensure-one-configuration-finishes-before-another-starts/5479
**Category:** Discussion
**Created:** [May 9, 2016, 11:22am UTC](https://www.finalbuilder.com/forums/t/how-can-i-ensure-one-configuration-finishes-before-another-starts/5479 "2016-05-09T11:22:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![gastelllo](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/g/47e85d/32.png) [@gastelllo](https://www.finalbuilder.com/forums/u/gastelllo)
#### Post date: [May 9, 2016, 11:22am UTC](https://www.finalbuilder.com/forums/t/how-can-i-ensure-one-configuration-finishes-before-another-starts/5479/1 "2016-05-09T11:22:35Z")

</div>

I screwed up my buildserer and upgraded recently and have started over from scratch. &nbsp;However I now have a serious problem.  
  
I have several configurations, and when one starts, I want it run until it finishes with a success or failure. &nbsp;I don’t want another configuration to start, because each configuration uses a common directory for deployment. &nbsp;  
  
What I’ve noticed happening is when config A runs a stage, and config B is awaiting a license, &nbsp;when a stage finishes on config A (but the script hasn’t finished) config B starts and then config A waits.  
  
Is there a way to allow only one configuration to run at a time and let the others queue up?

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [May 10, 2016, 1:33am UTC](https://www.finalbuilder.com/forums/t/how-can-i-ensure-one-configuration-finishes-before-another-starts/5479/2 "2016-05-10T01:33:08Z")

</div>

Hi Mike,  
  
You can use [shared resources](http://wiki.finalbuilder.com/display/continua/Shared+Resources)to restrict the number of builds from one configuration&nbsp;(or multiple&nbsp;configurations) that run concurrently. For your scenario, you can create a [server shared resource](http://wiki.finalbuilder.com/display/continua/Creating+and+Editing+Shared+Resources)&nbsp;with type Single&nbsp;and set each configuration to require a l[ock on this shared resource](http://wiki.finalbuilder.com/display/continua/Defining+Shared+Resource+Locks) in the configuration conditions. Builds will hold on to this lock for the duration of the build. Other builds will wait in the queue for this lock to be released.

---

<div class="post-metadata">

### Author: ![gastelllo](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/g/47e85d/32.png) [@gastelllo](https://www.finalbuilder.com/forums/u/gastelllo)
#### Post date: [May 11, 2016, 5:51am UTC](https://www.finalbuilder.com/forums/t/how-can-i-ensure-one-configuration-finishes-before-another-starts/5479/3 "2016-05-11T05:51:53Z")

</div>

I’ll keep that in mind for the future. &nbsp;What I did was get rid of all of my stages. &nbsp;Kind of a hack, but I’ve noticed that my build times have decreased dramatically.

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [May 12, 2016, 2:32am UTC](https://www.finalbuilder.com/forums/t/how-can-i-ensure-one-configuration-finishes-before-another-starts/5479/4 "2016-05-12T02:32:16Z")

</div>

Hi Mike,  
  
This will not completely prevent concurrency issues with your deployment folder - if the build A starts before the build B, but build A takes longer to run to the deployment action than build B, then build B may access the common deployment directory before build A.   
  
We recommend using a separate deployment folder for each build by specified a unique value in the folder name e.g. $Build.BuildNumber$ or $Build.Version$ or using shared resource locks to prevent builds or stages accessing a common folder from running concurrently.  
  
&nbsp;  
  
  
&nbsp;
