Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

how to deploy to environment group

Highlighted
Deepali Gupta
Super Collector

how to deploy to environment group

On workflow step, I have mentioned Source environment and Destination Environment group.

Now in object commands that are executed on this WF step, I will fire follwing command:
//
ksc_local_exec scp [SOURCE_ENV.SERVER_USERNAME]@[SOURCE_ENV.SERVER_NAME]:[SOURCE_ENV.SERVER_BASE_PATH]/[PKGL.VP.HIT_OT_INT_ENVTYPE]/[PKGL.VP.HIT_OT_APPLICATION]/[PKG.UD.HIT_RFC]-[PKGL.VP.HIT_OT_LABEL]/[PKGL.P.HIT_OT_APPLICATION]-[PKGL.VP.HIT_OT_LABEL].tar [DEST_ENV.SERVER_USERNAME]@[DEST_ENV.SERVER_NAME]:[DEST_ENV.SERVER_BASE_PATH]
//

This works successfully. It copies the file from source env to all the envs configured in environment group.

BUT my destination env group is dynamic - value can be resolved using tokens. Therefore I cannot define destination env group in workflow step field.

I tried following commands for this however it does not work:
//
ksc_connect_env_group_dest_server DEST_ENV_GROUP_NAME = "BRAND_INT1_ENVGRP"
scp [SOURCE_ENV.SERVER_USERNAME]@[SOURCE_ENV.SERVER_NAME]:[SOURCE_ENV.SERVER_BASE_PATH]/[PKGL.VP.HIT_OT_INT_ENVTYPE]/[PKGL.VP.HIT_OT_APPLICATION]/[PKG.UD.HIT_RFC]-[PKGL.VP.HIT_OT_LABEL]/[PKGL.P.HIT_OT_APPLICATION]-[PKGL.VP.HIT_OT_LABEL].tar [DEST_ENV.SERVER_USERNAME]@[DEST_ENV.SERVER_NAME]:[DEST_ENV.SERVER_BASE_PATH]
ksc_exit
//

It does not even shows any error logs.

HAs anybody faced same issue?
Can someone tell me commands to connect to dynamic env group & to copy files to dynamic env group.

Thanks
Deepali
2 REPLIES
Surendra Poosar
Frequent Visitor

Re: how to deploy to environment group

Deepali,

The command you have pasted looks a little confusing.

ksc_connect commands are just used to connect to the source/destination environment.

In you command you are trying to do an scp within the same command

ksc_connect_env_group_dest_server DEST_ENV_GROUP_NAME = "BRAND_INT1_ENVGRP"
scp [SOURCE_ENV.SERVER_USERNAME]@
[SOURCE_ENV.SERVER_NAME]............

so PPM is not able to parse the commands and may throw a "Command Execution Error" without a log


may be you need to first connect to the ENV group, then do an scp command using the ksc_local_exec

ksc_connect_env_group_dest_server DEST_ENV_GROUP_NAME = "BRAND_INT1_ENVGRP"

ksc_local_exec scp [SOURCE_ENV.SERVER_USERNAME]@
[SOURCE_ENV.SERVER_NAME]............


Let me know if it works.

Thanks
Surendra
Deepali Gupta
Super Collector

Re: how to deploy to environment group

Hi Surendra,
Thanks for the reply.
I believe ksc_local_exec command is used when we are executing the commands from ppm itself (without connecting to the target host).

On a different workflow step, wherein i was deploying to a single environment (source & dest env defined on WF step),I used following commands to connect which worked fine:
//////
ksc_connect_dest_server

cd [DEST_ENV.SERVER_BASE_PATH]/[PKGL.VP.HIT_OT_INT_ENVTYPE]/[PKGL.VP.HIT_OT_APPLICATION]/[PKG.UD.HIT_RFC]-[PKGL.VP.HIT_OT_LABEL]
if [ ! -f [PKGL.P.HIT_OT_APPLICATION]-[PKGL.VP.HIT_OT_LABEL].tar ]; then echo "PROMOTING TO RELEASE MGMT SERVER...." ; scp [SOURCE_ENV="[PKGL.P.HIT_OT_BUILDSERVER]".SERVER_USERNAME]@[SOURCE_ENV="[PKGL.P.HIT_OT_BUILDSERVER]".SERVER_NAME]:[SOURCE_ENV="[PKGL.P.HIT_OT_BUILDSERVER]".SERVER_BASE_PATH]/release/*[PKGL.P.HIT_OT_APPLICATION]-[PKGL.VP.HIT_OT_LABEL].* [DEST_ENV.SERVER_USERNAME]@[DEST_ENV.SERVER_NAME]:[DEST_ENV.SERVER_BASE_PATH]/[PKGL.VP.HIT_OT_INT_ENVTYPE]/[PKGL.VP.HIT_OT_APPLICATION]/[PKG.UD.HIT_RFC]-[PKGL.VP.HIT_OT_LABEL] ; else echo "BUILD EXISTS ON RELEASE MGMT SERVER...NO NEED TO PROMOTE! " ; fi

ksc_exit
/////

Thanks
Deepali
//Add this to "OnDomLoad" event