Skip to content

Commit c881875

Browse files
authored
Merge branch 'eclipse-platform:master' into master
2 parents bb4250e + cb32e96 commit c881875

12 files changed

Lines changed: 48 additions & 427 deletions

File tree

JenkinsJobs/Cleanup/pruneDailyRepos.groovy

Lines changed: 0 additions & 70 deletions
This file was deleted.

cje-production/cleaners/cleanupNightlyRepo.sh

Lines changed: 0 additions & 242 deletions
This file was deleted.

cje-production/mbscripts/mb620_promoteUpdateSite.sh

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ fi
2222
source $CJE_ROOT/scripts/common-functions.shsource
2323
source $1
2424

25+
compositeTargetSize=3
2526
epUpdateDir=/home/data/httpd/download.eclipse.org/eclipse/updates
2627
dropsPath=${epUpdateDir}/${STREAMMajor}.${STREAMMinor}-${BUILD_TYPE}-builds
2728
latestRelDir=/home/data/httpd/download.eclipse.org/eclipse/downloads/drops4
@@ -48,7 +49,35 @@ epRelDir=$(ssh genie.releng@projects-storage.eclipse.org ls -d --format=single-c
4849
ssh genie.releng@projects-storage.eclipse.org tar -C ${workspace} -xzf ${epRelDir}/eclipse-platform-*-linux-gtk-x86_64.tar.gz
4950

5051
#get requisite tools
51-
ssh genie.releng@projects-storage.eclipse.org wget -O ${workspace}/addToComposite.xml https://download.eclipse.org/eclipse/relengScripts/cje-production/scripts/addToComposite.xml
52+
# Enhance the addToComposite ANT script to remove the oldest/earliest children to ensure the target-size is not exceeded
53+
scp genie.releng@projects-storage.eclipse.org:${dropsPath}/compositeArtifacts.jar compositeArtifacts.jar
54+
#Unzip compositeArtifacts.xml and read the current children from it
55+
currentChildren=$(unzip -p compositeArtifacts.jar compositeArtifacts.xml |\
56+
xmllint - --xpath '/repository/children/child/@location' |\
57+
sed --expression 's|location="||g' --expression 's|"||g')
58+
rm compositeArtifacts.jar
59+
childrenArray=(${currentChildren})
60+
echo "Current children of composite repository: ${childrenArray[@]}"
61+
62+
addToComposite_xml=$(curl https://download.eclipse.org/eclipse/relengScripts/cje-production/scripts/addToComposite.xml)
63+
extraTasksMarker='<!--EXTRA_TASKS-->'
64+
65+
# One more child is about to be added to the composite.
66+
# Remove those children from the beginning of the list if the target-size would be exceeded.
67+
removalCount=$(( ${#childrenArray[@]} + 1 - compositeTargetSize ))
68+
if [ "${removalCount}" -gt 0 ]; then
69+
childrenToRemove="${childrenArray[@]:0:${removalCount}}"
70+
echo "Remove from composite repsitory: ${childrenToRemove}"
71+
extraAntTask=''
72+
for child in ${childrenToRemove}; do
73+
extraAntTask+="<remove><repository location=\\\"${child}\\\"/></remove>\\n "
74+
done
75+
addToComposite_xml=$(cat <<<"${addToComposite_xml}" | sed --expression "s|${extraTasksMarker}|${extraAntTask}|g")
76+
else
77+
echo "Composite p2-repository contains only ${#childrenArray[@]} children and adding one will not exceed its target size of ${compositeTargetSize}: ${dropsPath}"
78+
fi
79+
80+
ssh genie.releng@projects-storage.eclipse.org "cat<<<'${addToComposite_xml}' > ${workspace}/addToComposite.xml"
5281

5382
#triggering ant runner
5483
baseBuilderDir=${workspace}/eclipse

cje-production/scripts/addToComposite.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<project
43
default="addToComposite"
54
basedir=".">
@@ -16,7 +15,7 @@
1615
<add>
1716
<repository location="${complocation}" />
1817
</add>
18+
<!--EXTRA_TASKS-->
1919
</p2.composite.repository>
2020
</target>
2121
</project>
22-

0 commit comments

Comments
 (0)