I have created build promotion "choice" parameter named "RUNSCRIPT" with values "No" (as default) and "Yes" and trying to get the value of parameter in EXEC SHELL command as $RUNSCRIPT but neither value "Yes" or "No" coming through. If I look at the output it comes as $RUNSCRIPT (as it is). Why is not being replaced with value. Any suggestions? Also, tried to create other type of parameters e.g. String value but its not working as well.
If you want to pass a value from jenkins to a script you need to define the parameter as jenkins environment variable. I have used Ant for this. For example :
property environment="env"
property name="user" value="${env.user}"
if I just use
property name="user" value="${user}"
the values will be passed from some other file that is referring user.
I managed to get an Approval Parameter to be passed as a Build Parameter on a downstream build (triggered by the promotion itself); you simply need to pass them on.
I learned that Approval parameters are allowed within the approval "build" so to speak, so any actions you have in that approval should be able to reference any of the Approval parameters.
This means you can have an approval parameter FOO, and then in the approval actions, if you have a "Trigger parameterized build" action, you can use a "Predefined parameters" with the text:
BAR=${FOO}
The triggered build will then have the BAR build proprerty set with the value of whatever the build was promoted with.
Related
I have an SSIS Project I want to parameterise to be able to have dev, staging, production environments.
I'm starting slowly, and I'd like to parameterise some hardcoded filepaths.
I have a foreach loop container that iterates over a directory and performs some actions on each of the files it contains.
In Visual Studio I right click and click edit. There are four tabs: General, Collection, Variable Mappings, and Expressions.
Under "Collection", there is a variable Folder. This is hardcoded currently. I'd like it to be at least a package parameter, or preferable, a project parameter followed by a suffix.
Once I've added a project parameter, how can I do this?
For this purpose, let's say I have a variable: SuperFolderLocation.
Would I change the variable Folder's destination to be #[$Project::SuperFolderLocation] + "\subdirectory"? Do I need to use expressions to calculate the variable Folder's destination? If so, what is the variable I need to set? And can you just plop a variable in the Folder destination and it will interpret it?
First thing you need to do is create the project parameter:
Then in the foreach loop container select collection and make sure that "Foreach File Enumerator" is selected in the drop down.
Click on Expressions and select "Directory" in the Property dropdown.
Click on Expression ellipsis and this will open the Expression Builder
Then select your parameter from System Variables and complete the expression by adding the subfolder.
You can also click on button Evaluate Expression to make sure the path is correctly evaluated.
I can see and I can modify the values of the project variables, but my question is ... Can I modify the value of the parameters Project.params or Package Params? I do not find that option.
For example, I create a project parameter called StopExecution of type Boolean with its value in False, and when an error occurs in one of my SSIS steps, can I change the value of the Project.param StopExecution to True?, with this functionality in my other package called Package2.dtsx, before starting its execution when I finish my first package called Package1.dtsx (both are executed for a SQL job) Can I validate if my Package2.dtsx has to be executed?
Can you help me? I can do that?
No. Project Parameters are read-only; you can specify its value at package start.
You are looking for some global parameter which you can change in child package. File, SQL table or Web service could be such global storage; you write some value to an SQL table and read it later.
There is a guideline how to use SSIS parent package variables from child package and update parent package variable from child. You can try it, but this scenario relies on variable scope hack.
I have two controls in a form.
zip code - (input type text) and city - (select options)
The back-end rest service sends json object which will contains zip codes and city names. I want to change city when zip code changed and vice versa using angularjs1. Also validate zip code with json object.
please help me...
Alright. So I am assuming that you have a serverside script from which you can get both city from pincode and pincode from city
Now you have got 2 controls in your view.
1) Input Box
2) Combobox
Now The easiest way according to me is that you should make a function that is called on ngChange event of both the controls.
That function would make a request to your server and fetch the associated data and feed the data to the other control.
Now when you populate the controls internally through the controller, it might again fire an ngChange function. So in each ngChange function you must have a reference of the desired values for them. That can be done by storing both the latest values received from server side into a local variable and checking it each time the function is called.
I believe this would solve your problem.
----------------Update----------------
As mentioned in the comment, the SPA shall not be sending request to the server during the execution. It shall simply send the json at the end.
So for that its more convenient. Simply make 2 different functions, 1 getCityFromPincode(pincode) and 2 getPincodeFromCity(city)
Now you can easily do your operations in javascript on the basis of the values that you will get from the ngChange() function.
Just call the function getCityFromPincode in the ngChange function of your CITY INPUT Control and similarly for the other one.
You would probably make it through with this approach.
How I can set exchange.getIn().getMessageId() in to variable and pass it through ContextParam in cTalendJob to my Job? I can pass String like "bla bla bla", but when I try pass variable like
`
${myVariable},
#{myVariable},
{myVariable},
$myVariable,
context.myVariable
I get error myVariable cannot be resolved a variable.
Someone knows how to do it?
You can get a variable in a job from a route with the configuration of tRouteInput.
In the tRouteInput write somethings like that:
${header.typesOfParametre.nameOfParametre}
header if you put the variable in the header...
I hope i helped you
If, like me, you didn't want to change the tRouteInput component of your job, but just set a context parameter for the job from ${myvariable} in your route, then there is a slightly ugly way of doing it.
I wanted to set the context parameter from a message header, so I created a cSetHeader component and set a header matching the context parameter name, which allows you to select the expression language and therefore in simple you can have ${header.headerName}.
In the "Advanced Settings" tab of cTalendJob, select the "Propagate Header" checkbox and this will populate any context variables that exactly match the name of the message headers.
This has worked for me, but for completeness and safety, you might want to make sure you strip any headers you don't need in case they overwrite other context variables in the Talend job.
In SSIS, i want to read data from a flat file(Flat File Source) and assign certain column values to a variable in SSIS (like IDNo). I need this ID to retrive other information like email and other details to send email dynamically later in the process.
I did some reasearch i found that Script Component is one of the way to assign values to variables, but in our environment script component is not available. Is it possible to do that if so, can some one please provide me a sample. thanks.
You don't necessarily need script component to achieve this.
Read your IDs to a recordset (that would be a variable of type Object):
Create a variable of type Object.
In Data Flow Task create a Recordset Destination.
Pick your variable in VariableName dropdown.
Create Foreach Loop Containter:
Choose Foreach ADO Enumerator in Enumerator setting.
As ADO object source variable pick your recordset variable from the dropdown list
In Variable Mappings assign your email variable with index 0
Send the emails from the loop using email variable as an expression in Send Email Task.
Why is script component not available? It'd make things easier and help to avoid some problems; I don't use mail task anymore in favour of script task, because I ran to some problems with it in the past.
Hope this helps.