Let's say I have 4 agent configured in UCD(Urban Code Deloy) & component named test_component tagged to all agents.Now I need to make sure that component runs in only two agents(nodes). Can anyone tell me how to do that? Also I heard that reusable component is one of the best practice we need to follow in UCD Can anyone specify any material that I can explore.
4 Answers
Do you mean that the Components are mapped to Agents? You can actually add tags to Resources or Components. (An agent added to the Resource tree is actually a Resource that represents an Agent). You can then create an Application process with a step that is restricted to the selected Tag. More information here: https://www.ibm.com/support/knowledgecenter/SS4GSP_7.0.5/com.ibm.udeploy.doc/topics/groupingtags_tsk.html https://www.ibm.com/support/knowledgecenter/SS4GSP_7.0.5/com.ibm.udeploy.doc/topics/component_tags.html
To create reusable components, use Component Templates. You can also use Application Templates which contain Environment Templates.
For more information see:

- 36
- 1
-
Thanks for reply..... Can I use generic process when some common function identified in multiple component? Which will reduce number of components – Vishnu Jan 31 '20 at 14:16
You can use Generic processes and even call them from Component or Application processes. However if a process is used by multiple components, it might be better to create a Component Template and put that process in the template. This way, all components that inherit from that Component Template inherit the process as well. (These Component can then have other processes, that don't come from the template).
Note that the inherited process exists only once in the Component template, although you can see it in each derived Component. If you modify it from one Component, you actually modify the process in the template, so it will appear modified in all other components that inherit from the same template.

- 36
- 1
-
I need to restart/start/stop application servers for 5 nodes. Therefore I create generic process for start/stop/restart and create a single component which includes generic process. Override the component in application process. Or Do I need to create seperate component for each node from template ? – Vishnu Feb 04 '20 at 11:40
In general you don't create a separate component for each Node. A Node is represented by a Resource inside an Environment. You could have a separate Environment for each Node or multiple Nodes inside the same Environment. An application can have multiple environments. It's good practice to develop your processes so that they can be applied to any environment. For the variable parts of your processes that depend on features of the Environment, it's good to use Environment Properties. Note however that Environment properties are not visible in Generic Processes.
A better alternative to Generic processes are processes of type Operational (No version needed), which have access to Environment variables.
This describes the Component Process types: https://www.ibm.com/support/knowledgecenter/SS4GSP_7.0.4/com.ibm.udeploy.doc/topics/comp_process_types.html This describes the process types and the properties that are visible in them: https://www.ibm.com/support/knowledgecenter/SS4GSP_7.0.4/com.ibm.udeploy.doc/topics/ud_properties_avail.html

- 36
- 1
You can use the single component created as a shared across other env for deployment. But to get this done, you may need to use the concept of push. Even push is supposed to be a best practice! Let us see on how this can be done.
https://www.urbancode.com/2019/03/14/ibm-urbancode-deploy-codestation-push-or-pull/
Download the UCD client in your machine. Once you have the artifacts built, say you have an EAR, XML Files... to be deployed. Now create a folder and add all those inside the same.
Execute the below command:
Step 1:
java -jar udclient -weburl "ucd-url" -username "ucd-username" -password "ucd-password" createVersion -component "ucd-component-name" -name "VERSION_NAME"
//the above step will create a version inside the existing component in the urban code deploy
Step 2:
java -jar udclient -weburl "ucd-url" -username "ucd-username" -password "ucd-password" addVersionFiles -component "ucd-component-name" -version "VERSION_NAME" -base "FOLDER_WHICH_HAS_EAR_AML_FILES"
//the above step will promote the files from the directory in local to the version directory inside the component in the UCD
Now with the above push is done, you can either use ucd's restful way of interaction for deployment using the component and version in the payload or you can login to the ucd server directly & select the version from the component you need for deployment. Thus, with a single component you can make different versions to deploy in different servers.
You can use this in build tools like bamboo, teamcity as well - Just ensure you have the udclient file in the agent.

- 37
- 9