From 9b74021766ab1055ad41de8c7eece65552170355 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 19 Feb 2025 11:45:43 -0800 Subject: [PATCH] jenkins loop: refresh deactivated branches (#34622) refresh --- scripts/jenkins_loop_test.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/jenkins_loop_test.sh b/scripts/jenkins_loop_test.sh index d1167aa231..60e9182136 100755 --- a/scripts/jenkins_loop_test.sh +++ b/scripts/jenkins_loop_test.sh @@ -25,12 +25,14 @@ function loop() { # Try to find previous builds ALL_BUILDS=( $(curl -s $API_ROUTE/api/json | jq .builds.[].number 2> /dev/null || :) ) - # No builds. Create branch - if [[ ${#ALL_BUILDS[@]} -eq 0 ]]; then + # Jenkins branches get deactivated after some time + BUILDABLE=$(curl -s $API_ROUTE/api/json | jq '.buildable') + + if [[ ${#ALL_BUILDS[@]} -eq 0 || $BUILDABLE != "true" ]]; then TEMP_DIR=$(mktemp -d) GIT_LFS_SKIP_SMUDGE=1 git clone --quiet -b $BRANCH --depth=1 --no-tags git@github.com:commaai/openpilot $TEMP_DIR git -C $TEMP_DIR checkout --quiet -b $JENKINS_BRANCH - echo "TESTING" >> $TEMP_DIR/testing_jenkins + echo "TESTING: $(date)" >> $TEMP_DIR/testing_jenkins git -C $TEMP_DIR add testing_jenkins git -C $TEMP_DIR commit --quiet -m "testing" git -C $TEMP_DIR push --quiet -f origin $JENKINS_BRANCH