2019-08-28 09:05:10 -05:00
|
|
|
:: Check to ensure that the VSDev command prompt is in the below location
|
|
|
|
echo "Starting VSDev Command Prompt"
|
2019-08-27 06:08:26 -05:00
|
|
|
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"
|
2019-08-28 09:05:10 -05:00
|
|
|
|
2019-08-27 06:08:26 -05:00
|
|
|
echo %PATH%
|
|
|
|
|
2019-08-28 09:05:10 -05:00
|
|
|
set DISABLE_REBUILD=true
|
|
|
|
|
2019-08-27 06:08:26 -05:00
|
|
|
set PATH=%PATH%;C:\Program Files\nodejs\;C:\Program Files\Git\cmd
|
|
|
|
echo %PATH%
|
|
|
|
|
|
|
|
set PATH=%PATH%;C:\Program Files (x86)\GnuWin32\bin
|
|
|
|
echo %PATH%
|
|
|
|
|
2019-08-28 09:05:10 -05:00
|
|
|
WHERE git
|
2019-08-28 09:30:29 -05:00
|
|
|
if %ERRORLEVEL% NEQ 0 (
|
2019-08-28 09:05:10 -05:00
|
|
|
echo "GIT does not exist. Please set it up before running this script."
|
|
|
|
EXIT /B 1
|
|
|
|
)
|
|
|
|
|
|
|
|
WHERE node
|
2019-08-28 09:30:29 -05:00
|
|
|
if %ERRORLEVEL% NEQ 0 (
|
2019-08-28 09:05:10 -05:00
|
|
|
echo "NODE does not exist. Please set it up before running this script."
|
|
|
|
EXIT /B 1
|
|
|
|
)
|
|
|
|
|
|
|
|
WHERE npm
|
2019-08-28 09:30:29 -05:00
|
|
|
if %ERRORLEVEL% NEQ 0 (
|
2019-08-28 09:05:10 -05:00
|
|
|
echo "NPM does not exist. Please set it up before running this script."
|
|
|
|
EXIT /B 1
|
|
|
|
)
|
|
|
|
|
|
|
|
WHERE gulp
|
2019-08-28 09:30:29 -05:00
|
|
|
if %ERRORLEVEL% NEQ 0 (
|
2019-08-28 09:05:10 -05:00
|
|
|
echo "GULP does not exist. Please set it up before running this script."
|
|
|
|
EXIT /B 1
|
|
|
|
)
|
|
|
|
|
2019-08-27 06:08:26 -05:00
|
|
|
:: Below command replaces buildVersion with the appropriate build number from jenkins
|
|
|
|
sed -i -e "s/\"buildNumber\"[[:space:]]*\:[[:space:]]*\".*\"/\"buildNumber\":\"%PARENT_BUILD_VERSION%\"/g" package.json
|
|
|
|
|
2019-08-28 09:05:10 -05:00
|
|
|
:: Copy search libraries onto the project root
|
2019-08-27 06:08:26 -05:00
|
|
|
echo "Copying search libraries"
|
|
|
|
echo D | xcopy /y "C:\jenkins\workspace\tronlibraries\library" "library"
|
|
|
|
|
|
|
|
echo "Running npm install..."
|
|
|
|
call npm install
|
|
|
|
|
|
|
|
call npm i -g gulp-cli
|
|
|
|
|
2019-08-28 09:05:10 -05:00
|
|
|
:: Set expiry if required
|
2019-08-28 09:30:29 -05:00
|
|
|
IF "%EXPIRY_PERIOD%"=="" (
|
2019-08-28 09:05:10 -05:00
|
|
|
echo "Not setting expiry for the build!"
|
|
|
|
) else (
|
|
|
|
echo "Setting expiry to days: %EXPIRY_PERIOD%"
|
|
|
|
call gulp setExpiry --period %EXPIRY_PERIOD%
|
|
|
|
)
|
|
|
|
|
|
|
|
echo "Running tests, code coverage, linting and building..."
|
2019-08-27 06:08:26 -05:00
|
|
|
call npm run unpacked-win
|