Angular + Jenkins + IIS
echo "======solution dircectory======";
ls;
echo "======building version======";
$versionDate=Get-Date -Format 'yyyyMMddHHmmss';
echo "v$versionDate";
$appPublishPath="H:\devops\memberportal\v$versionDate\publish";
$iisSiteName="Default Web Site/memberportal/";
echo "======change api.config.ts======";
cd .\src\app\services\api-services\;
Remove-Item ./api.config.ts -Recurse;
Rename-Item ./api.config.Staging.ts api.config.ts;
echo "======change success======";
echo "======begin restore packages======";
cd ../../../../;
npm install;
echo "======restore success======";
echo "======begin build code source======";
ng build --prod --aot --build-optimizer --extract-css --vendor-chunk=true --base-href ./ --output-path=$appPublishPath 2>$null;
echo "======build success======";
echo "======go to publish direcctory======";
pushd $appPublishPath;
pushd C:\WINDOWS\system32\inetsrv;
echo "======change iis dir======";
./appcmd set vdir $iisSiteName -physicalPath:$appPublishPath;
echo "======change success======";
echo "======restart iis site======";
./appcmd stop site $iisSiteName;
./appcmd start site $iisSiteName;
echo "======restart success======";
echo "The Application is running......";
如果您觉得本文对你有用,不妨帮忙点个赞,或者在评论里给我一句赞美,小小成就都是今后继续为大家编写优质文章的动力,百小僧拜谢!
欢迎您持续关注我的博客:)
版权所有,欢迎保留原文链接进行转载:)