У меня есть проект, который выглядит так:
project
|
├───src
│ Utility.groovy
│
└───vars
pipeline.groovy
script.ps1
В pipeline.groovy
У меня есть служебный объект:
def util = new Utility(this)
и шаг, который вызывает util.scriptCall(arg1: "1", arg2: "2", arg3: "3")
, который определяется как:
this.context.powershell returnStdout: true, script: ".\\script.ps1 -Arg1 ${args.arg1} -Arg2 ${args.arg2} -Arg3 ${args.arg3} -Workspace ${this.context.env.workspace}"
Из всего, что я обнаружил, якобы вызываю это правильно, однако я получаю следующую ошибку:
.\script.ps1 : The term '.\script.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
У меня установлен плагин Powershell, но отсутствие документации по всем вопросам, связанным с Дженкинсом, не помогает. Я переместил script.ps1
в папку src
и даже попытался создать для этого папку scripts
с теми же результатами.
Есть идеи, почему мой вызов сценария интерпретируется как командлет?