// Configure EC2 cloud auto-scailing workers
-def create_ec2_slave = { ami_id, availability_zone, security_groups, remote_fs, instance_type, labels, description, num_executors, remote_user, subnet_id, tag_name, tag_env, tag_hostname, idle_termination, instance_cap, launch_timeout, ec2_workers ->
+def create_ec2_slave = { ami_id, availability_zone, security_groups, remote_fs, instance_type, labels, description, num_executors, remote_user, subnet_id, tag_name, tag_env, tag_hostname, tag_source, idle_termination, instance_cap, launch_timeout, ec2_workers ->
def worker_ami = new hudson.plugins.ec2.SlaveTemplate(
ami_id, // AMI ID
availability_zone, // Availability Zone
subnet_id, // Subnet ID for VPC
[ new hudson.plugins.ec2.EC2Tag('Name', tag_name), // Tags
new hudson.plugins.ec2.EC2Tag('env', tag_env),
+ new hudson.plugins.ec2.EC2Tag('source', tag_source),
new hudson.plugins.ec2.EC2Tag('hostname', tag_hostname) ],
idle_termination, // Idle termination time
false, // Use private NDS
// Configure Slaves
-def create_slave_node = { instance, name, remoteFS, numExecutors, labelString, sshHost, sshPort, sshCredentials, userId, description ->
+def create_slave_node = { instance, name, remoteFS, numExecutors, labelString, sshHost, sshPort, sshCredentials, userId ->
def myLauncher = new hudson.plugins.sshslaves.SSHLauncher(sshHost, sshPort.toInteger(), sshCredentials, null, null, null, null, 0, 0, 0);
def slave = new hudson.slaves.DumbSlave(name,
- description,
+ '',
remoteFS,
numExecutors,
hudson.model.Node.Mode.EXCLUSIVE,
sshHost = configs[3],
sshPort = configs[4],
sshCredentials = configs[5],
- userId = configs[6],
- description = name
+ userId = configs[6]
)
instance.save()
}
///////////////////////////////////////////////////////////////////
////////////////////// Amazon EC2 Cloud /////////////////////////
///////////////////////////////////////////////////////////////////
-if (properties.EC2_CLOUD_NAME != null && properties.EC2_CLOUD_NAME != '') {
- logger.info('++++ SET AWS WORKERS ' + properties.AMI_ID);
+if (properties.AWS_CLOUD_NAME != null && properties.AWS_CLOUD_NAME != '') {
+ logger.info('++++ SET AWS WORKERS ' + properties.EC2_AMI_ID);
def ec2_workers = []
def create_ec2_slave = e('Module_AmazonEC2Slave')
def create_ec2_cloud = e('Module_AmazonEC2Cloud')
create_ec2_slave(
- ami_id = properties.AMI_ID,
- availability_zone = properties.AV_ZONE,
- security_groups = properties.SECURITY_GROUPS,
- remote_fs = properties.REMOTE_FS,
- instance_type = properties.INSTANCE_TYPE,
- labels = properties.WORKER_LABEL_STRING,
- description = properties.WORKER_DESCRIPTION,
- num_executors = properties.NUMBER_OF_EXECUTORS,
- remote_user = properties.REMOTE_ADMIN,
- subnet_id = properties.SUBNET_ID,
+ ami_id = properties.EC2_AMI_ID,
+ availability_zone = properties.EC2_AV_ZONE,
+ security_groups = properties.EC2_SECURITY_GROUPS,
+ remote_fs = properties.EC2_REMOTE_FS,
+ instance_type = properties.EC2_INSTANCE_TYPE,
+ labels = properties.EC2_LABEL_STRING,
+ description = properties.EC2_DESCRIPTION,
+ num_executors = properties.EC2_NUMBER_OF_EXECUTORS,
+ remote_user = properties.EC2_REMOTE_ADMIN,
+ subnet_id = properties.EC2_SUBNET_ID,
tag_name = properties.EC2_TAG_NAME,
tag_env = properties.EC2_TAG_ENV,
tag_hostname = properties.EC2_TAG_HOSTNAME,
- idle_termination = properties.IDLE_TERMINATION_MINUTES,
- instance_cap = properties.INSTANCE_CAP_STR,
- launch_timeout = properties.LAUNCH_TIMEOUT,
+ tag_source = properties.EC2_TAG_SOURCE,
+ idle_termination = properties.EC2_IDLE_TERMINATION_MINUTES,
+ instance_cap = properties.EC2_INSTANCE_CAP_STR,
+ launch_timeout = properties.EC2_LAUNCH_TIMEOUT,
ec2_workers = ec2_workers
)
create_ec2_cloud(
instance = j,
- cloud_name = properties.EC2_CLOUD_NAME,
- cloud_credentials_id = properties.EC2_CLOUD_CREDENTIALS_ID,
- cloud_region = properties.EC2_CLOUD_REGION,
- cloud_priv_key = properties.EC2_CLOUD_PRIV_KEY_TXT,
- cloud_instance_cap = properties.EC2_CLOUD_INSTANCE_CAP,
+ cloud_name = properties.AWS_CLOUD_NAME,
+ cloud_credentials_id = properties.AWS_CLOUD_CREDENTIALS_ID,
+ cloud_region = properties.AWS_CLOUD_REGION,
+ cloud_priv_key = properties.AWS_CLOUD_PRIV_KEY_TXT,
+ cloud_instance_cap = properties.AWS_CLOUD_INSTANCE_CAP,
ec2_workers = ec2_workers
)
instance.save()