Jenkins- configure automated deployment (Jenkins + Gitlab + IIS) on windows

Jenkins- configure automated deployment (Jenkins + Gitlab + IIS) on windows

Sample web deployment

 

 Sample windows service deployment

 

 

 

 

 

 

System Backup

.Ps1 create a suffix on the file server, for example: BackUpDir_MKCurtain.ps1

Content Reference:

param($pathFrom,$pathTo)
#目标目录
$pathTo = $pathTo+"\bak"+(Get-Date -Format 'yyyyMMddHHmmss'); 
write-host("SourcePath is: " + $pathFrom);  
write-host("TargetPath is: " + $pathTo);  
#创建目标目录 
mkdir -Pa $pathTo;   
if (!(Test-path -path $pathFrom)){  
  write-host("SourcePath is not exist!");  
  exit -1;  
}  
$pathCopyTo = "";  
$pathFromLen = $pathFrom.Length;  
$LenGap = 0;  
ls -r $pathFrom  |Foreach-Object{ 
     if(!($_.FullName -match  ".*\\log")) {
        if(!($_.FullName -match  ".*\\jpg")) 
        {
            $lenGap = $_.FullName.Length - $pathFromLen - $_.Name.Length - 1;  
            $pathCopyTo =  $PathTo + $_.FullName.Substring($pathFromLen, $lenGap); 
            if(!(Test-path -path $pathCopyTo)){ 
                mkdir -Pa $pathCopyTo;  
            }  
            copy-item $_.FullName $pathCopyTo -Force;  
        }    
    }
}  
write-host("Copy Finish!");  
exit 0;  

 

Guess you like

Origin www.cnblogs.com/1285026182YUAN/p/11909553.html