Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I can think of four different solutions:</p> <ol> <li><p>Have a network share on the production machine that your Jenkins server can put a trigger file into. Have a scheduled task that checks for that file and triggers the download.</p></li> <li><p>Have a scheduled task on the production machine poll the Jenkins server for new files. Powershell can be used to query the Jenkins REST api.</p></li> <li><p>If the production machine has IIS, get Jenkins to trigger an asp.net script, do a form POST to a cgi script, or upload a trigger file. curl and wget on CentOS will help there.</p></li> <li><p>As a last resort, add another windows machine into the mix. Install SSH onto it. Use SSH from Jenkins to the new machine, then powershell from the new machine to the production machine.</p></li> </ol> <p>If you decide on step 4, I use Power Shell to run commands on a remote machine.</p> <p>PS2.0 is installed on Windows 2008 R2 by default.</p> <p>Here is an example of how I do it.</p> <pre><code>$username = 'user' $password = 'password' $appHost = 'hostname' $dest = 'C:\Unpack\' $archive = "C:\Releases\new release.7z" $securePass = ConvertTo-SecureString -AsPlainText $password -Force $cred = New-Object System.Management.Automation.PSCredential -ArgumentList $username,$securePass "Create PowerShell Session" $appSession = New-PSSession -ComputerName $appHost -Credential $cred -Authentication CredSSP invoke-command -session $appSession -scriptblock { param($dest,$archive) &amp; 'C:\Program Files (x86)\7-Zip\7z.exe' x -bd -aoa """-oc:\$dest""" """c:\$dest\$archive"""} -args $dest,$archive $remotelastexitcode = invoke-command -session $appSession -ScriptBlock { $lastexitcode } if ( $remotelastexitcode -ne 0 ) { "Archive Extraction Failed. Is a file locked or open?" exit -1 } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload