Last active
May 14, 2017 10:26
-
-
Save mgoellnitz/7eb543095fa6857dc135c3ef43b58b87 to your computer and use it in GitHub Desktop.
Generic Bintray Publication Helper from local Apache Maven Repositories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright 2015-2016 Martin Goellnitz | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU General Public License for more details. | |
# | |
# You should have received a copy of the GNU General Public License | |
# along with this program. If not, see <http://www.gnu.org/licenses/>. | |
# | |
#!/bin/sh | |
PROJECT=$1 | |
VERSION=$2 | |
REPO="~/.m2/repo" | |
CUSTOM=`grep localRepository ~/.m2/settings.xml` | |
if [ ! -z $CUSTOM ] ; then | |
# echo $CUSTOM | |
REPO=`echo $CUSTOM | sed 's/.localRepository.\(.*\)..localRepository./\1/g' ` | |
fi | |
if [ -z $PROJECT ] ; then | |
echo "Project to be published must be given as the first parameter" | |
exit | |
fi | |
if [ -z $VERSION ] ; then | |
echo "Version to be published must be given as the second parameter" | |
exit | |
fi | |
REPO=$REPO/$PROJECT | |
# echo $REPO | |
# exit | |
for f in `(cd $REPO ;find -type f -name "*$VERSION*"|sort)` ; do | |
file=`echo $f |sed -e 's/\.\///g'` | |
echo -n $file | |
curl -T $REPO/$file -u$ORG_GRADLE_PROJECT_bintrayUser:$ORG_GRADLE_PROJECT_bintrayKey https://api.bintray.com/content/mgoellnitz/maven/$PROJECT/$VERSION/$PROJECT/$file | |
echo "." | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment