Suppose we have a build project which takes a list member as a parameter.
Can I make another build which could run the first project with all parameters from list sequentially?
If I understand you correctly you want to reliably trigger multiple builds of type A based on a list you pass to build B.
What you could do is have B parse the list (using powershell or whatever else custom program you want to use) and then use the TeamCity REST API to trigger builds of type A with the right parameters, the syntax described here would apply to this:
To trigger a build with custom parameters (system properties and
environment variables), use:
http://testuser:testpassword#teamcity.jetbrains.com/httpAuth/action.html?add2Queue=bt10&name=&value=&name=&value=
This allows you to pass the parameters you need for each build.
Related
In my project I've got some internal config structures containing options registration using default values (let's say Config.x=0, Config.y=0), those values are not modifable for a client.
Sometimes users of my application want to modify default values of those fields before parsing command line arguments, so before parsing they just change those values manually (let's say Config.x=3, Config.y=4) and then fetch command-line/.ini ifle options and parse it using parseOptions.
If those external arguments contain only a part of those options i.e. Config.x=9, values of other options will be those which are registered using boost::program_options, not those currently assigned, so the result would be Config.x=9, Config.y=0 instead of Config.x=9, Config.y=4. So basically it seems that, boost::program_options::parseOptions clears all options before parsing.
Is there anyway to prevent boost from clearing already assigned options in case they do not appear in command-line arguments?
This can't be done. However, you should be able to create parsed_options either manually¹, or you can supply the options as a "faux" configfile so you can actually use the configfile parser on it.
Once you have the parsed_options you can store/notify them as usual.
¹ though this isn't supported/documented, see the comment at boost::program_option::basic_parsed_options<>
In Teamcity 9.*
I have a Build Template with some Configuration parameters that will be different depending on the project that will be created from it.
This parameter is important and must be entered during creation otherwise the build will not work. So my question is:
Is there a way to configure this parameter as Mandatory during Build Creation Dialog?
Teamcity actually has the Name field as mandatory.
I tried to define the parameter as "Text" and with validator "Not Empty". Also using the REGEX but without success. This kind of validator seems to work only running the Custom Builds.
No, unfortunately there is no way to achieve this.
The only way to see this is by looking at your parameters after you've created a build configuration from a template and this will show the required parameters (i.e. they are referenced in build steps / other variables somewhere)
Here you can see a configuration based on a template. The values aren't set in the template or at the point of creating the build configuration
If you fail to supply any of these values, then your build will sit in the build queue and the error message will be "unable to run on any agents due to missing parameter values"
I am using the flexible publish plugin for jenkins and found it very useful. My goal is to pass a set of predefined parameters from a job to trigger another downstream job. The downstream job performs an action based on the string match evaluation. But if i dont pass the parameters the job would fail saying
Exception caught evaluating condition: [org.jenkinsci.plugins.tokenmacro.MacroEvaluationException: Unrecognized macro 'multinodeind' in '${multinodeind}'], action = [Fail the build]
I want to do an if else flow. If the parameter is present evaluate it and proceed. Otherwise perform another action. Any clue?
You know you can add parameters with default values under Meta Data → ☑ This build is parameterized → Add parameter, do you? The default values are supposed to be taken if a value for a parameter isn't passed, IIRC.
However, you can use the Conditional BuildStep Plugin in the project configuration's Build section:
A buildstep wrapping any number of other buildsteps, controlling their execution based on a defined condition.
I have several Jenkins parameterized jobs that uses the same parameters and parameters values.
When I have to change the default value of one of those parameters, I need to go over all of those jobs and reconfigure them.
A simple solution to this problem would be an option to retrieve all parameters from config file (in the master/ in the workspace) but I could not find a sufficient implementation for that.
I want to be able to feed build with standard Java config file (in format "key"="value") and then refer to those parameters like every other parameters during the build.
Do you know of an appropriate solution?
Use EnvInject Plugin to read your parameters from a file as environment variables in an Inject Environment Variables build step. The glitch is that then you can't override them easily. One solution would be to use it in conjunction with the Conditional BuildStep Plugin. You can then can define a boolean parameter OVERRIDE that would be false by default. You can then run your Inject build step conditionally only when OVERRIDE is false. When you need to override your parameters with values provided by hand (on in a custom call to run the job) specify the override values and set OVERRIDE to true.
I use hudson with ant and set parameters (customer) in my hudson job. This parameter is then the name of a property file that i open with ant as follow:
<loadproperties> srcFile="${project.dir}/build/resources/${customer}.properties"/>
I'm creating a DB web application with grails for my company and found myself in the need to change the default scaffolding templates.
So far so good, everything gets generated with the modified templates (controllers, views, ..).
Now, however, I get a request to create some "composite screens" with functionalities and a layout that differ from the overwritten templates.
So now my question is: is it possible in grails to create one or more templates (next the the default one) and pass this template name as an argument to the generate-* commands?
Thanks in advance!
EDIT: Adding the template name to the generate commands was just an idea, if it's possible to do this a different way, I'll be happy too.
Grails commands are scripts in grails/scripts. If you follow its logic you will see two things.
1) There is only one parameter passed to the script → domain.
2) Class for generating views is DefaultGrailsTemplateGenerator. You can analyse sourcecode and check what this class offers.
Update
Link to DefaultGrailsTemplateGenerator in GitHub.
I am not sure about the generate command parameters, but if you add another .gsp page into scaffolding directory, I believe it will try to run it through generation process.
So for example I used to have a show.gsp page as well as showBasic.gsp page, which showed fewer properties.