Six Stars

set context variables based on environment

Since I am a Talend newbie, my apologies if this has been address already.

 

So, we have created a couple of content groups to store context variables for database connection, file path, etc.

 

Now, when we deploy and run these jobs to various environments (DEV, TEST, PROD), how do the jobs which which environment it's running on? Do we need to define DEV, TEST, PROD using some sort of environment variable in each environment?

 

Thanks.

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Employee

Re: set context variables based on environment

You select the right context when you create the task in TAC.  It is the context option when you create a task in TAC. The context will list DEV, TEST, PROD as per what you have specified in the Studio when defining your context groups.  Selecting the context means the job will be executed with the default values you specified in the studio for that context.  You can still override specific context variables in the TAC.

4 REPLIES
Nine Stars TRF
Nine Stars

Re: set context variables based on environment

Look at the script file you used to lauch the job, it contains something like "--context=default" (not sure how it is exactly but this is the idea).
So, you can change the command line with the context you want to use or just copy the XXX.properties file (here again, check the filename) to default.properties file (replace XXX by the context name you want to use).
You got it?

TRF
Six Stars

Re: set context variables based on environment

I get the gist, but I am not sure what script file you are referring to. I launch the jobs using TAC - so, is there a config file in TAC that I can update?

Nine Stars TRF
Nine Stars

Re: set context variables based on environment

I was speaking about Community version. Using TAC, as I remember, you select the context to use when you create the task or maybe when you deploy the job. Sorry, can't try be myself as I don't have access to the Enterprise version at the moment.

TRF
Employee

Re: set context variables based on environment

You select the right context when you create the task in TAC.  It is the context option when you create a task in TAC. The context will list DEV, TEST, PROD as per what you have specified in the Studio when defining your context groups.  Selecting the context means the job will be executed with the default values you specified in the studio for that context.  You can still override specific context variables in the TAC.