Change AWS configuration parameter name 69/134769/1
authorhyokeun <hyokeun.jeon@samsung.com>
Tue, 20 Jun 2017 04:02:41 +0000 (13:02 +0900)
committerhyokeun <hyokeun.jeon@samsung.com>
Tue, 20 Jun 2017 04:02:41 +0000 (13:02 +0900)
Change-Id: Icd3ebcfcf8e906bf6b2f9f228398c5054b05de05

groovy_init_scripts/Module_AmazonEC2Slave
groovy_init_scripts/Module_Node
groovy_init_scripts/init.groovy
groovy_init_scripts/setup.properties.example

index b2cac54..008b171 100755 (executable)
@@ -1,6 +1,6 @@
 
 // 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
@@ -23,6 +23,7 @@ def create_ec2_slave = { ami_id, availability_zone, security_groups, remote_fs,
       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
index 7f6b0de..2b3a55d 100755 (executable)
@@ -1,9 +1,9 @@
 
 // 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,
index 6b1dffb..4ac9de8 100755 (executable)
@@ -165,8 +165,7 @@ if (properties.NODES_LISTS != null && properties.NODES_LISTS != '') {
         sshHost        = configs[3],
         sshPort        = configs[4],
         sshCredentials = configs[5],
-        userId         = configs[6],
-        description    = name
+        userId         = configs[6]
     )
     instance.save()
   }
@@ -212,38 +211,39 @@ if (properties.RABBITMQ_SERVICE_URI != null && properties.RABBITMQ_SERVICE_URI !
 ///////////////////////////////////////////////////////////////////
 //////////////////////  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()
index b782e68..c610b1b 100755 (executable)
@@ -62,27 +62,28 @@ RABBITMQ_APP_ID=
 RABBITMQ_QUEUE_NAME=
 
 # AWS EC2 Cloud configuration
-EC2_CLOUD_NAME=
-EC2_CLOUD_CREDENTIALS_ID=
-EC2_CLOUD_REGION=
-EC2_CLOUD_INSTANCE_CAP=
-EC2_CLOUD_PRIV_KEY_TXT=
+AWS_CLOUD_NAME=
+AWS_CLOUD_CREDENTIALS_ID=
+AWS_CLOUD_REGION=
+AWS_CLOUD_INSTANCE_CAP=
+AWS_CLOUD_PRIV_KEY_TXT=
 
 # AWS EC2 ami configuraion for image worker
-AMI_ID=
-AV_ZONE=
-SECURITY_GROUPS=
-REMOTE_FS=
-INSTANCE_TYPE=
-WORKER_LABEL_STRING=
-WORKER_DESCRIPTION=
-NUMBER_OF_EXECUTORS=
-REMOTE_ADMIN=
-SUBNET_ID=
+EC2_AMI_ID=
+EC2_AV_ZONE=
+EC2_SECURITY_GROUPS=
+EC2_REMOTE_FS=
+EC2_INSTANCE_TYPE=
+EC2_LABEL_STRING=
+EC2_DESCRIPTION=
+EC2_NUMBER_OF_EXECUTORS=
+EC2_REMOTE_ADMIN=
+EC2_SUBNET_ID=
 EC2_TAG_NAME=
 EC2_TAG_ENV=
 EC2_TAG_HOSTNAME=
-IDLE_TERMINATION_MINUTES=
-INSTANCE_CAP_STR=
-LAUNCH_TIMEOUT=
+EC2_TAG_SOURCE=
+EC2_IDLE_TERMINATION_MINUTES=
+EC2_INSTANCE_CAP_STR=
+EC2_LAUNCH_TIMEOUT=