Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
satyavar
Contributor III
Contributor III

[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
Labels (2)
18 Replies
Anonymous
Not applicable

Hi Kalyan,
Quite a pickle 0683p000009MACn.png....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. 0683p000009MACn.png
MathurM
0683p000009MB9C.png
satyavar
Contributor III
Contributor III
Author

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?
Anonymous
Not applicable

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)
Anonymous
Not applicable

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.
satyavar
Contributor III
Contributor III
Author

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
0683p000009MBZJ.png
Anonymous
Not applicable

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
satyavar
Contributor III
Contributor III
Author

0683p000009MPcz.png
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?
satyavar
Contributor III
Contributor III
Author

I do not have access to create a metadata for Staging and PROD, so i cannot extract the metadata as a context for these 2 environments.
Anonymous
Not applicable

Nah, I just wanted to know that how are you planning to switch between the 3 sets (if at all, u had planned for that)