Comploop creates a Component loop through all the Components 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 Components 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 Endpoints 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.