summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2013-07-11 00:20:09 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2013-10-17 23:15:46 +0200
commit8de3512890480dbed07fa6d46aef722c1ddda442 (patch)
tree5a033bd81e5d1222393ccdd4012abf9c9a5760c1 /tools
parent46c839abd5a76ec2ab732c592ad17726d14ffaec (diff)
downloadjgit-8de3512890480dbed07fa6d46aef722c1ddda442.tar.gz
jgit-8de3512890480dbed07fa6d46aef722c1ddda442.zip
Scripts to publish jgit artifacts on Maven central
- you need an account on oss.sonatype.org and permissions for group id org.eclipse.jgit, see [1] - install ruby [2] if necessary - run download.rb to download the Maven artifacts from repo.eclipse.org - then run deploy.rb to stage the artifacts on oss.sonatype.org - follow [3] to close the staging repository which triggers some sanity checks on Nexus - ask community to test artifacts from staging repository - if tests are ok release the staging repository as described in [4] [1] https://issues.sonatype.org/browse/OSSRH-2758 [2] https://www.ruby-lang.org/en/downloads/ [3] https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-7b.StageExistingArtifacts [4] https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8a.ReleaseIt Change-Id: I830f2392b9234e585b01dbb4a5a369edd88796a2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/maven-central/deploy.rb61
-rwxr-xr-xtools/maven-central/download.rb30
2 files changed, 91 insertions, 0 deletions
diff --git a/tools/maven-central/deploy.rb b/tools/maven-central/deploy.rb
new file mode 100755
index 0000000000..f169747c79
--- /dev/null
+++ b/tools/maven-central/deploy.rb
@@ -0,0 +1,61 @@
+#!/usr/bin/env ruby
+require 'rubygems'
+require 'highline/import'
+
+def run(args)
+ system(*args)
+end
+
+def deploy_jar(artifact, version, prefix)
+ pom = "#{artifact}-#{version}.pom"
+ binary = "#{artifact}-#{version}.jar"
+ javadoc = "#{artifact}-#{version}-javadoc.jar"
+ sources = "#{artifact}-#{version}-sources.jar"
+
+ run prefix + ["-DpomFile=#{pom}", "-Dfile=#{binary}"]
+ run prefix + ["-DpomFile=#{pom}", "-Dfile=#{sources}",
+ "-Dclassifier=sources"]
+ run prefix + ["-DpomFile=#{pom}", "-Dfile=#{javadoc}",
+ "-Dclassifier=javadoc"]
+end
+
+def deploy_parent(version, prefix)
+ pom = "org.eclipse.jgit-parent-#{version}.pom"
+ run prefix + ["-DpomFile=#{pom}", "-Dfile=#{pom}"]
+end
+
+def deploy_sh(artifact, version, prefix)
+ pom = "#{artifact}-#{version}.pom"
+ sh = "#{artifact}-#{version}.sh"
+ run prefix + ["-DpomFile=#{pom}", "-Dfile=#{sh}", "-Dpackaging=sh"]
+end
+
+def get_passphrase(prompt="Enter your GPG Passphrase")
+ ask(prompt) {|q| q.echo = false}
+end
+
+version = '3.1.0.201310021548-r'.freeze
+url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
+repositoryId = 'sonatype-nexus-staging'
+puts "gpg passphrase ?"
+passphrase = get_passphrase()
+
+group = 'org.eclipse.jgit'
+artifacts = [group,
+ group + '.ant',
+ group + '.archive',
+ group + '.console',
+ group + '.http.server',
+ group + '.java7',
+ group + '.junit',
+ group + '.junit.http',
+ group + '.pgm',
+ group + '.ui']
+
+prefix = ["mvn", "gpg:sign-and-deploy-file", "-Dgpg.passphrase=#{passphrase}",
+ "-Durl=#{url}", "-DrepositoryId=#{repositoryId}"]
+deploy_parent(version, prefix)
+artifacts.each do |artifact|
+ deploy_jar(artifact, version, prefix)
+end
+deploy_sh('org.eclipse.jgit.pgm', version, prefix)
diff --git a/tools/maven-central/download.rb b/tools/maven-central/download.rb
new file mode 100755
index 0000000000..b5dd871f31
--- /dev/null
+++ b/tools/maven-central/download.rb
@@ -0,0 +1,30 @@
+#!/usr/bin/env ruby
+version = '3.1.0.201310021548-r'.freeze
+group = 'org.eclipse.jgit'
+artifacts = [group,
+ group + '.ant',
+ group + '.archive',
+ group + '.console',
+ group + '.http.server',
+ group + '.java7',
+ group + '.junit',
+ group + '.junit.http',
+ group + '.pgm',
+ group + '.ui']
+
+puts 'Deleting current files'
+`rm -fr *.jar *.sh *.pom`
+
+puts 'Downloading org.eclipse.jgit-parent'
+`curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{group}-parent/#{version}/#{group}-parent-#{version}.pom -o #{group}-parent-#{version}.pom`
+
+artifacts.each {|artifact|
+ puts "Downloading #{artifact}-#{version}.jar"
+ `curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{artifact}/#{version}/#{artifact}-#{version}.jar -o #{artifact}-#{version}.jar`
+ `curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{artifact}/#{version}/#{artifact}-#{version}.pom -o #{artifact}-#{version}.pom`
+ `curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{artifact}/#{version}/#{artifact}-#{version}-javadoc.jar -o #{artifact}-#{version}-javadoc.jar`
+ `curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{artifact}/#{version}/#{artifact}-#{version}-sources.jar -o #{artifact}-#{version}-sources.jar`
+}
+
+puts "Downloading org.eclipse.jgit.pgm-#{version}.sh"
+`curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{group}.pgm/#{version}/#{group}.pgm-#{version}.sh -o #{group}.pgm-#{version}.sh`