CompLoop

Creats a Component Loop through all Components of an Application.

Comploop creates a Component loop through all the Component_s that make up the_Application currently on the stack.

For each iteration through the loop, DeployHub pushes the Component onto the stack. It also filters the current Endpoint list to only include those targeted Endpoints. It then executes the code in the body of the loop. When the body has finished executing, the Component is popped off the stack and the Endpoint list is restored. On the subsequent iteration, the next Component is pushed onto the stack and the Endpoint list is re-filtered before the body of the loop is executed again.

Example


// Print out the _Component_s that make up the current _Application_

comploop {

echo "_Component_ ${_Component_.name}";

// When a _Component_ is pushed onto the stack, the serverlist

// is automatically filtered – print out the _Endpoint_s to which

// this _Component_ will be deployed. (Note, there needs to be

// an _Environment_ on the stack first)

psloop {

echo "Target Server: ${server.name}";

}

}

NOTE: The order of the Components is based on the order that the Components are connected in the Application on the stack. Any Components linked in parallel will be presented consecutively during a comploop.