Ich habe Oktopus Variablen unter „Library“ -> „Variable Sets“ Variablen mit NamenOctopus Ausgangsgrößen und den Zugriff auf sie
1. DatabaseExceptions
2. ReportsExceptions
3. ApplicationExceptions
Und ich habe Setup meines Projekts „Deployment-Prozess“ in Krake als Schritte
1. Database
2. Reports
3. Application
4. Send Email
die obige Variable sind mit Ausnahmen unter Verwendung von ‚Power‘ Skripte gesetzt, die auf Ausnahmen in Skripten predeploy.ps1 des bestimmten Schritt aufgerufen werden.
Im letzten Schritt (E-Mail senden) habe ich versucht, eine E-Mail mit den Informationen in Ausnahmevariablen zu senden, indem überprüft wird, ob eine bestimmte Variable Informationen enthält.
ich dies in der E-Mail schicken Schritt Körper mache, indem Sie das Kontrollkästchen Überprüfung („Body als HTML“)
<h2>Deployment Steps</h2>
<ol>
#{each step in Octopus.Step}
#{if step.Status.Code}
<li>#{step | HtmlEscape} —
#{if Step.Name == "Database"}
#{if Octopus.Action[Database].Output.DatabaseExceptions}
<pre>#{Octopus.Action[Database].Output.DatabaseExceptions}</pre>
#{/if}
#{/if}
#{if Step.Name == "Reports"}
#{if Octopus.Action[Reports].Output.ReportsExceptions}
<pre>#{Octopus.Action[Reports].Output.ReportsExceptions}</pre>
#{/if}
#{/if}
#{if Step.Name == "Application"}
#{if Octopus.Action[Application].Output.ApplicationExceptions}
<pre>#{Octopus.Action[Application].Output.ApplicationExceptions}</pre>
#{/if}
#{/if}
</li>
#{/if}
#{/each}
</ol>
Die Datenbank und Berichte Skripte hat Fehler und meine Ausgabe sieht wie folgt unter dem korrekt ist wie
erwartetDeployment Steps
1. Database — Exception on processing DB scripts - info:...
2. Reports — Exception on processing Reports - info:...
3. Application
4. Send Email
Und meine Frage:
Ist es möglich, etwas wie unten als mein Schritt Name und Start meiner Variablennamen sind die gleichen
<h2>Deployment Steps</h2>
<ol>
#{each step in Octopus.Step}
#{if step.Status.Code}
<li>#{step | HtmlEscape} —
#{if Octopus.Action[#{step.Name}].Output.#{step.Name}Exceptions}
<pre>#{Octopus.Action[#{step.Name}].Output.#{step.Name}Exceptions}</pre>
#{/if}
</li>
#{/if}
#{/each}
</ol>
Hallo Alex, ich bin wirklich traurig über die späte Antwort. Ich weiß Ihre Antwort sehr zu schätzen, was mir bei der Änderung meiner E-Mail-Benachrichtigung hilfreich ist. Nochmals vielen Dank für die Lösung. –