[zorg] r318241 - zorg/jenkins: Refactor update scripts
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 14 16:47:56 PST 2017
Author: matze
Date: Tue Nov 14 16:47:56 2017
New Revision: 318241
URL: http://llvm.org/viewvc/llvm-project?rev=318241&view=rev
Log:
zorg/jenkins: Refactor update scripts
Factor out a update_single_job.sh script which is useful when doing
development and experiments on the jobs.
Added:
zorg/trunk/zorg/jenkins/jobs/update_all_jobs.sh (with props)
zorg/trunk/zorg/jenkins/jobs/update_single_job.sh (with props)
Removed:
zorg/trunk/zorg/jenkins/jobs/update_jobs.sh
Added: zorg/trunk/zorg/jenkins/jobs/update_all_jobs.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/update_all_jobs.sh?rev=318241&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/update_all_jobs.sh (added)
+++ zorg/trunk/zorg/jenkins/jobs/update_all_jobs.sh Tue Nov 14 16:47:56 2017
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -eu
+
+. config
+
+rm -rf build
+
+# Create pipeline job files
+mkdir -p build/jenkins/job
+for i in jobs/*; do
+ ./update_single_job "$i"
+done
+./delete_old_Jobs.py
Propchange: zorg/trunk/zorg/jenkins/jobs/update_all_jobs.sh
------------------------------------------------------------------------------
svn:executable = *
Removed: zorg/trunk/zorg/jenkins/jobs/update_jobs.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/update_jobs.sh?rev=318240&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/update_jobs.sh (original)
+++ zorg/trunk/zorg/jenkins/jobs/update_jobs.sh (removed)
@@ -1,39 +0,0 @@
-#!/bin/sh
-set -eu
-
-. config
-
-rm -rf build
-
-# Create pipeline job files
-mkdir -p build/jenkins/job
-for i in jobs/*; do
- DESTFILE="build/jenkins/job/$(basename "$i")"
- PIPELINE_GIT_PATH="$(git ls-tree --full-name --name-only HEAD "${i}")"
- if [ -z "${PIPELINE_GIT_PATH}" ]; then
- echo 1>&2 "Could not determine git path of ${PIPELINE_FILE}. Is it checked in?"
- exit 1
- fi
-
- echo "GEN ${DESTFILE}"
- util/make_pipeline.py "${PIPELINE_GIT_URL}" "${PIPELINE_GIT_PATH}" description.txt > "$DESTFILE"
-done
-
-if test "${1-}" = "-d"; then
- echo "New jobs created in build"
- echo "Double check and rerun script without -d to apply to server."
-else
- cd build/jenkins
- for file in $(find . -type f); do
- # Try to update, if it fails to create it
- echo "UPDATE ${file}"
- if ! ../../util/update.sh $file; then
- # Try to create it
- echo "CREATE ${file}"
- ../../util/create.sh $file || echo "... failed to create job"
- fi
- done
- cd -
-
- ./delete_old_Jobs.py
-fi
Added: zorg/trunk/zorg/jenkins/jobs/update_single_job.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/update_single_job.sh?rev=318241&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/update_single_job.sh (added)
+++ zorg/trunk/zorg/jenkins/jobs/update_single_job.sh Tue Nov 14 16:47:56 2017
@@ -0,0 +1,26 @@
+#!/bin/sh
+set -eu
+
+. config
+
+JOB="$1"
+
+mkdir -p build/jenkins/job
+DESTJOB="job/$(basename "${JOB}")"
+DESTFILE="build/jenkins/${DESTJOB}"
+PIPELINE_GIT_PATH="$(git ls-tree --full-name --name-only HEAD "${JOB}")"
+if [ -z "${PIPELINE_GIT_PATH}" ]; then
+ echo 1>&2 "Could not determine git path of ${PIPELINE_FILE}. Is it checked in?"
+ exit 1
+fi
+
+echo "GEN ${DESTFILE}"
+util/make_pipeline.py "${PIPELINE_GIT_URL}" "${PIPELINE_GIT_PATH}" description.txt > "$DESTFILE"
+
+echo "UPDATE ${DESTJOB}"
+cd build/jenkins
+if ! ../../util/update.sh "${DESTJOB}"; then
+ # Try to create it
+ echo "CREATE ${DESTJOB}"
+ ../../util/create.sh "${DESTJOB}" || echo "... failed to create job"
+fi
Propchange: zorg/trunk/zorg/jenkins/jobs/update_single_job.sh
------------------------------------------------------------------------------
svn:executable = *
More information about the llvm-commits
mailing list