Bir dağıtım komut dosyası çalıştıran bir Octopus Tentacle'ım var. Tentacle, LocalSystem hesabı olarak çalışıyor.Octopus Deploy öğesinden alternatif kimlik bilgileriyle Powershell görevi
Komut dosyası içinde, bazı arşiv bitlerinden başka ihtiyacım olan her şeyi yapabiliyorum. Bir ağ paylaşımında olduğu için arşivin farklı alan adı kimlik bilgileri altında yapılması gerekiyor.
sinir bozucu bu kod aşağıda lokal çalışır, ancak dokunaçlarını kaçıp zaman, hata İşte
----------------------------------------------------[ Backup Nupkg ]---------------------------------------------------- Storing a backup version of GeoSphere.1.2.1.1722.nupkg for the Development environment
Error 09:24:32 [localhost] There is an error launching the
background process. Error Error 09:24:32 reported: Access is
denied. Error 09:24:32 At
C:\Octopus\Deployments\Development\GeoSphere\1.2.1.1722\deploy.ps1:121
Error 09:24:32 char:1 Error 09:24:32
+ Receive-Job $job Error 09:24:32
+ ~~~~~~~~~~~~~~~~ Error 09:24:32
+ CategoryInfo : OpenError: (localhost:String) [], PSRemotingTran Error 09:24:32 sportException Error 09:24:32
+ FullyQualifiedErrorId : -2147467259,PSSessionStateBroken Info 09:24:32 HasMoreData : False StatusMessage : Location :
localhost Command : Import-Module $args[3]
Backup-Nupkg $args[0] $args[1] $args[2]
JobStateInfo : Failed Finished : System.Threading.ManualResetEvent InstanceId :
0c031592-4c2a-4f8b-b014-a5ba79be09f7 Id : 1 Name :
Job1 ChildJobs : {Job2} PSBeginTime : 13/11/2014 9:24:30 AM
PSEndTime : 13/11/2014 9:24:31 AM PSJobTypeName : BackgroundJob
Output : {} Error : {} Progress : {} Verbose
: {} Debug : {} Warning : {} State : Failed
Fatal 09:24:32 PowerShell script returned a non-zero exit code: 1
Tentacle version 2.5.11.614
ile başarısız olduğunu kodunu
$pwd = convertto-securestring "[PASSWORD]" -asplaintext -force
$cred=new-object -typename System.Management.Automation.PSCredential -argumentlist "[DOMAIN\USER]",$pwd
$packageName = "GeoSphere.$Version.nupkg"
$backupPath = $($es.backupPath)
$artifactsPath = $($es.artifactsPath)
$job = Start-Job -ScriptBlock {
Import-Module $args[3]
Backup-Nupkg $args[0] $args[1] $args[2]
} -ArgumentList @($packageName,$backupPath,$artifactsPath,"$currentDir\modules\ApplicationUtilities") -Credential $cred
Wait-Job $Job
Receive-Job $job
İşte olmasıdır ApplicationUtilities
Modül
function Backup-Nupkg{
param(
[parameter(Mandatory=$true,position=0)] [string] $packageName,
[parameter(Mandatory=$true,position=1)] [string] $backupPath,
[parameter(Mandatory=$true,position=2)] [string] $artifactsPath
)
if(!(Test-Path $($backupPath))) {
md $($backupPath)
} else {
Remove-Item "$($backupPath)\*" -recurse -Force
}
Copy-Item $artifactsPath\$packageName $backupPath
}
Export-ModuleMember Backup-Nupkg
Bunu baştan çıkarmak için sihir numarası nedir? Yerel olarak yaptığı gibi Tentacle?
10 gibi işlemler gerçekleştirir. Ayrıca, Tentacle hizmetinin belirtilen kullanıcı olarak çalışmasını denedim, ancak daha sonra başka bir anahtarı karmaşa atan bir IIS yapılandırma sorunu alıyorum. Bu etkili olayla ilgili sorunlar acı verici. –