Feature Request: Setting a stage as a "template"

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.

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.

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

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

Posted By TheBigSot 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) 

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

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. 

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;