SymphonyElectron/scripts/build-win64.bat

61 lines
1.8 KiB
Batchfile
Raw Normal View History

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"
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"
2019-08-28 09:05:10 -05:00
echo %PATH%
2019-08-28 09:05:10 -05:00
set DISABLE_REBUILD=true
set NODE_REQUIRED_VERSION=12.13.1
set SNYK_ORG=sda
set SNYK_PROJECT_NAME="Symphony Desktop Application"
2019-08-28 09:05:10 -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%
call nvm install %NODE_REQUIRED_VERSION%
call nvm use %NODE_REQUIRED_VERSION%
WHERE gulp
2019-08-28 09:30:29 -05:00
if %ERRORLEVEL% NEQ 0 (
echo "GULP does not exist. Installing it."
call npm i gulp -g
2019-08-28 09:05:10 -05:00
)
WHERE snyk
2019-08-28 09:30:29 -05:00
if %ERRORLEVEL% NEQ 0 (
echo "Snyk does not exist! Installing and setting it up"
call npm i snyk -g
2019-08-28 09:05:10 -05:00
)
echo "Setting snyk org to %SNYK_ORG% and api token to %SNYK_API_TOKEN%"
call snyk config set org=%SNYK_ORG%
call snyk config set api=%SNYK_API_TOKEN%
2019-08-28 09:05:10 -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
echo "Copying search libraries"
echo D | xcopy /y "C:\jenkins\workspace\tronlibraries\library" "library"
echo "Installing dependencies..."
call npm install
# Run Snyk Security Tests
echo "Running snyk security tests"
call snyk test --file=package-lock.json --org=%SNYK_ORG%
call snyk monitor --file=package-lock.json --org=%SNYK_ORG% --project-name=%SNYK_PROJECT_NAME%
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..."
call npm run unpacked-win