From bcc589f90e2ff722508e78e28f0b3e7c64d1af73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Fri, 30 Nov 2018 23:44:45 +0000 Subject: [PATCH] jenkins: add deleted git-clean-tmp-repo job This job no longer works because Jenkins requires a token. Replaced by: https://github.com/nodejs/build/pull/1515 PR-URL: https://github.com/nodejs/build/pull/1618 Reviewed-By: Rod Vagg --- jenkins/xml/git-clean-tmp-repo.xml | 85 ++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 jenkins/xml/git-clean-tmp-repo.xml diff --git a/jenkins/xml/git-clean-tmp-repo.xml b/jenkins/xml/git-clean-tmp-repo.xml new file mode 100644 index 000000000..3bd6ef815 --- /dev/null +++ b/jenkins/xml/git-clean-tmp-repo.xml @@ -0,0 +1,85 @@ + + + + + false + + + + hudson.model.Item.Build:nodejs*build + hudson.model.Item.Cancel:nodejs*build + hudson.model.Item.Configure:nodejs*build + hudson.model.Item.Discover:nodejs*build + hudson.model.Item.Read:nodejs*build + hudson.model.Item.Workspace:nodejs*build + hudson.model.Run.Replay:nodejs*build + hudson.model.Run.Update:nodejs*build + + + https://github.com/nodejs/node/ + + + + false + false + + + 0 + 0 + + false + project + false + + + + + jenkins-workspace + false + false + false + false + + true + + + #!/bin/bash -ex + +git init + +grep -q ^$TEMP_REPO_SERVER ~/.ssh/known_hosts || (ssh-keyscan -t rsa $TEMP_REPO_SERVER >> ~/.ssh/known_hosts) + +BRANCHES=$(git ls-remote -h $TEMP_REPO | sed 's|^.*refs/heads/||') + +# First get top-level branches that correspond to a Jenkins run +JENKINS_BRANCHES=$(echo $BRANCHES | sed 's/ /\n/g' | grep ^jenkins- | grep -v -- -bin) +for i in $JENKINS_BRANCHES; do + if [[ $i =~ ^jenkins-[a-z-]*-[0-9]*$ ]] ; then + JOB=$(echo $i | sed 's/^jenkins-//;s/-[0-9]*$//') + RUN=$(echo $i | sed 's/^[a-z-]*-//') + # Delete only if the job was already prunned in Jenkins + if (curl -L "https://ci.nodejs.org/job/${JOB}/${RUN}/api/json" | head -n4 | grep -q -- '^<title>Error 404 Not Found</title>$') ; then + # Get all branches related to the run, including binaries + DEL_BRANCHES=$(echo $BRANCHES | sed 's/ /\n/g' | grep ^$i) + for j in $DEL_BRANCHES; do + git push $TEMP_REPO :$j + done + fi + fi +done + + + + + + + xterm + + + + dea9092d-214b-471a-be5d-5343dd7755c1 + + false + + +