Bash: Deploy plugin archetypes to Maven Central
./tools/plugin_archetype_deploy.sh This script builds and deploys plugin archetypes to Maven Central. Change-Id: I4fc8e80f0907c2f43cf5f348a0f334c1e86f8db8
This commit is contained in:

committed by
Edwin Kempin

parent
76afac60b7
commit
60087292eb
@@ -296,6 +296,17 @@ included in the next Gerrit release. Update the Gerrit version in the
|
||||
for review and get it merged.
|
||||
|
||||
|
||||
[[publish-plugins-archetypes-to-maven-central]]
|
||||
=== Publish plugin archetypes to Maven Central
|
||||
|
||||
Make sure you have done the
|
||||
link:dev-release-deploy-config.html#deploy-configuration-setting-maven-central[
|
||||
configuration needed for deployment]
|
||||
|
||||
----
|
||||
./tools/plugin_archetype_deploy.sh
|
||||
----
|
||||
|
||||
[[merge-stable]]
|
||||
=== Merge `stable` into `master`
|
||||
|
||||
|
83
tools/plugin_archetype_deploy.sh
Executable file
83
tools/plugin_archetype_deploy.sh
Executable file
@@ -0,0 +1,83 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2014 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
help()
|
||||
{
|
||||
cat <<'eof'
|
||||
Usage: plugin_archetype_deploy [option]
|
||||
|
||||
Deploys Gerrit plugin Maven archetypes to Maven Central
|
||||
|
||||
Valid options:
|
||||
--help show this message
|
||||
--dry-run don't execute commands, just print them
|
||||
eof
|
||||
exit
|
||||
}
|
||||
|
||||
function getver
|
||||
{
|
||||
grep "$1" $root/VERSION | sed "s/.*'\(.*\)'/\1/"
|
||||
}
|
||||
|
||||
function instroot
|
||||
{
|
||||
bindir=${0%/*}
|
||||
|
||||
case $bindir in
|
||||
./*) bindir=$PWD/$bindir ;;
|
||||
esac
|
||||
|
||||
cd $bindir/..
|
||||
pwd
|
||||
}
|
||||
|
||||
function doIt
|
||||
{
|
||||
case $dryRun in
|
||||
true) echo "$@" ;;
|
||||
*) "$@" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
function build_and_deploy
|
||||
{
|
||||
module=${PWD##*/}
|
||||
doIt mvn package gpg:sign-and-deploy-file \
|
||||
-Durl=$url \
|
||||
-DrepositoryId=sonatype-nexus-staging \
|
||||
-DpomFile=pom.xml \
|
||||
-Dfile=target/$module-$ver.jar
|
||||
}
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
test "$1" == --dry-run && dryRun=true
|
||||
test "$1" == --help && help
|
||||
shift
|
||||
done
|
||||
|
||||
root=$(instroot)
|
||||
cd "$root"
|
||||
ver=$(getver GERRIT_VERSION)
|
||||
[[ $ver == *-SNAPSHOT ]] \
|
||||
&& url="https://oss.sonatype.org/content/repositories/snapshots" \
|
||||
|| url="https://oss.sonatype.org/service/local/staging/deploy/maven2"
|
||||
|
||||
for d in gerrit-plugin-archetype \
|
||||
gerrit-plugin-js-archetype \
|
||||
gerrit-plugin-gwt-archetype ; do
|
||||
(cd "$d"; build_and_deploy)
|
||||
done
|
||||
|
Reference in New Issue
Block a user