salt/pkg/windows/build.bat

53 lines
1.6 KiB
Batchfile
Raw Normal View History

2016-08-09 19:53:55 +00:00
@echo off
@echo Salt Windows Build Script
@echo ------------------------------------------------------------------
@echo.
2016-02-12 18:37:49 +00:00
:: Make sure the script is run as Admin
2016-08-09 19:53:55 +00:00
@echo Administrative permissions required. Detecting permissions...
2016-02-12 18:37:49 +00:00
net session >nul 2>&1
if %errorLevel%==0 (
echo Success: Administrative permissions confirmed.
) else (
echo Failure: This script must be run as Administrator
goto eof
)
:: Define Variables
2016-07-06 22:18:01 +00:00
@echo %0 :: Defining Variables...
2016-08-09 19:53:55 +00:00
@echo ------------------------------------------------------------------
2016-02-12 18:37:49 +00:00
Set "PyDir=C:\Python27"
Set "CurDir=%~dp0"
Set PATH=%PATH%;C:\Python27;C:\Python27\Scripts
2016-02-12 18:37:49 +00:00
for /f "delims=" %%a in ('git rev-parse --show-toplevel') do @set "SrcDir=%%a"
2016-08-04 17:58:00 +00:00
:: Get the version from git if not passed
2016-02-12 18:37:49 +00:00
if [%1]==[] (
for /f "delims=" %%a in ('git describe') do @set "Version=%%a"
) else (
set "Version=%~1"
)
:: Create Build Environment
PowerShell.exe -ExecutionPolicy RemoteSigned -File "%CurDir%build_env.ps1" -Silent
2016-02-12 18:37:49 +00:00
2016-07-06 22:18:01 +00:00
if not %errorLevel%==0 (
echo "%CurDir%build_env.ps1" returned errorlevel %errorLevel%. Aborting %0
goto eof
)
2016-02-12 18:37:49 +00:00
:: Install Current Version of salt
2016-08-09 19:53:55 +00:00
@echo %0 :: Install Current Version of salt...
@echo ------------------------------------------------------------------
"%PyDir%\python.exe" "%SrcDir%\setup.py" --quiet install --force
2016-02-12 18:37:49 +00:00
:: Build the Salt Package
2016-08-09 19:53:55 +00:00
@echo %0 :: Build the Salt Package...
@echo ------------------------------------------------------------------
2016-02-12 18:37:49 +00:00
call "%CurDir%build_pkg.bat" "%Version%"
:eof
2016-07-06 22:18:01 +00:00
2016-08-09 19:53:55 +00:00
@echo End of %0
@echo ------------------------------------------------------------------