# Feature Request: Setting a stage as a "template"

**URL:** https://www.finalbuilder.com/forums/t/feature-request-setting-a-stage-as-a-template/5129
**Category:** Feature Requests
**Created:** [December 11, 2013, 2:16am UTC](https://www.finalbuilder.com/forums/t/feature-request-setting-a-stage-as-a-template/5129 "2013-12-11T02:16:35Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sgjennings](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sgjennings/32/141_2.png) [@sgjennings](https://www.finalbuilder.com/forums/u/sgjennings)
#### Post date: [December 11, 2013, 2:16am UTC](https://www.finalbuilder.com/forums/t/feature-request-setting-a-stage-as-a-template/5129/1 "2013-12-11T02:16:35Z")

</div>

Our builds are pipelines that flow through stages "compile", "integration testing", "deploy to development environment", "deploy to staging environment", and "deploy to production environment". The deploys to the three different environments are more-or-less identical except for server names.

However, in Continua, we have to have three separate copies of the stage each with only minor changes from the others. Anytime the build process changes, we have to change it in three places, being sure to not typo and remembering to update the different server names properly for each stage.

It would be great if we could build a "template" stage, where we can supply a few parameters and run the stage with those values. Either the template would know what parameters it required, or we could be expected to set variables to whatever values we want then simply run the template as-is, and it will evaluate all the variables as it runs.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [December 11, 2013, 3:00am UTC](https://www.finalbuilder.com/forums/t/feature-request-setting-a-stage-as-a-template/5129/2 "2013-12-11T03:00:32Z")

</div>

Hi Stephen   
  
 This feature is on our radar, we’ve been wanting it ourselves! It’s not a small feature to implement, so I can’t give an estimate as to when it will be available, but it is high on the todo list.

---

<div class="post-metadata">

### Author: ![sgjennings](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sgjennings/32/141_2.png) [@sgjennings](https://www.finalbuilder.com/forums/u/sgjennings)
#### Post date: [December 11, 2013, 3:01am UTC](https://www.finalbuilder.com/forums/t/feature-request-setting-a-stage-as-a-template/5129/3 "2013-12-11T03:01:51Z")

</div>

Good to hear, thanks. I figured you probably already had it in your list, just throwing in my vote for it.

---

<div class="post-metadata">

### Author: ![thebigsot](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/ecc23a/32.png) [@thebigsot](https://www.finalbuilder.com/forums/u/thebigsot)
#### Post date: [September 28, 2015, 4:40am UTC](https://www.finalbuilder.com/forums/t/feature-request-setting-a-stage-as-a-template/5129/4 "2015-09-28T04:40:54Z")

</div>

If I wanted to do this in SQL, could you provide us some guidelines on what tables we should use, and what to take into considerations?   
  
 \* Also it can be an action that points to the template, that way we can put something like   
  
 Actions:   
 [Template1]   
 [Template2]   
 Delete files (only for production build)   
  
 Anyways thanks for such a great tool

---

<div class="post-metadata">

### Author: ![thebigsot](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/ecc23a/32.png) [@thebigsot](https://www.finalbuilder.com/forums/u/thebigsot)
#### Post date: [September 28, 2015, 4:42am UTC](https://www.finalbuilder.com/forums/t/feature-request-setting-a-stage-as-a-template/5129/5 "2015-09-28T04:42:57Z")

</div>

> Posted By [TheBigSot](https://www.finalbuilder.com/user-profile/userid/19326) on 28 Sep 2015 09:40 AM  
> \* Also it can be an action that points to the template, that way we can put something like   
>   
> Actions:   
> [Template1]   
> [Template2]   
> Delete files (only for production build)&nbsp;

  
\*\*\*\* Here I'm just trying to add to the feature request. \*\*\*\*

---

<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: [September 29, 2015, 3:52am UTC](https://www.finalbuilder.com/forums/t/feature-request-setting-a-stage-as-a-template/5129/6 "2015-09-29T03:52:17Z")

</div>

Hi TheBigSot,  
  
We don’t recommend making any direct changes to the database. If you feel you have sufficient knowledge of databases and do decide to make changes, please ensure that the ContinuaCI Server service is shutdown and that you backup the database before running the SQL commands. Continua uses caching so direct database changes will not be picked up by the running application and any subsequent saves in Continua may cause unexpected issues. Note that we cannot provide support for direct database changes or take responsibility for any data loss as a result of changes to the database.  
  
There are currently no template tables. The stages definitions are in the table builds\_stagedefinition - the actions are stored as JSON in the field “actions”. Each time changes are made to stage workflow in Continua a new stage definition is created and linked to a new configuration version (in builds\_configurationversion). The stage definition associated with the latest configuration version (with the highest version number) is always displayed and used by builds in Continua.  
  
e.g.&nbsp;

`SELECT` `*`

`FROM` `builds_stagedefinition sd`

`INNER` `JOIN` `builds_configurationversion cv ``on` `sd.configurationversionid =  cv.id`

`INNER` `JOIN` `builds_configuration c ``on` `cv.configurationid = c.id`

`WHERE` `c.``Name` `= ``'C1’`

`AND` `cv.version = `

`(``SELECT` `MAX``(version) ``FROM` `builds_configurationversion ``WHERE` `configurationid = c.id ``GROUP` `BY` `configurationid)`

`ORDER` `BY` `sd.stageorder;`
