Gradle SSH Plugin 1.0.3をリリースした
Gradle SSH Plugin 1.0.3をリリースしました.ビルドツール Gradle からSSHを使ってデプロイなどを行うためのプラグインです.
New Features
Gradleの標準APIに合わせて,ファイル転送のメソッドシグネチャを見直しました.具体的には,get()
と put()
の記法を from: ..., into: ...
スタイルに変更しました.
// specify the file path get from: '/remote/file', into: 'local_file' // specify a File object get from: '/remote/file', into: buildDir // specify an output stream file.withOutputStream { stream -> get from: '/remote/file', into: stream } // get content as a string def text = get from: '/remote/file'
// specify the file path put from: 'local_file', into: '/remote/file' // specify a File object put from: buildDir, into: '/remote/folder' // specify an Iterable<File> put from: files('local_file1', 'local_file2'), into: '/remote/folder' // specify an input stream file.withInputStream { stream -> put from: stream, into: '/remote/file.txt' } // specify a string put text: '''#!/bin/sh echo 'hello world' ''', into: '/remote/script.sh' // specify a byte array put bytes: [0xff, 0xff], into: '/remote/fixture.dat'
1.0.2で追加された file
, files
は from
に変更されました.
なお,下記のような従来の書き方もサポートしていますが,ビルドスクリプトの可読性の観点からfrom/intoスタイルの書き方を推奨します.
get '/remote/file', 'local_file' put 'local_file', '/remote/file'
How to Use
詳しくは Gradle SSH Plugin Website からどうぞ.