Trying to pull all of the various build scripts out of the jenkins definitions and store them into one or more scripts in the source repository.
Some of the scripts are shell scripts, some are batch files. A shell script starts it off by running c:\program files\git\git-bash.exe and performing some git commands (no, I am not using the plugin - not my jenkins server and I have been given the most restrictive, minimal access to do this work, so I am going to run git commands from a script file). Some other work is done too to set variables, configure files for the build, etc.
The problem I am having, is trying to run a batch file from that shell script.
In jenkins, I have one shell script to kick off the process (with three parameters passed as arguments):
#!c:\Program Files\Git\git-bash.exe
/f/git/project/builds/step1.sh $MASTER_BRANCH $BUILD_TYPE $TAG_CLIENT
The step1.sh script works its way down to
# Override Jenkins value
WORKSPACE=/f/git/project
WIN_WORKSPACE=`cygpath -w $WORKSPACE | sed 's/\\\\/\\\\\\\\/g'`
echo "WIN_WORKSPACE: $WIN_WORKSPACE"
...
echo "Building!"
echo cmd.exe /c call builds\\step2.bat $WIN_WORKSPACE
cmd.exe /c call builds\\step2.bat $WIN_WORKSPACE
echo "done building"
What happens, is that the cmd.exe (with or without the "call" keyword) just pops out to a command prompt and sits there until I type "exit":
Building!
cmd.exe /c call builds\step2.bat F:\\git\\project
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
F:\git\project>exit <--- I have to type that.
exit
done building
Is it possible to run batch files from git-bash shells? Is there a better approach? I am in the process of trying to convert to a batch file, but the syntax (for things like capturing command output and storing to a variable) is nicer with shell scripts. I also need to run at least a couple of shell (expect) scripts later in the build process for communicating with another server to complete another portion of the build.