I'm trying to set up a barebones roundhousE setup, with a few touches. I'm trying to make the values used by roundhousE set in one central location, instead of each deployment batch script (which is a pain in the arse). However, when I reference the SetupVal.bat
from each deployment batch, it sets the values but just stops executing the deployment script. I'm not sure why it doesn't carry on, and it's really annoying me.
This is my SetupVal.bat
:
SET product.name="####"
SET database.name="%product.name%.DB"
SET sql.files.directory="..\db\SQLServer"
SET server.database="(local)\SQLEXPRESS"
SET repository.path="git@roconnor:%product.name%.git"
SET version.file="_BuildInfo.xml"
SET version.xpath="//buildInfo/version"
SET environment="LOCAL"
this is one of my scripts (the Local.DBDeployment.bat
):
@echo off
cd ..
SetupVal.bat
cd deployment
REM this is to make sure the path is correctly set out
"%cd%\Console\rh.exe" /d=%database.name% /f=%sql.files.directory% /s=%server.database% /vf=%version.file% /vx=%version.xpath% /r=%repository.path% /env=%environment% /simple
pause
This is the output when I run Local.DBDeployment.bat
:
C:\dev\Database>SetupValues.bat
C:\dev\Database>SET product.name="####"
C:\dev\Database>SET database.name=""####".DB"
C:\dev\Database>SET sql.files.directory="..\db\SQLServer"
C:\dev\Database>SET server.database="(local)\SQLEXPRESS"
C:\dev\Database>SET repository.path="git@roconnor:"####".git"
C:\dev\Database>SET version.file="_BuildInfo.xml"
C:\dev\Database>SET version.xpath="//buildInfo/version"
C:\dev\Database>SET environment="LOCAL"
And finally, this is my directory structure:
Database (root)
|
\_db (SQL scripts are here)
|_deployment (bat scripts are here)
|_settings (ignoring contents)
|_SetupVal.bat (This sets the values)
when you execute SetupVal.bat
, control is given to that file. there is no return, so if setval.bat
ends, the complete batch-structure ends. Instead call your file:
call SetupVal.bat
Your initial batchfile will continue with the next line, when setupval.bat
ends and returns control