我正在尝试创建一个Jenkins管道,用户将从他推送到github的一个傲慢的定义中创建一个资源,触发管道将其部署到API管理器上,但我始终得到以下错误:
Error... stat /var/lib/jenkins/workspace/my_pipeline/apis/SwaggerPetstore-1.0.0: no such file or directory这是我的管道定义,我已经坚持了好几天了,不知道该怎么做
pipeline {
agent {
node {
label 'node'
}
}
environment {
PATH = "/root/apictl:$PATH"
}
options {
buildDiscarder logRotator(
daysToKeepStr: '16',
numToKeepStr: '10'
)
}
stages {
stage('Setup Environment for APICTL') {
steps {
sh """#!/bin/bash
ENVCOUNT=\$(apictl get envs --format {{.}} | wc -l)
if [ "\$ENVCOUNT" == "0" ]; then
apictl add env dev --apim https://am.wso2.com --registration https://am.wso2.com --token https://websub.am.wso2.com/token -k
fi
"""
}
}
stage('Deploy APIs To "Dev" Environment') {
steps {
sh """
apictl set --export-directory /var/lib/jenkins/workspace/my_pipeline
apictl set --vcs-deployment-repo-path /var/lib/jenkins/workspace/my_pipeline
apictl set --vcs-config-path /var/lib/jenkins/workspace/gitconfig
apictl get envs
apictl login dev -u admin -p admin -k
apictl vcs deploy -e dev -k --verbose
"""
}
}
}
}发布于 2022-07-13 13:24:32
https://stackoverflow.com/questions/72921489
复制相似问题