From e5b3646fe43f2e4872b60a291c4f3320d518a948 Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Mon, 24 Aug 2015 23:29:38 -0400 Subject: [PATCH] build: upload maven snapshots to updates server --- .travis.yml | 5 +++ build.gradle | 1 + common.gradle | 64 +++++++++++++++++------------------- private/known_hosts | 1 + private/www-updater.key.enc | Bin 0 -> 1680 bytes upload.gradle | 6 ++++ 6 files changed, 44 insertions(+), 33 deletions(-) create mode 100644 private/known_hosts create mode 100644 private/www-updater.key.enc create mode 100644 upload.gradle diff --git a/.travis.yml b/.travis.yml index 00deece41..9e1b367c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,7 @@ install: script: - ./gradlew check - ./gradlew createZipDistribution + - ./gradlew uploadArchives before_deploy: - export RELEASE_DIST=$(ls build/distributions/*.zip) @@ -40,6 +41,10 @@ deploy: repo: jMonkeyEngine/jmonkeyengine tags: true +before_install: + - openssl aes-256-cbc -K $encrypted_a1949b55824a_key -iv $encrypted_a1949b55824a_iv + -in private/www-updater.key.enc -out private/www-updater.key -d + # before_install: # required libs for android build tools # sudo apt-get update diff --git a/build.gradle b/build.gradle index bb08403de..192bc32d3 100644 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,7 @@ buildscript { apply plugin: 'base' apply from: file('version.gradle') +apply from: file('upload.gradle') // This is applied to all sub projects subprojects { diff --git a/common.gradle b/common.gradle index cda51dbed..69b695ecd 100644 --- a/common.gradle +++ b/common.gradle @@ -4,7 +4,6 @@ apply plugin: 'java' apply plugin: 'maven' -apply plugin: 'maven-publish' group = 'com.jme3' version = jmePomVersion @@ -19,15 +18,20 @@ repositories { } } +configurations { + deployerJars +} + dependencies { // Adding dependencies here will add the dependencies to each subproject. testCompile group: 'junit', name: 'junit', version: '4.10' + deployerJars "org.apache.maven.wagon:wagon-ssh:2.9" } jar { manifest { attributes 'Implementation-Title': 'jMonkeyEngine', - 'Implementation-Version': version + 'Implementation-Version': jmeFullVersion } } @@ -63,41 +67,35 @@ artifacts { } } -publishing { - publications { - maven(MavenPublication) { - from components.java - artifact sourcesJar - artifact javadocJar - - pom.withXml { - asNode().children().last() + { - resolveStrategy = Closure.DELEGATE_FIRST - name POM_NAME - description POM_DESCRIPTION - url POM_URL - scm { - url POM_SCM_URL - connection POM_SCM_CONNECTION - developerConnection POM_SCM_DEVELOPER_CONNECTION - } - licenses { - license { - name POM_LICENSE_NAME - url POM_LICENSE_URL - distribution POM_LICENSE_DISTRIBUTION - } - } +uploadArchives { + repositories.mavenDeployer { + configuration = configurations.deployerJars + + // disable this otherwise it will fill up the server with stale jars + uniqueVersion = false + + repository(url: "scp://updates.jmonkeyengine.org/var/www/updates/maven") { + authentication(userName: "www-updater", privateKey: "private/www-updater.key") + } + + pom.project { + name POM_NAME + description POM_DESCRIPTION + url POM_URL + scm { + url POM_SCM_URL + connection POM_SCM_CONNECTION + developerConnection POM_SCM_DEVELOPER_CONNECTION + } + licenses { + license { + name POM_LICENSE_NAME + url POM_LICENSE_URL + distribution POM_LICENSE_DISTRIBUTION } } } } - - repositories { - maven { - url "${rootProject.buildDir}/repo" // change to point to your repo, e.g. http://my.org/repo - } - } } task createFolders(description: 'Creates the source folders if they do not exist.') doLast { diff --git a/private/known_hosts b/private/known_hosts new file mode 100644 index 000000000..fdc45836f --- /dev/null +++ b/private/known_hosts @@ -0,0 +1 @@ +updates.jmonkeyengine.org ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC5bNOiZwU5dF62nBllxkjiSIfn0k6RVfprvO1aUypRmARD3/MKJKg7cGLezlLKaHZtVs84VpEqpmg5IzPAXWEmxUw1oke70uYMli7JV+4oPAeQRFwUdldP98I5h9VHwSjBqMycRLkxYaHF8edIPt1Zsa2dM3qrufy71ndQoFF6g7QxmT7gsTxwcNufDxymIgiAna/Qp2fr0YCLCiB8RQ7JTHfqA3dOWw0wz7AwfBTwwDCHkVxB5B4nz5iZxFr0scvqcae8vMncq8xKS7OMrLbn6asVaF6dDu+5Jc0mqxma5Qg7VC1xQXZsvlRISfrTFhQMhEx+j9w5snzihrlFnZ35 diff --git a/private/www-updater.key.enc b/private/www-updater.key.enc new file mode 100644 index 0000000000000000000000000000000000000000..63dcb3723b1dcd54430796054132f1ff7d5fdb1b GIT binary patch literal 1680 zcmV;B25^y948w%I+4g1qyf3(On-9r(68o5^zSloKghl81#QXZ?{a*`b zv6dZtN|PE2(pXIH*MQ!r?^)WK38p9Ch8R20HN*n`?9H8)U=gjC(Eet+^t6GF%Vv1| zp5d-TWxmS3I0okiG0HT1DohfOejyqeG~OeQ8<1QZp{!dvkZ27^=C8eU&Cx zM~EZmBa5WV9e%#8W5Vh=^|KNbLtXvx(0{wlK8G_bF2F`)>YMu(Jj$_`uVhPWYP2j` zV*=J7Ijm07>96zEL>EkZZ8GcDdu4Loq1N~YPZ2Tmig=7|g<}HPKPW#B;a$B)PXt){ zkIe&A0w&>V35CjRI;R8qpUWXq%}of7W6>uAId^;m7HP?4zpm6h{LK@Lh?w3nn#`BM zz}6TVQ5{f}LGy*~aP(4)BRV@~&lZ#K_1%}}HX_NK{{73NVs4{M!SJrO{9?!-A=B4-)qEB6F0Dh71nX<&X$Z{D(1FB*B7 z?7^aE)13IE-m9^IDKKx5*ZHJbjBa%&2H{<99Gb>E0mH4V&d*F_g8c5<`qo1?foc!( zahNWJKP!+mHpJI2JKJf9$MO}5)Rqd}RvIx)q7LFXq6cME&#E%(92QZc_`{NW6xwWW zaZ}jGGOe__QRY(~n#ICxpxAm7+1iKoSUfC%I{^)NA(;v9vMS*$a?|#|r2?V_+q?iD zJ1-DdPsvPm`KI$y68bGdj*Rm&CZQ&}_(aZnrk|_%7nA?}MCyNMSA?ceUW71K2r3CP z&blm@=(Pv5t|YCKR^5w>vtR5jx0mIf1RfDW^`PXj7@)1Sh!5h@VL)*|J*1f>gc{C4 zUc538`#DIND*;=uejUF5n1LFgOyF^uR-3j+%%H`1(4B@ymG#(PIOsjxnaSl0yC3XU zg5|+XK6Q?b^1cvJ!cWCXau3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