我正在编写一个Jenkins管道Groovy脚本来构建映像。我想构建一个映像并使用此Jenkins管道在EC2中运行一些docker命令。 我在管道下面写了
pipeline {
agent none
stages {
stage ('image-build')
steps{
withAWS(region: 'us-east-1',roleaccount: 9441982XX,role:
'Jenkins')
{
sh """
mkdir jenkins
ls -a
"""
}
}
}
}
但是我遇到了错误
WorkflowScript: 4: Expected a stage @ line 4,column 5.
stage ('image-build')
^
WorkflowScript: 5: Expected a stage @ line 5,column 8.
steps{
^
WorkflowScript: 3: No stages specified @ line 3,column 5.
stages {
^
3 errors
at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassnodes(CompilationUnit.java:1085)
a