在部署包之后,我尝试从PowerShell脚本启动.net核心应用程序:
<section class="services pt-5">
<div class="class50">
<div class="svg-content">
<div class="shape1 flip">
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1083.06 1721.53">
<defs>
<style>
.cls-1 {
fill: #10a2bd;
}
</style>
</defs>
<path id="Shape_3_copy" data-name="Shape 3 copy" class="cls-1" d="M1082.36-4.17-.69,884.2l1083.06,833.16" transform="translate(0.69 4.17)"></path>
</svg>
</div>
<div class="class50_content">
<h2>Morbi vesti...</h2>
<h3>Sed sagittis diam eu purus dictum</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Commodi sed recusandae in sunt fugit eveniet ratione facere quis consequatur! Nihil quia obcaecati quam aspernatur odio labore vero doloribus cupiditate sed.</p>
<a href="#" class="btn btn-2">Read More</a>
</div>
</div>
</div>
<div class="class50">
<h2>Test 123</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta nemo, harum tempore quasi quae, tempora eveniet officiis labore iste natus atque aliquam ab quia optio sequi voluptatibus molestiae architecto, quos.</p>
</div>
</section>
程序没有启动,看起来原因是当前目录不是我的预期。在阅读文档后,我的假设是将当前目录设置为解压缩已部署包的文件夹。情况似乎并非如此...我使用Start-Process "dotnet" -WindowStyle Hidden -ArgumentList "xxx.dll"
记录了当前目录并获得了(Get-Item -Path ".\").FullName
这似乎是一个临时文件夹。
如何从已部署的软件包访问库?
答案 0 :(得分:1)
如果您的脚本处于同一步骤,则(Get-Location).Path
应该没问题
但是,如果您想保持单独的步骤,那么您需要通过章鱼变量访问,例如:
$OctopusParameters['Octopus.Action[YOUR_STEP_NAME].Output.Package.InstallationDirectoryPath']
或者,如果您安装到自定义目录,则:
$OctopusParameters['Octopus.Action[YOUR_STEP_NAME].Package.CustomInstallationDirectory']