【发布时间】:2015-05-13 19:49:43
【问题描述】:
我正在编写 gradle 脚本,我有一个插件可以自动从 artifactory 下载 zip、jar 和 war 文件,之后我需要对远程服务器执行 ssh 并将该 zip 文件移动到特定位置。
我正在尝试按照以下方式进行操作,但出现错误
// ------ Tell the script to get dependencies from artifactory ------
buildscript {
repositories {
maven {
url "http://cm.thm.com:80/artifactory/repo1-cache"
url "http://cm.thm.com:80/artifactory/libs-snapshot"
}
}
// ------ Tell the script to get dependencies from artifactory ------
dependencies {
classpath 'org.hidetake:gradle-ssh-plugin:0.4.3'
classpath ([ "com.tr.cm:cmgradleplugin:1.1.118" ])
}
}
apply plugin: 'com.truven.cm.cmgradleplugin'
apply plugin: 'org.hidetake.ssh'
/**
* Use the deploy task to download the artifact and then unzip it to a local directory
* -DjobName specifies the job that produced the artifact
* -DbuildNumber specifies the build Number for the artifact
*/
remotes {
webServer {
host = '10.2.12.912'
user = 'cc'
password = 'tr'
// identity = file('id_rsa')
}
}
task deployment(type: SshTask, dependsOn: deploy){
ssh.run {
session(remotes.webServer) {
put(analytics-engine-AnalyticsLib-4.0.0.78.zip, "/applications/analyticsengine")
execute 'unzip analytics-engine-AnalyticsLib-4.0.0.78.zip'
}
}
}
下面是错误
build file '/applications/jenkins/workspace/DeployArtifactToDev/environments/build.gradle': 43: unexpected token: 0.78 @ line 43, column 45.
analytics-engine-AnalyticsLib-4.0.0.78.zip,
^
1 error
谁能告诉我我的 ssh 代码没问题,或者我需要改变什么吗?
【问题讨论】:
标签: gradle build.gradle gradlew