在此我们将共享库托管在git上,在jenkins中设置如下: 使用“shared-library”命名 默认使用master分支调用 Jenkinsfile 需要使用 @Library 注解, 指定库的名字 其中需要使用“@Library('shared-library') _”来引入共享库。 #cat Jenkinsfile @Library('shared-library') _ pipeline { options { ansiColor('xterm') {} steps { script { println "import shared-library
概述 Jenkins shared-library 也就是流水线共享库,使用 Groovy 编写,用于封装 Jenkins 流水线(Pipeline)脚本(Jenkinsfile)中的通用逻辑。
Jenkinsfile 文件内容 因为采用pipeline script from SCM构建方式,所以用Declarative Pipeline方式在Jenkinsfile中编写构建脚本: @Library('shared-library
程序的子程序代码 -v #打印gcc编译时的详细步骤信息 编译和路径参数 -l[basic library] #编译时指定要使用的基础库,样例:-lpthread,针对Posix线程共享库进行编译 -L[shared-library
uncorrected 8 Operational error 16 Usage or syntax error 32 Checking canceled by user request 128 Shared-library
具体代码如下: //引入jenkins扩展共享库 @Library('shared-library') _ pipeline { agent any options {
specify "no" here. setgid_group: [postdrop] Please specify the final destination directory for Postfix shared-library
Operational error 16 Usage or syntax error 32 Checking canceled by user request 128 Shared-library
Operational error 16 Usage or syntax error 32 Checking canceled by user request 128 Shared-library