forked from cms-sw/cms-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqueue-new-prs
executable file
·33 lines (27 loc) · 1.03 KB
/
queue-new-prs
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
#!/bin/sh -ex
# Uses query-new-pull-requests to get the latest PRS.
# It checks if the PR is for a branch for which automatic tests are activated.
# Finally, it creates a properties file with the PR number for jenkins to trigger the next job.
TRIGGERING_FILE=$WORKSPACE/'trigger-tests.properties'
PR_LIST=''
for PR in `./query-new-pull-requests -t ${TIME_INTERVAL}`; do
# Use helper to get PR branch
RELEASE_QUEUE=`./get-pr-branch $PR`
if cat config.map | grep $RELEASE_QUEUE | grep -v DISABLED= | grep PR_TESTS= ; then
# If this is the case, we force the creation of tests for the PR, even if
# not apporved. This is under the assumption some human checked that
# everything is ok.
if [ "X$FORCE_ALL_TESTS" = Xtrue ]; then
echo 'Triggering tests (Forced) for: '$PR
PR_LIST=$PR,$PR_LIST
else
if ./auto-trigger-pr $PR; then
echo 'Triggeing tests for: '$PR
PR_LIST=$PR,$PR_LIST
fi
fi
fi
done
if [ "X$PR_LIST" != X ]; then
echo 'PULL_REQUEST_LIST='$PR_LIST >> $TRIGGERING_FILE
fi