Skip to content

Commit 360ec1e

Browse files
authored
Merge pull request shmishleniy#6 from shmishleniy/n5
shmishleniy#5
2 parents 16f86d5 + b88cbca commit 360ec1e

File tree

7 files changed

+25
-53
lines changed

7 files changed

+25
-53
lines changed

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
.idea
2-
.sbt
3-
target
1+
target/
2+
.DS_Store

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,16 @@ or
1313

1414
`deploySsh yourServerName1 yourServerName2 ...`
1515

16-
1716
**autoplugin (sbt >= 0.13.5)**
1817

19-
## Current version: 0.1.2
20-
2118
[Please read sbt documentation before start to work with plugin](http://www.scala-sbt.org/0.13.5/docs/Getting-Started/Using-Plugins.html)
2219

2320
- [Installation](#installation)
2421
- [Configuration](#configuration)
2522
- [Configs](#configs)
2623
- [Locations](#locations)
2724
- [Artifacts](#artifacts)
28-
- [Execute scripts before/after deploy](#execute-scripts-beforeafter-deploy)
25+
- [Execute scripts before/after deploy](#execute-scripts-beforeafter-deploy)
2926
- [Link to task](#link-to-task)
3027
- [Start deploy](#start-deploy)
3128

@@ -34,7 +31,7 @@ or
3431
Add to your `project/plugins.sbt` file:
3532

3633
``` sbt
37-
addSbtPlugin("com.github.shmishleniy" % "sbt-deploy-ssh" % "0.1.2")
34+
addSbtPlugin("com.github.shmishleniy" % "sbt-deploy-ssh" % "[0,)")
3835
```
3936

4037
Add resolver to `project/plugins.sbt`:
@@ -111,7 +108,7 @@ There are four places where you can store your server config (All configs will b
111108
* Config file located in user home directory
112109
* Set server configs directly in project settings
113110
114-
``` sbt
111+
``` sbt
115112
lazy val myProject = project.enablePlugins(DeploySSH).settings(
116113
//load build.conf from external path
117114
deployExternalConfigFiles ++= Seq("/home/myUser/Documents/build.conf"),
@@ -135,7 +132,7 @@ val mySettings = Seq(
135132
### Artifacts
136133
Set artifacts to deploy
137134
138-
``` sbt
135+
``` sbt
139136
lazy val myProject = project.enablePlugins(DeploySSH).settings(
140137
version := "1.1",
141138
deployConfigs ++= Seq(
@@ -154,7 +151,7 @@ Deploy execution for this config:
154151
155152
`deploy-ssh server_5`
156153
157-
or
154+
or
158155
159156
`deploySsh server_5`
160157
@@ -198,7 +195,7 @@ lazy val myProject = project.enablePlugins(DeploySSH).settings(
198195

199196
### Link to task
200197

201-
If you need execute deploy in your task you can use `deploySshTask` and `deploySshServersNames` to config args for `deploySsh`. Or cast `deploySsh` to task.
198+
If you need execute deploy in your task you can use `deploySshTask` and `deploySshServersNames` to config args for `deploySsh`. Or cast `deploySsh` to task.
202199

203200
``` sbt
204201
lazy val myProject = project.enablePlugins(DeploySSH).settings(

build.sbt

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,20 @@ import bintray.Keys._
33
sbtPlugin := true
44

55
name := "sbt-deploy-ssh"
6-
76
organization := "com.github.shmishleniy"
8-
9-
version := "0.1.2"
10-
11-
scalacOptions ++= Seq(
12-
"-feature",
13-
"-unchecked",
14-
"-deprecation",
15-
"-language:_",
16-
"-encoding", "UTF-8"
17-
)
7+
version := org.eclipse.jgit.api.Git.open(file(".")).describe().call()
188

199
publishMavenStyle := false
20-
2110
bintrayPublishSettings
22-
2311
repository in bintray := "sbt-plugins"
24-
25-
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html"))
26-
12+
licenses += ("MIT", url("https://opensource.org/licenses/MIT"))
2713
bintrayOrganization in bintray := None
2814

2915
resolvers += "JAnalyse Repository" at "http://www.janalyse.fr/repository/"
16+
libraryDependencies ++= Seq(
17+
"com.typesafe" % "config" % "1.2.1",
18+
"fr.janalyse" %% "janalyse-ssh" % "0.9.19"
19+
)
3020

31-
libraryDependencies ++= Dependencies.tools
21+
scalacOptions in Compile ++= Seq("-encoding","UTF-8","-target:jvm-1.7","-deprecation","-feature")
22+
javacOptions in Compile ++= Seq("-encoding","UTF-8","-source","1.7","-target","1.7")

project/Dependencies.scala

Lines changed: 0 additions & 20 deletions
This file was deleted.

project/build.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sbt.version=0.13.12

project/plugins.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
libraryDependencies += "org.eclipse.jgit" % "org.eclipse.jgit" % "[0,)"
2+
3+
scalacOptions in Compile ++= Seq("-deprecation","-feature")

src/main/scala/deployssh/DeploySSH.scala renamed to src/main/scala/DeploySSH.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,16 @@ object DeploySSH extends AutoPlugin {
145145
execBefore: Seq[(SSH) => Any],
146146
execAfter: Seq[(SSH) => Any],
147147
log: Logger): Unit = {
148+
import java.io.File.{separator=>`/`}
149+
val sshKey = serverConfig.sshDir.getOrElse(Properties.userHome+`/`+".ssh")+`/`+serverConfig.sshKeyFile
150+
148151
implicit val ssh = SSH(
149152
SSHOptions(serverConfig.host,
150153
serverConfig.user getOrElse Properties.userName,
151154
serverConfig.password,
152155
serverConfig.passphrase,
153156
port = serverConfig.port.getOrElse(22),
154-
sshUserDir = serverConfig.sshDir.getOrElse(
155-
Properties.userHome + java.io.File.separator + ".ssh"),
156-
sshKeyFile = serverConfig.sshKeyFile)
157+
identities = SSHIdentity(sshKey)::Nil)
157158
)
158159
val sftp = ssh.newSftp
159160
log.info("Exec before deploy")
@@ -206,4 +207,4 @@ object DeploySSH extends AutoPlugin {
206207
directory.listFiles.filter(_.isDirectory).flatMap(getFilesFromDirectory)
207208
else Array(directory)
208209
}
209-
}
210+
}

0 commit comments

Comments
 (0)