Giter Site home page Giter Site logo

gradle-ssh-plugin's Introduction

Gradle SSH Plugin Build Status Gradle Status

Gradle SSH Plugin provides SSH facilities such as command execution or file transfer on Gradle.

Read the document for details, and get the template project for quick start.

Getting Started

Add the plugin into your build script.

plugins {
  id 'org.hidetake.ssh' version '1.1.4'
}

Define remote hosts and describe SSH operations in the task.

remotes {
  webServer {
    host = '192.168.1.101'
    user = 'jenkins'
    identity = file('id_ecdsa')
  }
}

task deploy << {
  ssh.run {
    session(remotes.webServer) {
      put 'example.war', '/webapps'
      execute 'sudo service tomcat restart'
    }
  }
}

Contributions

This is an open source software licensed under the Apache License Version 2.0. Feel free to open issues or pull requests.

Development

Gradle SSH Plugin internally uses Groovy SSH library. It depends on JSch.

The document is maintained on the repository of Groovy SSH.

Acceptance Test

We can run acceptance tests to verify behavior of the plugin on Gradle environment.

Prerequisite:

  • SSH service must be started on localhost port 22
  • Current user must be able to log in with a private key placed at ~/.ssh/id_rsa without any passphrase
  • SSH service must accept SFTP subsystem

Run test task.

./gradlew install
./gradlew -p acceptance-tests test

Some tests need to change the system configuration so they are separated to testWithSideEffect task. It should be run on a disposable container such as Travis CI or Docker.

Release

Build with JDK 7 for compatibility. Do not build with JDK 8.

Push a versioned tag to GitHub and Travis CI will upload the artifact to Bintray.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.