tag | 9c3df2ba5f3e005d657245f25e7e28c02c7a1a75 | |
---|---|---|
tagger | Basil Peace <grv87@yandex.ru> | Thu Aug 02 20:03:32 2018 +0300 |
object | eec858ac69e6df4c71dd79657f1e14f622023a95 |
Release of 1.0.0
commit | eec858ac69e6df4c71dd79657f1e14f622023a95 | [log] [tgz] |
---|---|---|
author | Basil Peace <grv87@yandex.ru> | Thu Aug 02 19:58:14 2018 +0300 |
committer | Basil Peace <grv87@yandex.ru> | Thu Aug 02 20:02:04 2018 +0300 |
tree | 1b483878841e9b3940cc0ad6ab9cc1fbc13b2efb | |
parent | 7e5c235df2715a17eaf00025614f9a050a93140f [diff] |
test: reuse code
This plugin provides Gradle ability to generate SSH keys.
It uses JSch Java library, no installation of extra tools is required.
plugins { id 'org.fidata.keygen' } keygen { keyType = RSA keySize = 4096 } task('generateSSHKey', type: GenerateSSHKeyTask) { privateKeyFile = new File(buildDir, 'ssh_key') email = 'test@example.com' }
This task, when run, would produce ssh_key
and ssh_key.pub
files in build
directory.
keyType
and keySize
properties can be set per-task via its properties. Otherwise, project-wide values from keygen
extension are used.
Since keys can't be restored, to prevent key loss task will run only if either private or public key file doesn't exist. If you want to regenerate key (including when you changed desired key properties) you should clean them manually beforehand.
Other types of keys could be supported in the future.
Copyright © 2018 Basil Peace
This file is part of gradle-keygen-plugin.
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.