From 30471be35c083cd37dcad2afb2acdd2a2908f864 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Sun, 20 Dec 2015 18:52:04 +0100 Subject: repository rebuild in separate command --- build.gradle | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'build.gradle') diff --git a/build.gradle b/build.gradle index 1d69d90..816e98a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,31 +1,45 @@ plugins { id "nebula.ospackage" version "3.2.0" } + ext { sshKeyfile = new File(System.getProperty('user.home'), '.ssh/id_rsa') - sshKnownHosts =new File(System.getProperty('user.home'), '.ssh/known_hosts') + sshKnownHosts = new File(System.getProperty('user.home'), '.ssh/known_hosts') sshUser = 'yvesf' sshHost = 'xapek.org' sshTargetDir = 'public_html/public/debian/files' sshRebuildCommand = 'public_html/public/debian/rebuild.sh' } -subprojects { +allprojects { configurations { sshAntTask } + repositories { mavenCentral() } + dependencies { sshAntTask 'org.apache.ant:ant-jsch:1.9.2' } + ant.taskdef( name: 'scp', classname: 'org.apache.tools.ant.taskdefs.optional.ssh.Scp', classpath: configurations.sshAntTask.asPath) - ant.taskdef( name: 'ssh', classname: 'org.apache.tools.ant.taskdefs.optional.ssh.SSHExec', classpath: configurations.sshAntTask.asPath) +} +task rebuildRepositoryIndex() << { + ant.ssh(host: sshHost, + username: sshUser, + keyfile: file(sshKeyfile), + knownhosts: file(sshKnownHosts), + command: sshRebuildCommand, + verbose: true) +} + +subprojects { group 'org.xapek.yvesf.debian' version '1.0-SNAPSHOT' @@ -33,22 +47,11 @@ subprojects { def buildDeb = project.getTasks().getByName('buildDeb') task upload() << { - ant.scp( - file: new File(project.buildDir, "distributions/${buildDeb.assembleArchiveName()}"), + ant.scp(file: new File(project.buildDir, "distributions/${buildDeb.assembleArchiveName()}"), todir: "${sshUser}@${sshHost}:${sshTargetDir}", keyfile: file(sshKeyfile), knownhosts: file(sshKnownHosts), - verbose: true, - ) - ant.ssh( - host: sshHost, - username: sshUser, - keyfile: file(sshKeyfile), - knownhosts: file(sshKnownHosts), - command: sshRebuildCommand, - verbose: true, - - ) + verbose: true) } upload.dependsOn(buildDeb) -} \ No newline at end of file +} -- cgit v1.2.1