blob: e9b172775a4788e7e4567f8e287e41010b778296 [file] [log] [blame]
Stephan Herrmann9a981012017-01-01 11:05:54 +01001#!/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
13REPO_BASE=${WORKSPACE}/../../CBIaggregator/workspace
14REPO=${REPO_BASE}/repo-${REPO_ID}
15JDT=org/eclipse/jdt
16
Stephan Herrmann558b3802017-10-17 13:59:03 +020017# load versions from the baseline (to avoid illegal double-upload):
18source ${WORKSPACE}/baseline.txt
19
Stephan Herrmann9a981012017-01-01 11:05:54 +010020if [ ! -d ${REPO} ]
21then
22 echo "No repo at ${REPO}"
23 exit 1
24fi
25
26echo "==== Copy artifacts from ${REPO}/${JDT} ===="
27
Stephan Herrmannc051f1d2017-03-05 15:52:41 +010028if [ -d ${JDT} ]
29then
30 /bin/rm -r ${JDT}/*
31else
32 mkdir -p ${JDT}
33fi
Stephan Herrmann9a981012017-01-01 11:05:54 +010034cp -r ${REPO}/${JDT}/* ${JDT}/
35
36
37echo "==== UPLOAD ===="
38
39URL=https://oss.sonatype.org/service/local/staging/deploy/maven2/
40REPO=ossrh
41SETTINGS=/opt/public/hipp/homes/genie.releng/.m2/settings-deploy-ossrh-jdt.xml
42MVN=/shared/common/apache-maven-latest/bin/mvn
43
44/bin/mkdir .log
45
Stephan Herrmann558b3802017-10-17 13:59:03 +020046function same_as_baseline() {
47 simple=`basename $1`
48 name=`echo $simple | sed -e "s|\(.*\)-.*|\1|" | tr '.' '_'`
49 version=`echo $simple | sed -e "s|.*-\(.*\).pom|\1|"`
Stephan Herrmannd734c992018-07-12 22:20:05 +020050 base_versions=`eval echo \\${VERSION_$name}`
51 if [ -n $base_versions ]
Stephan Herrmann558b3802017-10-17 13:59:03 +020052 then
Stephan Herrmannd734c992018-07-12 22:20:05 +020053 local base_single
54 while read -d "," base_single
55 do
56 if [ $base_single == $version ]; then
57 return 0
58 fi
59 done <<< "$base_versions"
60 if [ $base_single == $version ]; then
61 return 0
62 fi
Stephan Herrmann558b3802017-10-17 13:59:03 +020063 else
Stephan Herrmannd734c992018-07-12 22:20:05 +020064 echo "Plug-in ${name}: ${version} seems to be new"
Stephan Herrmann558b3802017-10-17 13:59:03 +020065 return 1
66 fi
Stephan Herrmannd734c992018-07-12 22:20:05 +020067 echo "different versions for ${name}: ${version} is not in ${base_versions}"
68 return 1
Stephan Herrmann558b3802017-10-17 13:59:03 +020069}
70
Stephan Herrmanne2be4392018-10-30 21:23:17 +010071for pomFile in org/eclipse/jdt/*/*/*.pom
Stephan Herrmann9a981012017-01-01 11:05:54 +010072do
Stephan Herrmann558b3802017-10-17 13:59:03 +020073 if same_as_baseline $pomFile
74 then
75 echo "Skipping file $pomFile which is already present in the baseline"
76 else
77 file=`echo $pomFile | sed -e "s|\(.*\)\.pom|\1.jar|"`
78 sourcesFile=`echo $pomFile | sed -e "s|\(.*\)\.pom|\1-sources.jar|"`
79 javadocFile=`echo $pomFile | sed -e "s|\(.*\)\.pom|\1-javadoc.jar|"`
80
81 echo "${MVN} -f jdt-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file -Durl=${URL} -DrepositoryId=${REPO} -Dfile=${file} -DpomFile=${pomFile}"
82
83 ${MVN} -f jdt-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file \
84 -Durl=${URL} -DrepositoryId=${REPO} \
85 -Dfile=${file} -DpomFile=${pomFile} \
86 >> .log/artifact-upload.txt
87
88 echo -e "\t${sourcesFile}"
89 ${MVN} -f jdt-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file \
90 -Durl=${URL} -DrepositoryId=${REPO} \
91 -Dfile=${sourcesFile} -DpomFile=${pomFile} -Dclassifier=sources \
92 >> .log/sources-upload.txt
93
94 echo -e "\t${javadocFile}"
95 ${MVN} -f jdt-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file \
96 -Durl=${URL} -DrepositoryId=${REPO} \
97 -Dfile=${javadocFile} -DpomFile=${pomFile} -Dclassifier=javadoc \
98 >> .log/javadoc-upload.txt
99 fi
Stephan Herrmann9a981012017-01-01 11:05:54 +0100100done
101
102/bin/ls -la .log
103
104/bin/grep -i fail .log/*
105