[resolved] Configuring job to run on different environments
Hi I have developed around 60 jobs which are all pointing to my DEV environment. The Input and Output components are using Property Type as "Repository". Now, I would like to execute all these jobs in STAGING and PRODUCTION environments? Please help me to understand on how can i make the same job pointing to different environment database connections depending on situation. How to configure metadatas? Best regards, Kalyan
Hi Kalyan,
Quite a pickle
....but Talend does provide for such situations
Selection 'Edit Connection' & move to step 2. Then, you can choose the below highlighted option & export your connection as contexts & propagate the change (in Property Type) to all affected jobs. Then, assign that context group to your jobs.
Once this setup is done, you can easily provide the environment specific values to the job via (projectname.properties) file & run them conveniently.
Hope this helps.
MathurM
Thank you that helps. Just wondering how do i store the password in context variable? Looks like it is encrypted by TALEND. Also please let me know if i should create metadata's for each environment or is it just sufficient if i create metadata for one environment and just change the context variables accordingly for each environment?
The step that I showed in my screen-shot will only convert the current DB connection metadata into contexts. This will also create a context group by the name of the connection (which will get applied to the jobs, once you approve for that option). Now in the connection, in place of each detail a context will be present whose value would be expected at runtime, including password. This values will be expected in the config file (projectname.properties file)
And all these objects, the job + the connection metadata + the context group, will always be bundled together whether you run your job from studio or you export it. So, NO. You would not have to create separate metadata as per environments. Just maintain (switch) diff context values in the config file as per the environment you want to run your job in.
Thanks for your reply.
Attached is the screenshot in which i have marked a black line for each context variable. Can someone please let me know how do i load values in to the context variables depending on the environment - Default, STG and PROD and from where should i load them? I am hardcoding the values for each of them but thought that might not be a good practice. Please let me know if there is any sample job which i can refer to.
There are around 60+ jobs in my studio, so should i keep loading the context variables everytime when a job runs?
Thanks
Kalyan
Hi Kalyan, I can see you have configured 3 different value sets for each of your environment. I'm interested to know, how would you switch between these at runtime? (even if manually, HOW??) MathurM
So, I have to keep only one column and load those values from a text file? But how will i load the password? It seems to be stored as an encrypted value. Should i store the encrypted value in my text file?