슬레이브에서 Jenkins 작업을 실행할 때이 콘솔 출력이 표시됩니다. 작업은 파일을 만들어 c:\foo\services.csv
에 넣어야합니다.슬레이브에서 powershell 명령을 실행하십시오. - Jenkins
Get-Service | Export-CSV c:\foo\service.csv
참고이 콘솔 출력에 단어 "우회"여기
은 작업 PowerShell 명령입니다. 나는 그것을 지나갈 수 없다.[AnonymousJWTApi] $ powershell.exe를 -NonInteractive -ExecutionPolicy 있으며 ByPass "& 'C : \ 사용자 \ XXX \의 AppData \ 로컬 \ 임시 \의 hudson1582303083838020200.ps1'"
나는 그것이 문제라고 생각합니다
온라인에서 슬레이브의 마스터에 앉아 스크립트를 실행할 때 오류가 발생하는 것으로 나타났습니다.
그래서 나는 수동으로 슬레이브에 스크립트를 만들고 c:\foo\listServices.ps1
에 넣었습니다. 그런 다음 Jenkins (마스터)에서이 명령은 슬레이브에서 실행됩니다. “C:\foo\listServices.ps1”
슬레이브에서 직접 실행되도록 스크립트를 호출합니다.
여전히 동일한 콘솔 출력을 얻고 있습니다 ... "바이 패스"에 대한 무언가가 여전히 작동하지 않는 것으로 보입니다. csv 파일이 foo 폴더에 저장되지 않습니다. 작동하지 못하게하는 우회 장치입니까? 그렇다면 해결책은 무엇입니까?
그리고 전체 콘솔 출력 :
Started by user anonymous
Building remotely on slave1 in workspace C:\Jenkins\Master\workspace\AnonymousJWTApi
> git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url C:\Users\xxx\Source\Repos\AnonymousJWTApi # timeout=10
Fetching upstream changes from C:\Users\xxx\Source\Repos\AnonymousJWTApi
> git.exe --version # timeout=10
> git.exe -c core.askpass=true fetch --tags --progress C:\Users\xxx\Source\Repos\AnonymousJWTApi +refs/heads/*:refs/remotes/origin/*
Seen branch in repository origin/master
Seen 1 remote branch
Checking out Revision a7087f81af855cc96b8763a5ec66b96c19a44a30 (origin/master)
> git.exe config core.sparsecheckout # timeout=10
> git.exe checkout -f a7087f81af855cc96b8763a5ec66b96c19a44a30
> git.exe rev-list a7087f81af855cc96b8763a5ec66b96c19a44a30 # timeout=10
[AnonymousJWTApi] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass "& 'C:\Users\xxx\AppData\Local\Temp\hudson1582303083838020200.ps1'"
Finished: SUCCESS
편집 : 파일이 마스터에 저장지고 ... : P
노예가 PowerShell 스크립트를 호스트하기위한 것이 아닙니다 보인다 또는 내가 알지 못했던 그들의 산출물.
슬레이브에 로그인하여 수동으로 해당 명령을 실행하려 했습니까? 무슨 일이야? –
@ChrisN 네, 그 일을 할 때 작동합니다 – BeniaminoBaggins