52 lines
2.5 KiB
Batchfile
52 lines
2.5 KiB
Batchfile
@echo off
|
|
REM SCript di creazione e compilazione versioen per test in macchina
|
|
|
|
REM Check parameters
|
|
REM IF "%1"=="" GOTO ShowHelp
|
|
|
|
REM :MsBuild
|
|
|
|
:Npm
|
|
cd wwwroot
|
|
REM install moduli npm
|
|
IF "%1"=="y" (
|
|
echo %date%-%time% START npm install >> c:\tmp\Script.log
|
|
powershell.exe npm install
|
|
echo %date%-%time% END npm install >> c:\tmp\Script.log
|
|
)
|
|
|
|
REM: compilazione npm
|
|
IF "%2"=="y" (
|
|
echo %date%-%time% Start file replace >> c:\tmp\Script.log
|
|
REM replace seriate server dev (seriate.steamware.net) --> produzione (locahost)
|
|
powershell.exe "((Get-Content -path index.html -Raw) -replace 'seriate.steamware.net','localhost') | Set-Content -Path index.html"
|
|
powershell.exe "((Get-Content -path config.development.json -Raw) -replace 'seriate.steamware.net','localhost') | Set-Content -Path config.development.json"
|
|
powershell.exe "((Get-Content -path config.production.json -Raw) -replace 'seriate.steamware.net','localhost') | Set-Content -Path config.production.json"
|
|
|
|
REM build pacchetti npm
|
|
echo %date%-%time% START npm run build >> c:\tmp\Script.log
|
|
npm run build
|
|
echo %date%-%time% END npm run build >> c:\tmp\Script.log
|
|
)
|
|
|
|
:Copy
|
|
cd ..
|
|
REM copio wwwroot --> view
|
|
echo %date%-%time% Start copy >> c:\tmp\Script.log
|
|
|
|
robocopy C:\Users\samuele\Documents\VisualStudio\cms_thermo_active\Thermo.Active\wwwroot C:\Users\samuele\Documents\VisualStudio\cms_thermo_active\Thermo.Active\bin\view /MIR /Z /LOG:C:\tmp\ViewMirror.log /XF *.babelrc .bowerrc .editorconfig bower.json compilerconfig.json* package*.json tsconfig.json webpack.config.js /XD C:\Users\samuele\Documents\VisualStudio\cms_thermo_active\Thermo.Active\wwwroot\node_modules C:\Users\samuele\Documents\VisualStudio\cms_thermo_active\Thermo.Active\wwwroot\src
|
|
|
|
robocopy C:\Users\samuele\Documents\VisualStudio\cms_thermo_active\Thermo.Active\bin\ C:\Users\samuele\Desktop\ThermoActive\ /MIR /Z /LOG:C:\tmp\ThermoMirror.log /XD C:\Users\samuele\Documents\VisualStudio\cms_thermo_active\Thermo.Active\bin\wwwroot C:\Users\samuele\Documents\VisualStudio\cms_thermo_active\Thermo.Active\bin\Client_Debug
|
|
echo %date%-%time% END copy >> c:\tmp\Script.log
|
|
|
|
|
|
REM :Compress
|
|
echo "%date%-%time% START zip" >> c:\tmp\Script.log
|
|
powershell.exe Compress-Archive -Path C:\Users\samuele\Desktop\ThermoActive -DestinationPath "C:\Users\samuele\Desktop\ThermoActive_%3.zip"
|
|
echo "%date%-%time% END zip" >> c:\tmp\Script.log
|
|
|
|
:ShowHelp
|
|
REM echo makeTestVersion n n vers_number - i primi 2 parametri sono y/n per indicare se eseguire npm install ed npm build, il terzo è il nome versione da accodare a zip
|
|
|
|
|
|
@echo on |