Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>We have done this by setting up an ASPX on our daily build and QA websites that triggers a publish. The build then has a Powershell call to trigger this. We've done this with CruiseControl, TeamCity, and Team Build.</p> <h2>TeamCity Configuration</h2> <p>The configuration for TeamCity uses an additional build step after you've deployed files and TDS:</p> <ol> <li><strong>Runner Type:</strong> Powershell</li> <li><strong>Step name:</strong> Trigger Publish to Web DB</li> <li><strong>Powershell run mode:</strong> x64</li> <li><strong>Working Directory:</strong> [no value]</li> <li><strong>Script:</strong> Source code</li> <li><p><strong>Script Source:</strong> </p> <p>$r = [System.Net.WebRequest]::Create('http://myqasite/SomePath/Publish.aspx'); $resp = $r.GetResponse();</p></li> <li><strong>Script execution mode:</strong> Put script into Powershell stdin with "-Command -" arguments</li> </ol> <h2>Publish.aspx</h2> <p>The code for our Publish page is something like this:</p> <pre><code> string full = Request.QueryString["full"]; // Set up the publish mode PublishMode publishMode = PublishMode.Smart; if (!string.IsNullOrWhiteSpace(full) &amp;&amp; (full == "1" || full.Equals("true", StringComparison.InvariantCultureIgnoreCase)) ) { publishMode = PublishMode.Full; } using (new Sitecore.SecurityModel.SecurityDisabler()) { //We need the target database var webDb = Sitecore.Configuration.Factory.GetDatabase("web"); //source db var masterDb = Sitecore.Configuration.Factory.GetDatabase("master"); try { foreach (Language language in masterDb.Languages) { //loops on the languages and do a full republish on the whole sitecore content tree var options = new PublishOptions(masterDb, webDb, publishMode, language, DateTime.Now) {RootItem = masterDb.Items["/sitecore"], RepublishAll = true, Deep = true}; var myPublisher = new Publisher(options); myPublisher.Publish(); } } catch (Exception ex) { Sitecore.Diagnostics.Log.Error("Could not publish the master database to the web", ex); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    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