我有两个处于同一Jenkins文件中的阶段,要求是我要在阶段('AAA')中存储一个存储库,并从阶段('BBB')中的另一个kubernetes容器中取消存储
我遇到了如下所示的代码,经过许多小时的努力,我无法修复它。
stage('AAA') {
steps {
script {
// HERE WE CLONES MANY GIT REPOSITORIES into app directory
//Please repository is cloned to the {PWD}/app directory
}
dir('app') {
stash name: "sunnyday"
}
}
}
stage('BBB') {
agent {
kubernetes {
label "dotnet"
yaml """
apiVersion: v1
kind: Pod
metadata:
namespace: sandbox-test
spec:
containers:
- name: dotnet-core-sdk
image: mcr.microsoft.com/dotnet/core/sdk:2.2
imagePullPolicy: IfNotPresent
command:
- /bin/cat
tty: true
"""
}
}
steps {
container(name: "dotnet-core-sdk") {
unstash sunnyday
}
}
}