Continuous Integration ~ Jenkins builds GitHub project implementation, jenkinsgithub
With the basis of the previous two lectures, we can now implement the github project in CI (jenkins) so that it can be automatically integrated and deployed for continuous integration ~ NuGet and MSBuild plug-ins in Jenkins, continuous integration ~ The powershell plug-in Jenkins has released a remote site. The procedure is as follows.
Perform jenkins operations
Http: // localhost: 8080/
Both the user and password are admin
Add work item
Add a free-style project
Add description
Add Source Code address and enter the account and password
Select git. If you use svn, select subversion. This depends on the actual situation.
Add nuget package recovery support
Restore and restore third-party referenced bags
Add msbuild compilation and release support
Compile and release your project to the specified position. This is an optional plug-in jenkins and can be expanded for installation.
Add powershell remote copy support
Powershell is a new tool language in the Microsoft environment. It is similar to the sh script but is more powerful than the latter. The following code project copies the directories on the original server to the target server, they use the net use command
$ RemoteDirPath = "\ DESKTOP-9KAK340 \ remote" Write-Host 'connect to the remote Host... 'Net use $ remoteDirPath "zzl"/user: "lind" Write-host' recursively copy a file (forced overwrite mode )... '$ files = Get-ChildItem-Path "C: \ Jenkins_Publish" # obtain the file foreach ($ file in $ files) {Copy-Item-Path $ file in the local directory. fullName-Destination $ remoteDirPath-Include "*"-Exclude ""-Recurse-Force} Write-host' directory copy is complete! '
Build a running project
You can run the build manually and automatically. To run the build automatically, You need to configure the corresponding cron script.
After the build is complete, we can see logs of success or failure, or output logs of the console, which are very friendly.
Thank you for reading this article!
Our research on CI persistent integration will continue!