jenkins/push-m2-repo.rb

82 lines
2.6 KiB
Ruby
Raw Normal View History

#!/bin/ruby
# The MIT License
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
ver=ARGV.shift
require 'ftools'
class VersionNumber
def initialize(str)
@tokens = str.split(/\./)
end
def inc
@tokens[-1] = (@tokens[-1].to_i()+1).to_s()
end
def dec
@tokens[-1] = (@tokens[-1].to_i()-1).to_s()
end
def to_s
@tokens.join(".")
end
end
print "Releasing master POM for plugins"
prev=VersionNumber.new(ver)
prev.dec()
def updatePom(src,prev,ver)
open(src) do |i|
open(src+".tmp","w") do |o|
i.each do |line|
line = line.gsub("<version>#{prev}</version>","<version>#{ver}</version>")
o.puts line
end
end
end
File.move(src+".tmp",src)
end
Dir.chdir("../plugins") do
system "svn update"
# update master POM
updatePom("pom.xml",prev,ver)
# --- stop updating plugin POMs aggressively. Now that plugins/pom.xml is synced
# to central, we no longer have a real incentive to do this, and we can let
# plugin authors choose the version of their choice.
## update parent reference in module POM
#Dir.glob("*") do |name|
# next unless File.directory?(name)
# print "#{name}\n"
# next unless File.exists?(name+"/pom.xml")
# updatePom(name+"/pom.xml",prev,ver)
#end
## in case anyone gets out of sync, this will bring them back to the current version,
## except that this only works for children nominated in the <module> section.
#system "mvn -N versions:update-child-modules" or fail
system "svn commit -m 'bumping up POM version'" or fail
system "mvn -N deploy" or fail
Merged revisions 19167-19168,19178,19183-19187,19190,19193-19194,19207,19209,19223,19236,19248,19254,19257,19338 via svnmerge from https://www.dev.java.net/svn/hudson/branches/rc ........ r19167 | kohsuke | 2009-06-23 16:08:06 -0700 (Tue, 23 Jun 2009) | 1 line merged back the changes in the RC branch ........ r19168 | kohsuke | 2009-06-23 16:12:46 -0700 (Tue, 23 Jun 2009) | 1 line fixed the bug ........ r19178 | swiest | 2009-06-24 02:43:21 -0700 (Wed, 24 Jun 2009) | 1 line Updated German localization of core module. ........ r19183 | kohsuke | 2009-06-24 08:57:07 -0700 (Wed, 24 Jun 2009) | 1 line forgot to update this ........ r19184 | kohsuke | 2009-06-24 09:06:59 -0700 (Wed, 24 Jun 2009) | 1 line fixed and improved the retry logic ........ r19185 | kohsuke | 2009-06-24 09:07:49 -0700 (Wed, 24 Jun 2009) | 1 line I think this is better ........ r19186 | kohsuke | 2009-06-24 09:08:02 -0700 (Wed, 24 Jun 2009) | 1 line fixed import statements ........ r19187 | kohsuke | 2009-06-24 09:57:52 -0700 (Wed, 24 Jun 2009) | 3 lines WebDAV deployment from Maven was failing with VerifyError. A test case requires a webdav server, I tried Milton but couldn't make it work without the source code. ........ r19190 | swiest | 2009-06-24 12:07:50 -0700 (Wed, 24 Jun 2009) | 1 line Deprecated Util.combine(long,String) method and rewrote its callers to use localizable resources. ........ r19193 | sogabe | 2009-06-24 14:53:02 -0700 (Wed, 24 Jun 2009) | 2 lines Updated Japanese localization. ........ r19194 | kohsuke | 2009-06-24 15:20:15 -0700 (Wed, 24 Jun 2009) | 1 line added default value support ........ r19207 | kohsuke | 2009-06-24 19:50:48 -0700 (Wed, 24 Jun 2009) | 1 line recording HUDSON-2909 for 1.313 ........ r19209 | kohsuke | 2009-06-24 19:52:21 -0700 (Wed, 24 Jun 2009) | 1 line creating a new RC branch ........ r19223 | kohsuke | 2009-06-25 10:43:06 -0700 (Thu, 25 Jun 2009) | 7 lines Replaced the icon with the one that came from the same icon set, plus hyperlinking the icon to Hudson Wiki so that we can be more informative. Tooltip on the icon doesn't work very well because the TD itself sets a tooltip, and we end up seeing the overlapped 2 tooltips (at least on my Firefox 3.0 on Ubuntu) ........ r19236 | kohsuke | 2009-06-25 18:06:50 -0700 (Thu, 25 Jun 2009) | 1 line applied a patch from Jeremy (or id:endolf). See http://www.nabble.com/Build-publisher-patch-svn-access-td24164282.html ........ r19248 | kohsuke | 2009-06-26 14:42:40 -0700 (Fri, 26 Jun 2009) | 1 line [maven-release-plugin] prepare release hudson-1_313 ........ r19254 | kohsuke | 2009-06-26 17:28:12 -0700 (Fri, 26 Jun 2009) | 1 line [maven-release-plugin] prepare for next development iteration ........ r19257 | kohsuke | 2009-06-26 18:20:24 -0700 (Fri, 26 Jun 2009) | 1 line updated changelog as a part of the release ........ r19338 | kohsuke | 2009-06-30 18:48:25 -0700 (Tue, 30 Jun 2009) | 1 line added maven-versions-plugin to pick up ones that got out of sync ........ git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@19354 71c3de6d-444a-0410-be80-ed276b4c234a
2009-07-02 12:17:46 +08:00
end