diff options
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..1d69d90 --- /dev/null +++ b/build.gradle @@ -0,0 +1,54 @@ +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') + sshUser = 'yvesf' + sshHost = 'xapek.org' + sshTargetDir = 'public_html/public/debian/files' + sshRebuildCommand = 'public_html/public/debian/rebuild.sh' +} + +subprojects { + 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) + + group 'org.xapek.yvesf.debian' + version '1.0-SNAPSHOT' + + apply plugin: 'nebula.ospackage' + + def buildDeb = project.getTasks().getByName('buildDeb') + task upload() << { + 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, + + ) + } + upload.dependsOn(buildDeb) +}
\ No newline at end of file |