[英]Can we write user define functions in azure pipeline yaml file?
Can we write user define functions in azure pipeline yaml file ?我们可以在 azure 管道 yaml 文件中编写用户定义的函数吗?
That means I want to perform a specific task by using a function in any language like (PYTHON,SHELL,PERL etc), which should return the value after the execution of the code.这意味着我想通过使用任何语言(如 PYTHON、SHELL、PERL 等)中的函数来执行特定任务,该函数应在执行代码后返回值。
Yes you can, using Command Line Task :是的,您可以,使用命令行任务:
- script: # script path or inline
workingDirectory: #
displayName: #
failOnStderr: #
env: { string: string } # mapping of environment variables to add
@Geoffroy @杰弗里
Actually I don't want to do this through CMD task.其实我不想通过 CMD 任务来做到这一点。
Lets suppose I have written one function and stored it in some library and I want to call that function as a Azure tasks.假设我编写了一个函数并将其存储在某个库中,并且我想将该函数作为 Azure 任务调用。
for example:例如:
I have "function1" written in some file like :我在一些文件中写了“function1”,例如:
function1 (x y) {
return 1 ;
}
and I want to call function1 as a "Azure task"我想将 function1 称为“Azure 任务”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.