我正在嘗試通過Groovy配置Jenkins EC2-Plugin。 插件代碼:https://github.com/jenkinsci/ec2-plugin使用Groovy配置Jenkins EC2-Plugin
我試圖建立雲使用一個名稱上手
import hudson.model.*
import jenkins.model.*
import hudson.plugins.ec2.*
import com.amazonaws.services.ec2.model.*
SlaveTemplate awsTemplate = new SlaveTemplate(
'ami-1234567',
'',
'',
'sg-1234567',
't2.micro',
true,
'foo',
'',
'stuff',
'run code',
'/var/tmp',
'more code',
'4',
'',
'',
'',
false,
'subnet-1234567',
'',
'60',
false,
'',
'iam-profile',
false,
false,
'',
false,
'',
true,
false
)
def slaveTemplates = [awsTemplate]
def ec2Cloud = new AmazonEC2Cloud(
'foo',
true,
'',
'us-west-2',
'',
'10',
slaveTemplates
)
def cloudList = Jenkins.instance.clouds
cloudList.add(ec2Cloud)
任何想法?
這些都是錯誤信息
Error: Could not find matching constructor for: hudson.plugins.ec2.SlaveTemplate
或
Error: Could not find matching constructor for: hudson.plugins.ec2.AmazonEC2Cloud
見我有最好的答案 – jsmickey