org.hidetake.gradle.ssh.plugin.RemoteContainerExtension.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-ssh-plugin Show documentation
Show all versions of gradle-ssh-plugin Show documentation
Gradle SSH Plugin provides remote execution and file transfer capabilities
package org.hidetake.gradle.ssh.plugin
import org.hidetake.groovy.ssh.core.Remote
/**
* An extension class of the remote container.
*
* @author hidetake.org
*/
@Category(Collection)
class RemoteContainerExtension {
/**
* Find remote hosts associated with given roles.
*
* @param remotes mixin object
* @param roles one or more roles
* @return remote hosts associated with given roles
*/
static Collection role(Collection remotes, String... roles) {
assert remotes != null
assert roles, 'At least one role must be given'
roles.collect { String role ->
remotes.findAll { it.roles.contains(role) }
}.flatten().toSet()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy