Create New Item - Freestyle

Introduction

On this method we have created a Node on the stage or production server where we need our code to get deployed (Windows). This is basically to avoid using FTP or SFTP for code deployment as it might take more time and also we need credentials and FTP servers for the deployment

Step 1 - Create a Freestyle project ( Please refer Jenkins for creating different project type )

image-1618390324249.png

 

Step 2 - SVN or GIT connection as per your requirement.

image-1618390333958.png

 

You got to install Visual Studio Build on the respective Node Server for us to create the Build Step. Use Visual Studio community version.

Step 3 - Build.

image-1618390341916.png

Step 4 - ROBOCOPY or Deploy the code to the IIS.
set SOURCE=D:\jenkins\workspace\COLS365_Web_Application\Branch\DskyWebPortal\
set DESTINATION=C:\Hostingdata\DEVL\ColsWebPortal
set EXCLUDEFOLDER="D:\jenkins\workspace\COLS365_Web_Application\Branch\DskyWebPortal\fileupload"


robocopy /XO /E /Z /ZB /R:5 /W:5 /TBD /NP /MT:64 %SOURCE% %DESTINATION% /XD %EXCLUDEFOLDER% *. /XA:SH /XF *.CONFIG *.config *.svn-base
@echo robocopy exit code: %ERRORLEVEL%
@if %ERRORLEVEL% GTR 3 ( echo robocopy ERROR )
@if %ERRORLEVEL% GTR 3 ( exit %ERRORLEVEL% )
@set ERRORLEVEL=0