blob: c431f16cf0bbce2a0d680306f09ae69a0d3ad8eb [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 Herrmanncc1fbee2018-10-30 11:56:49 +010071#for pomFile in org/eclipse/jdt/*/*/*.pom
72for pomFile in org/eclipse/jdt/ecj/*/*.pom
Stephan Herrmann9a981012017-01-01 11:05:54 +010073do
Stephan Herrmann558b3802017-10-17 13:59:03 +020074 if same_as_baseline $pomFile
75 then
76 echo "Skipping file $pomFile which is already present in the baseline"
77 else
78 file=`echo $pomFile | sed -e "s|\(.*\)\.pom|\1.jar|"`
79 sourcesFile=`echo $pomFile | sed -e "s|\(.*\)\.pom|\1-sources.jar|"`
80 javadocFile=`echo $pomFile | sed -e "s|\(.*\)\.pom|\1-javadoc.jar|"`
81
82 echo "${MVN} -f jdt-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file -Durl=${URL} -DrepositoryId=${REPO} -Dfile=${file} -DpomFile=${pomFile}"
83
84 ${MVN} -f jdt-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file \
85 -Durl=${URL} -DrepositoryId=${REPO} \
86 -Dfile=${file} -DpomFile=${pomFile} \
87 >> .log/artifact-upload.txt
88
89 echo -e "\t${sourcesFile}"
90 ${MVN} -f jdt-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file \
91 -Durl=${URL} -DrepositoryId=${REPO} \
92 -Dfile=${sourcesFile} -DpomFile=${pomFile} -Dclassifier=sources \
93 >> .log/sources-upload.txt
94
95 echo -e "\t${javadocFile}"
96 ${MVN} -f jdt-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file \
97 -Durl=${URL} -DrepositoryId=${REPO} \
98 -Dfile=${javadocFile} -DpomFile=${pomFile} -Dclassifier=javadoc \
99 >> .log/javadoc-upload.txt
100 fi
Stephan Herrmann9a981012017-01-01 11:05:54 +0100101done
102
103/bin/ls -la .log
104
105/bin/grep -i fail .log/*
106