Page 1 of 1

Derive the host name and project name dynamically

Posted: Wed Apr 01, 2015 9:39 am
by syang@collaborative.com
Hi guys,

I move Sequencer jobs from a Development ,to a Test, and to a Production environment constantly and sometimes forget to change the host name parameter.

I was wondering if there is a way to get the host name and project name dynamically in a Sequencer job?

Thanks.

Posted: Wed Apr 01, 2015 11:11 am
by PaulVL
Well... not really sure why you want project name dynamically since it is typically required BEFORE you actually execute a job (as it is a required parameter to kick that sequencer off to begon with). Unless you are using the built in job scheduler of course.

as for hostname... try opening an execute stage and using the hostname shell command. trap that output.

Posted: Wed Apr 01, 2015 12:15 pm
by qt_ky
It seems like if you right click in any expression editor and choose DS Macro, there is one for project name.

Posted: Wed Apr 01, 2015 1:08 pm
by AshishDevassy
If I understand correctly -

You have a sequencer and one of the parameter variable you use is for hostname. And you want to avoid typing in Hostname again and again.

If that is the case I would suggest using Parameter set Value files then. you can create 3 value files (one for each environment Dev / test / prod ) With each value file containing the hostname of that env.
So when you run you can chose from a drop down box.

Posted: Wed Apr 01, 2015 2:57 pm
by ray.wurlod
There's no such thing as a Sequencer job. It's a Sequence job. A Sequencer is a component that can be used in a Sequence job.

Posted: Wed Apr 01, 2015 3:08 pm
by syang@collaborative.com
Hi AshishDevassy,

I have also considered this, but I wanted to know if there were any other way to get the host name dynamically. Because the host name parameter is hard coded into every directory parameter, this would require me to change every job that uses a directory parameter.

Thanks for your input. I will look into it.

Posted: Wed Apr 01, 2015 4:01 pm
by PaulVL
Because the host name parameter is hard coded into every directory parameter, this would require me to change every job that uses a directory parameter.
What???

Your directories have the hostnames in them???

IE: I'm executing my code on host mydevbox and you have a path coded as such:

/dev/mydevbox/data/something

?