Sshoogr Gradle Plugin

A Gradle plugin for working with remote SSH servers

License

License

Categories

Categories

Gradle Build Tools
GroupId

GroupId

com.aestasit.infrastructure.sshoogr
ArtifactId

ArtifactId

sshoogr-gradle
Last Version

Last Version

0.9.20
Release Date

Release Date

Type

Type

jar
Description

Description

Sshoogr Gradle Plugin
A Gradle plugin for working with remote SSH servers
Project URL

Project URL

https://github.com/aestasit/sshoogr-gradle
Source Code Management

Source Code Management

https://github.com/aestasit/sshoogr-gradle.git

Download sshoogr-gradle

How to add to project

<!-- https://jarcasting.com/artifacts/com.aestasit.infrastructure.sshoogr/sshoogr-gradle/ -->
<dependency>
    <groupId>com.aestasit.infrastructure.sshoogr</groupId>
    <artifactId>sshoogr-gradle</artifactId>
    <version>0.9.20</version>
</dependency>
// https://jarcasting.com/artifacts/com.aestasit.infrastructure.sshoogr/sshoogr-gradle/
implementation 'com.aestasit.infrastructure.sshoogr:sshoogr-gradle:0.9.20'
// https://jarcasting.com/artifacts/com.aestasit.infrastructure.sshoogr/sshoogr-gradle/
implementation ("com.aestasit.infrastructure.sshoogr:sshoogr-gradle:0.9.20")
'com.aestasit.infrastructure.sshoogr:sshoogr-gradle:jar:0.9.20'
<dependency org="com.aestasit.infrastructure.sshoogr" name="sshoogr-gradle" rev="0.9.20">
  <artifact name="sshoogr-gradle" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.aestasit.infrastructure.sshoogr', module='sshoogr-gradle', version='0.9.20')
)
libraryDependencies += "com.aestasit.infrastructure.sshoogr" % "sshoogr-gradle" % "0.9.20"
[com.aestasit.infrastructure.sshoogr/sshoogr-gradle "0.9.20"]

Dependencies

compile (4)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.26
org.slf4j : jcl-over-slf4j jar 1.7.26
ch.qos.logback : logback-classic jar 1.2.3
com.aestasit.infrastructure.sshoogr : sshoogr jar 0.9.18

Project Modules

There are no modules declared in this project.

sshoogr-gradle

Overview

The sshoogr-gradle is a Gradle plugin for working with remote SSH servers. It allows connecting, executing remote commands, coping files and directories, creating tunnels in a simple and concise way.

The plugin was jointly developed by Aestas/IT (http://aestasit.com) and NetCompany A/S (http://www.netcompany.com/) to support quickly growing operations and hosting department.

Quick example

This is a simple example of some SSH features available in the plugin:

Using a closure

task mySshTask(type: RemoteSession) {
  closure("user:password@localhost:22") {
    exec 'rm -rf /tmp/cache/'
    scp "$buildDir/cache.content", '/tmp/cache/cache.content'        
  }
}

Using an Action

task mySshTask(type: RemoteSession) {
  action("user:password@localhost:22", new Action<SessionDelegate>() {
      @Override
      void execute(SessionDelegate sd) {
        sd.exec 'rm -rf /tmp/cache/'
        sd.scp "$buildDir/cache.content", '/tmp/cache/cache.content'
      }
  })
}

Adding plugin to the build

Applying the plugin can be done in 2 ways:

Option #1

buildscript {
    repositories {
        jcenter()
        gradlePluginPortal()
    }
    dependencies {
        classpath 'com.aestasit.infrastructure.sshoogr:sshoogr-gradle:0.9.18'
    }
}
apply plugin: 'com.aestasit.sshoogr'

Option #2

plugins {
    id 'com.aestasit.sshoogr' version '0.9.18'
}

Plugin can be configured with the help of sshOptions structure:

sshOptions {
  ...
}

It also gives access to a set of task types (RemoteSession, Exec, Scp etc.) defined by Sshoogr - Groovy SSH DSL.

For documentation on Sshoogr DSL, please, refer to https://github.com/aestasit/sshoogr.  

com.aestasit.infrastructure.sshoogr

Aestas IT

Versions

Version
0.9.20
0.9.19
0.9.18
0.9.16
0.9.15
0.9.14
0.9.12
0.9.11
0.9.3