Continuous integration The PowerShell plugin in ~jenkins publishes the remote site.

Source: Internet
Author: User

By adding a PowerShell plugin, the published package is pushed to a specific application server using its powerful Windows system commands.

System Management-Plug-in management-powershell

Install it, restart Jenkins, and then modify your previous job to add the PowerShell push file script

Add a build type that is added below MSBuild

The above PS code function is to use the account for remote login, will send data to the shared folder, overwriting its previous files, this operation requires us to configure the application server, as follows:

1 Create an Account

2 assign this account to the IIS Web site Directory

Then using our code, you can remotely push the remote this time.

$remoteDirPath ="\\DESKTOP-9KAK340\remote"Write-host'Connect to remote host ...'net use $remoteDirPath"Zzl"/USER:"Lind"Write-host'recursive copy file (forced overwrite mode) ...'$files= Get-childitem-path"C:\Jenkins_Publish"# Get the files in the local directoryforeach($fileinch$files) {Copy-item-path $file. Fullname-destination $remoteDirPath-include"*"-exclude""-recurse-Force } Write-host'Catalog Copy complete! '

Thanks for reading!

Continuous integration The PowerShell plugin in ~jenkins publishes the remote site.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.