Stephan Herrmann | aec6bf0 | 2016-12-31 17:25:42 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | #******************************************************************************* |
| 3 | # Copyright (c) 2016 GK Software AG and others. |
| 4 | # All rights reserved. This program and the accompanying materials |
| 5 | # are made available under the terms of the Eclipse Public License v1.0 |
| 6 | # which accompanies this distribution, and is available at |
| 7 | # http://www.eclipse.org/legal/epl-v10.html |
| 8 | # |
| 9 | # Contributors: |
| 10 | # Stephan Herrmann - initial API and implementation |
| 11 | #******************************************************************************** |
| 12 | |
| 13 | REPO_BASE=${WORKSPACE}/../../CBIaggregator/workspace |
| 14 | REPO=${REPO_BASE}/repo-${REPO_ID} |
| 15 | PLATFORM=org/eclipse/platform |
| 16 | |
| 17 | if [ ! -d ${REPO} ] |
| 18 | then |
| 19 | echo "No repo at ${REPO}" |
| 20 | exit 1 |
| 21 | fi |
| 22 | |
| 23 | echo "==== Copy artifacts from ${REPO}/${PLATFORM} ====" |
| 24 | |
| 25 | mkdir -p ${PLATFORM} |
| 26 | cp -r ${REPO}/${PLATFORM}/* ${PLATFORM}/ |
| 27 | |
| 28 | |
| 29 | echo "==== UPLOAD ====" |
| 30 | |
| 31 | URL=https://oss.sonatype.org/service/local/staging/deploy/maven2/ |
| 32 | REPO=ossrh |
| 33 | SETTINGS=/opt/public/hipp/homes/genie.releng/.m2/settings-deploy-ossrh-platform.xml |
| 34 | MVN=/shared/common/apache-maven-latest/bin/mvn |
| 35 | |
| 36 | /bin/mkdir .log |
| 37 | |
| 38 | for pomFile in org/eclipse/platform/*/*/*.pom |
| 39 | do |
| 40 | file=`echo $pomFile | sed -e "s|\(.*\)\.pom|\1.jar|"` |
| 41 | sourcesFile=`echo $pomFile | sed -e "s|\(.*\)\.pom|\1-sources.jar|"` |
| 42 | javadocFile=`echo $pomFile | sed -e "s|\(.*\)\.pom|\1-javadoc.jar|"` |
| 43 | |
| 44 | echo "${MVN} -f platform-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file -Durl=${URL} -DrepositoryId=${REPO} -Dfile=${file} -DpomFile=${pomFile}" |
| 45 | |
| 46 | ${MVN} -f platform-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file \ |
| 47 | -Durl=${URL} -DrepositoryId=${REPO} \ |
| 48 | -Dfile=${file} -DpomFile=${pomFile} \ |
| 49 | >> .log/artifact-upload.txt |
| 50 | |
Stephan Herrmann | 9fc05c9 | 2016-12-31 17:35:26 +0100 | [diff] [blame] | 51 | echo -e "\t${sourcesFile}" |
Stephan Herrmann | aec6bf0 | 2016-12-31 17:25:42 +0100 | [diff] [blame] | 52 | ${MVN} -f platform-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file \ |
| 53 | -Durl=${URL} -DrepositoryId=${REPO} \ |
| 54 | -Dfile=${sourcesFile} -DpomFile=${pomFile} -Dclassifier=sources \ |
| 55 | >> .log/sources-upload.txt |
| 56 | |
Stephan Herrmann | 9fc05c9 | 2016-12-31 17:35:26 +0100 | [diff] [blame] | 57 | echo -e "\t${javadocFile}" |
Stephan Herrmann | aec6bf0 | 2016-12-31 17:25:42 +0100 | [diff] [blame] | 58 | ${MVN} -f platform-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file \ |
| 59 | -Durl=${URL} -DrepositoryId=${REPO} \ |
| 60 | -Dfile=${javadocFile} -DpomFile=${pomFile} -Dclassifier=javadoc \ |
| 61 | >> .log/javadoc-upload.txt |
| 62 | |
| 63 | done |
| 64 | |
| 65 | /bin/ls -la .log |
| 66 | |
| 67 | /bin/grep -i fail .log/* |
| 68 | |