简体   繁体   English

我们可以在 azure 管道 yaml 文件中编写用户定义函数吗?

[英]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.

相关问题 我们可以使用 Azure Devops Global 通知在 azure devops 管道中的邮件上发送自定义成功消息的日志吗? - Can we send log of custom success message on mail in azure devops pipeline by using Azure Devops Global notification? 我们可以编写一个简单的bash脚本来以root用户身份自动登录吗 - can we write a simple bash script to automatically login as root user 我们如何使用sed命令在文件中写入\\ n? - how can we use sed command to write \n in a file? 我们可以创建具有其他用户和组所有权的文件或目录吗 - Can we create a file or directory with other user and group ownership 我们可以写入 jiffies 变量吗 - Can we write to jiffies variable 我们可以使用 fgets()、fputs()、feof() 等函数来执行操作吗? 像我们用于普通文件一样的fifo文件? - can we perform the operation using functions like fgets(), fputs(), feof(),etc. for the fifo file like we use for the normal file? 如何在 gitlab-ci.yaml 文件中编写循环? - How to write loops in gitlab-ci.yaml file? 我们可以在内核中打开文件之前检查文件的读写权限吗? - can we check a file's read write permission before opening it in kernel 我们可以使用Java访问(开放读写)驱动程序文件/ dev / aaa吗? - Can we access(open-read/write) driver file /dev/aaa using java? 如何确保缓存以减少SQLite数据库的文件系统写入周期 - how we can ensure caching to reduce file-system write cycle for SQLite databases
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM