Integrate the cleanup of remaining Windows processes to ci-build

So far, the cleanup of processes on the windows nodes of Inria's CI was
done in a .bat file called by the Windows jobs.

This commit integrates this process cleanup into ci-build.
master
Sébastien Hinderer 2017-04-13 14:03:15 +02:00
parent 2afebd064c
commit d96f81177d
1 changed files with 23 additions and 1 deletions

View File

@ -33,6 +33,14 @@ error () {
exit 3 exit 3
} }
# Kill a task on Windows
# Errors (e.g. non-existing tasks) are ignored
kill_task()
{
task=$1
taskkill /f /im ${task} || true
}
quote1 () { quote1 () {
printf "'%s'" "`printf %s "$1" | sed -e "s/'/'\\\\\\\\''/g"`"; printf "'%s'" "`printf %s "$1" | sed -e "s/'/'\\\\\\\\''/g"`";
} }
@ -88,6 +96,7 @@ make=make
instdir="$HOME/ocaml-tmp-install" instdir="$HOME/ocaml-tmp-install"
makefile=Makefile makefile=Makefile
configure=unix configure=unix
cleanup=false
case "$branch" in case "$branch" in
.) workdir="$jenkinsdir" .) workdir="$jenkinsdir"
@ -102,30 +111,43 @@ case "$arch" in
bsd) make=gmake ;; bsd) make=gmake ;;
macos) ;; macos) ;;
linux) ;; linux) ;;
cygwin) ;; cygwin)
cleanup=true;;
mingw) mingw)
instdir=/cygdrive/c/ocamlmgw instdir=/cygdrive/c/ocamlmgw
makefile=Makefile.nt makefile=Makefile.nt
configure=nt configure=nt
cleanup=true
;; ;;
mingw64) mingw64)
instdir=/cygdrive/c/ocamlmgw64 instdir=/cygdrive/c/ocamlmgw64
makefile=Makefile.nt makefile=Makefile.nt
configure=nt configure=nt
cleanup=true
;; ;;
msvc) msvc)
instdir=/cygdrive/c/ocamlms instdir=/cygdrive/c/ocamlms
makefile=Makefile.nt makefile=Makefile.nt
configure=nt configure=nt
cleanup=true
;; ;;
msvc64) msvc64)
instdir=/cygdrive/c/ocamlms64 instdir=/cygdrive/c/ocamlms64
makefile=Makefile.nt makefile=Makefile.nt
configure=nt configure=nt
cleanup=true
;; ;;
*) error "unknown architecture: $arch";; *) error "unknown architecture: $arch";;
esac esac
#########################################################################
# On Windows, cleanup processes that may remain from previous run
if $cleanup; then
tasks="tee ocamlrun program"
for task in ${tasks}; do kill_task ${task}.exe; done
fi
######################################################################### #########################################################################
# Go to the right directory # Go to the right directory