-
Notifications
You must be signed in to change notification settings - Fork 66
/
markUnstable.groovy
102 lines (78 loc) · 3.55 KB
/
markUnstable.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
job('Builds/markUnstable'){
displayName('Mark Unstable')
description('Hudson job to mark a build unstable.')
parameters {
stringParam('buildId', null, 'ID of the build to be marked unstable.')
stringParam('issueNum', null, 'Issue report id to track instability in the build.')
stringParam('issueUrl', null, 'URL for the issue.')
}
label('centos-8')
logRotator {
daysToKeep(3)
numToKeep(5)
}
jdk('openjdk-jdk17-latest')
wrappers { //adds pre/post actions
timestamps()
sshAgent('projects-storage.eclipse.org-bot-ssh')
}
steps {
shell('''
#!/bin/bash -x
# Strip spaces from the buildId and bugId
buildId=$(echo $buildId|tr -d ' ')
issueNum=$(echo $issueNum|tr -d ' ')
#If bug id is empty we need to exit.
if [ -z "$issueNum" ]
then
exit 1
fi
#If build Id is empty exit
if [ -z "$buildId" ]
then
echo "BuildId is empty exiting"
exit 1
fi
epDownloadDir=/home/data/httpd/download.eclipse.org/eclipse
dropsPath=${epDownloadDir}/downloads/drops4
p2RepoPath=${epDownloadDir}/updates
buildDir=${dropsPath}/${buildId}
workingDir=${epDownloadDir}/workingDir
workspace=${workingDir}/${JOB_NAME}-${BUILD_NUMBER}
ssh genie.releng@projects-storage.eclipse.org rm -rf ${workingDir}/${JOB_NAME}*
ssh genie.releng@projects-storage.eclipse.org mkdir -p ${workspace}
ssh genie.releng@projects-storage.eclipse.org cd ${workspace}
#get latest Eclipse platform product
epRelDir=$(ssh genie.releng@projects-storage.eclipse.org ls -d --format=single-column ${dropsPath}/R-*|sort|tail -1)
ssh genie.releng@projects-storage.eclipse.org tar -C ${workspace} -xzf ${epRelDir}/eclipse-platform-*-linux-gtk-x86_64.tar.gz
#get requisite tools
ssh genie.releng@projects-storage.eclipse.org wget -O ${workspace}/removeFromComposite.xml https://download.eclipse.org/eclipse/relengScripts/cje-production/scripts/removeFromComposite.xml
#triggering ant runner
baseBuilderDir=${workspace}/eclipse
javaCMD=/opt/public/common/java/openjdk/jdk-17_x64-latest/bin/java
launcherJar=$(ssh genie.releng@projects-storage.eclipse.org find ${baseBuilderDir}/. -name "org.eclipse.equinox.launcher_*.jar" | sort | head -1 )
scp genie.releng@projects-storage.eclipse.org:${buildDir}/buildproperties.shsource .
source ./buildproperties.shsource
repoDir=/home/data/httpd/download.eclipse.org/eclipse/updates/${STREAMMajor}.${STREAMMinor}-${BUILD_TYPE}-builds
devworkspace=${workspace}/workspace-antRunner
devArgs=-Xmx512m
extraArgs="removeFromComposite -Drepodir=${repoDir} -Dcomplocation=${buildId}"
ssh genie.releng@projects-storage.eclipse.org ${javaCMD} -jar ${launcherJar} -nosplash -consolelog -debug -data $devworkspace -application org.eclipse.ant.core.antRunner -file ${workspace}/removeFromComposite.xml ${extraArgs} -vmargs $devArgs
#add unstable tags
ssh genie.releng@projects-storage.eclipse.org rm -f ${buildDir}/buildUnstable
touch buildUnstable
echo "<p>This build is marked unstable due to <a href='${issueUrl}'>issue ${issueNum}</a>.</p>" > buildUnstable
scp buildUnstable genie.releng@projects-storage.eclipse.org:${buildDir}/buildUnstable
ssh genie.releng@projects-storage.eclipse.org rm -rf ${workingDir}/${JOB_NAME}*
exit 0
''')
}
publishers {
downstreamParameterized {
trigger('updateIndex') {
condition('SUCCESS')
triggerWithNoParameters(true)
}
}
}
}