You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by is...@apache.org on 2013/08/27 09:26:32 UTC

git commit: removing hello directory & the scripts, re-naming default/wso2-openstack-init.sh to stratos-openstack-init.sh and defaults/wso2.pem to stratos.pem

Updated Branches:
  refs/heads/master 615a9268b -> d81971d09


removing hello directory & the scripts, re-naming default/wso2-openstack-init.sh to stratos-openstack-init.sh and defaults/wso2.pem to stratos.pem


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/d81971d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/d81971d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/d81971d0

Branch: refs/heads/master
Commit: d81971d09a6a365f25492f767e8da6e1015a9ea5
Parents: 615a926
Author: Isuru <is...@wso2.com>
Authored: Tue Aug 27 12:55:29 2013 +0530
Committer: Isuru <is...@wso2.com>
Committed: Tue Aug 27 12:55:29 2013 +0530

----------------------------------------------------------------------
 .../default/stratos-openstack-init.sh           |  57 +++++
 .../init_scripts/default/stratos.pem            |  16 ++
 .../init_scripts/default/wso2-openstack-init.sh |  57 -----
 .../init_scripts/default/wso2.pem               |  16 --
 .../init_scripts/hello/ec2/get-launch-params.rb |  34 ---
 .../hello/ec2/wso2-cartridge-init.sh            | 235 -------------------
 tools/cartridge_create/init_scripts/hello/hello |  23 --
 .../init_scripts/hello/hello.ctrg               |  21 --
 .../hello/openstack/get-launch-params.rb        |  35 ---
 .../hello/openstack/wso2-cartridge-init.sh      | 230 ------------------
 10 files changed, 73 insertions(+), 651 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d81971d0/tools/cartridge_create/init_scripts/default/stratos-openstack-init.sh
----------------------------------------------------------------------
diff --git a/tools/cartridge_create/init_scripts/default/stratos-openstack-init.sh b/tools/cartridge_create/init_scripts/default/stratos-openstack-init.sh
new file mode 100644
index 0000000..7e8430a
--- /dev/null
+++ b/tools/cartridge_create/init_scripts/default/stratos-openstack-init.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+# ----------------------------------------------------------------------------
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+# ----------------------------------------------------------------------------
+export LOG=/var/log/wso2-openstack.log
+instance_path=/var/lib/cloud/instance
+
+if [ ! -d ${instance_path}/payload ]; then
+
+    echo "creating payload dir ... " >> $LOG
+    mkdir ${instance_path}/payload
+    echo "payload dir created ... " >> $LOG
+    cp ${instance_path}/user-data.txt ${instance_path}/payload/user-data.zip
+    echo "payload copied  ... "  >> $LOG
+    unzip -d ${instance_path}/payload ${instance_path}/payload/user-data.zip
+    echo "unzippeddd..." >> $LOG
+
+    for i in `/usr/bin/ruby /opt/get-launch-params.rb`
+    do
+    echo "exporting to bashrc $i ... " >> $LOG
+        echo "export" ${i} >> /home/ubuntu/.bashrc
+    done
+    source /home/ubuntu/.bashrc
+    # Write a cronjob to execute wso2-openstack-init.sh periodically until public ip is assigned
+    #crontab -l > ./mycron
+    #echo "*/${CRON_DURATION} * * * * /opt/wso2-openstack-init.sh > /var/log/wso2-openstack-init.log" >> ./mycron
+    #crontab ./mycron
+    #rm ./mycron
+
+fi
+
+
+
+for i in `/usr/bin/ruby /opt/get-launch-params.rb`
+do
+    export ${i}
+done
+
+echo "Done" >> $LOG
+# ========================== // End of script ===========================================================

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d81971d0/tools/cartridge_create/init_scripts/default/stratos.pem
----------------------------------------------------------------------
diff --git a/tools/cartridge_create/init_scripts/default/stratos.pem b/tools/cartridge_create/init_scripts/default/stratos.pem
new file mode 100644
index 0000000..7b2155e
--- /dev/null
+++ b/tools/cartridge_create/init_scripts/default/stratos.pem
@@ -0,0 +1,16 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQDUdNzv8oHkA8Zn28iQH2qyiV7ZJlBITqp4iw21ZbuyhFtDw2c0
+7euC/g4zbdLjAO4Wofn03C9LSA8KcWKYz4ubaKd+6xG/ywTW2QDRFdGDUY6Dwvkj
+3vnLlPWqvRBpF8ZclkeIjX6svydRvov3F6BSsbYY3trm9PlMtsZq/jtswwIDAQAB
+AoGAEJTqZYPc5WnyA0shFTaOgk68a2BVJb+WCIB52m2NP7qa0OggVv42wmuHujXZ
+HsSE0Jllw9mni02ddugwlNKmB5+z2yiJoGkuaFhFNwB4xFjjujRwMf7ZtoDpa8Yo
+SS1f94dswB31kT601HcUyCEwRBfD9pYBduysFZ1I3/ozVukCQQDs1Lm+LvmZQgLa
+BaWqU73MShDypiyMHVyKwnDUu/zaHu+9r15z/UHroU2nRIRteNv77nUmHsQVHKOc
+0QpmEsT3AkEA5acVolx+4mSCe4ZXh1R9hHZ+HdRrvC2yBiZhHe3bHbcyBN+oPMF4
+OcUE2JsE2+IIJomC5B/v6vjsf67yCFo/lQJAfm+jKjGR94wSUasqIqDKd0IjgifN
+KJCUU1AzRJ+IAjr56t6xImNWyiE3f9FIkdkwOHO5/zv1mv/LKXFAh/YFSQJBAMKE
+MWjiW366j2K9OWohAGewTcZKZC5xrfZTj7LgAtY6kx1Zq5A6dvDHlgE53HW6EBlE
+JB/BhV9LFFZaAhtdBbkCQQDrx9X5f/Lbe39kx5UMtvYrswpYjbKW+qRoQ38NryYA
+G7rRPsgmrjURSEeH4VUG//7gV8wGze7cl50luI2T8+Kg
+-----END RSA PRIVATE KEY-----
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d81971d0/tools/cartridge_create/init_scripts/default/wso2-openstack-init.sh
----------------------------------------------------------------------
diff --git a/tools/cartridge_create/init_scripts/default/wso2-openstack-init.sh b/tools/cartridge_create/init_scripts/default/wso2-openstack-init.sh
deleted file mode 100644
index 7e8430a..0000000
--- a/tools/cartridge_create/init_scripts/default/wso2-openstack-init.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/bash
-
-# ----------------------------------------------------------------------------
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-
-# ----------------------------------------------------------------------------
-export LOG=/var/log/wso2-openstack.log
-instance_path=/var/lib/cloud/instance
-
-if [ ! -d ${instance_path}/payload ]; then
-
-    echo "creating payload dir ... " >> $LOG
-    mkdir ${instance_path}/payload
-    echo "payload dir created ... " >> $LOG
-    cp ${instance_path}/user-data.txt ${instance_path}/payload/user-data.zip
-    echo "payload copied  ... "  >> $LOG
-    unzip -d ${instance_path}/payload ${instance_path}/payload/user-data.zip
-    echo "unzippeddd..." >> $LOG
-
-    for i in `/usr/bin/ruby /opt/get-launch-params.rb`
-    do
-    echo "exporting to bashrc $i ... " >> $LOG
-        echo "export" ${i} >> /home/ubuntu/.bashrc
-    done
-    source /home/ubuntu/.bashrc
-    # Write a cronjob to execute wso2-openstack-init.sh periodically until public ip is assigned
-    #crontab -l > ./mycron
-    #echo "*/${CRON_DURATION} * * * * /opt/wso2-openstack-init.sh > /var/log/wso2-openstack-init.log" >> ./mycron
-    #crontab ./mycron
-    #rm ./mycron
-
-fi
-
-
-
-for i in `/usr/bin/ruby /opt/get-launch-params.rb`
-do
-    export ${i}
-done
-
-echo "Done" >> $LOG
-# ========================== // End of script ===========================================================

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d81971d0/tools/cartridge_create/init_scripts/default/wso2.pem
----------------------------------------------------------------------
diff --git a/tools/cartridge_create/init_scripts/default/wso2.pem b/tools/cartridge_create/init_scripts/default/wso2.pem
deleted file mode 100644
index 7b2155e..0000000
--- a/tools/cartridge_create/init_scripts/default/wso2.pem
+++ /dev/null
@@ -1,16 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXQIBAAKBgQDUdNzv8oHkA8Zn28iQH2qyiV7ZJlBITqp4iw21ZbuyhFtDw2c0
-7euC/g4zbdLjAO4Wofn03C9LSA8KcWKYz4ubaKd+6xG/ywTW2QDRFdGDUY6Dwvkj
-3vnLlPWqvRBpF8ZclkeIjX6svydRvov3F6BSsbYY3trm9PlMtsZq/jtswwIDAQAB
-AoGAEJTqZYPc5WnyA0shFTaOgk68a2BVJb+WCIB52m2NP7qa0OggVv42wmuHujXZ
-HsSE0Jllw9mni02ddugwlNKmB5+z2yiJoGkuaFhFNwB4xFjjujRwMf7ZtoDpa8Yo
-SS1f94dswB31kT601HcUyCEwRBfD9pYBduysFZ1I3/ozVukCQQDs1Lm+LvmZQgLa
-BaWqU73MShDypiyMHVyKwnDUu/zaHu+9r15z/UHroU2nRIRteNv77nUmHsQVHKOc
-0QpmEsT3AkEA5acVolx+4mSCe4ZXh1R9hHZ+HdRrvC2yBiZhHe3bHbcyBN+oPMF4
-OcUE2JsE2+IIJomC5B/v6vjsf67yCFo/lQJAfm+jKjGR94wSUasqIqDKd0IjgifN
-KJCUU1AzRJ+IAjr56t6xImNWyiE3f9FIkdkwOHO5/zv1mv/LKXFAh/YFSQJBAMKE
-MWjiW366j2K9OWohAGewTcZKZC5xrfZTj7LgAtY6kx1Zq5A6dvDHlgE53HW6EBlE
-JB/BhV9LFFZaAhtdBbkCQQDrx9X5f/Lbe39kx5UMtvYrswpYjbKW+qRoQ38NryYA
-G7rRPsgmrjURSEeH4VUG//7gV8wGze7cl50luI2T8+Kg
------END RSA PRIVATE KEY-----
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d81971d0/tools/cartridge_create/init_scripts/hello/ec2/get-launch-params.rb
----------------------------------------------------------------------
diff --git a/tools/cartridge_create/init_scripts/hello/ec2/get-launch-params.rb b/tools/cartridge_create/init_scripts/hello/ec2/get-launch-params.rb
deleted file mode 100644
index b369b4c..0000000
--- a/tools/cartridge_create/init_scripts/hello/ec2/get-launch-params.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /usr/bin/ruby
-
-### get-launch-params.rb
-
-# The following script obtains the launch parameters from 
-# the file /tmp/payload/launch-params, then parses out the 
-# parameters for this instance by using the launch index
-# of this particular EC2 instance.
-#
-# Pass the command the -e flag to output the instance 
-# parameters as exports of shell variables. Any other 
-# arguments are ignored.
-
-def get_launch_params(launch_params_file)
-  IO.readlines launch_params_file
-end
-
-export_stmt = ""
-
-launch_params = get_launch_params(
-  "/opt/payload/launch-params")
-
-if launch_params.length > 0
-  instance_params_str = launch_params[0]
-
-  instance_params = instance_params_str.split(',')
-
-  export_stmt = "export " if ARGV.length > 0 && ARGV.include?("-e")
-
-  instance_params.each { |param|
-    puts export_stmt + param
-  }
-
-end

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d81971d0/tools/cartridge_create/init_scripts/hello/ec2/wso2-cartridge-init.sh
----------------------------------------------------------------------
diff --git a/tools/cartridge_create/init_scripts/hello/ec2/wso2-cartridge-init.sh b/tools/cartridge_create/init_scripts/hello/ec2/wso2-cartridge-init.sh
deleted file mode 100644
index 5756996..0000000
--- a/tools/cartridge_create/init_scripts/hello/ec2/wso2-cartridge-init.sh
+++ /dev/null
@@ -1,235 +0,0 @@
-#!/bin/bash
-
-# ----------------------------------------------------------------------------
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-
-# ----------------------------------------------------------------------------
-export LOG=/var/log/wso2-cartridge.log
-instance_path=/opt
-PUBLIC_IP=""
-KEY=`uuidgen`
-CRON_DURATION=1
-RETRY_COUNT=30
-SLEEP_DURATION=3
-
-
-if [ ! -d ${instance_path}/payload ]; then
-
-    echo "creating payload dir ... " >> $LOG
-    mkdir ${instance_path}/payload
-    echo "payload dir created ... " >> $LOG
-    wget http://169.254.169.254/latest/user-data -O ${instance_path}/payload/payload.zip    
-    echo "payload copied  ... "  >> $LOG
-    unzip -d ${instance_path}/payload ${instance_path}/payload/payload.zip
-    echo "unzippeddd..." >> $LOG
-
-    for i in `/usr/bin/ruby /opt/get-launch-params.rb`
-    do
-    echo "exporting to bashrc $i ... " >> $LOG
-        echo "export" ${i} >> /home/ubuntu/.bashrc
-    done
-    source /home/ubuntu/.bashrc
-
-fi
-
-
-echo ---------------------------- >> $LOG
-echo "getting public ip from metadata service" >> $LOG
-
-wget http://169.254.169.254/latest/meta-data/public-ipv4
-files="`cat public-ipv4`"
-if [[ -z ${files} ]]; then
-    echo "getting public ip" >> $LOG
-    for i in {1..30}
-    do
-      rm -f ./public-ipv4
-      wget http://169.254.169.254/latest/meta-data/public-ipv4
-      files="`cat public-ipv4`"
-      if [ -z $files ]; then
-          echo "Public ip is not yet assigned. Wait and continue for $i the time ..." >> $LOG
-          sleep $SLEEP_DURATION
-      else
-          echo "Public ip assigned" >> $LOG
-          break
-      fi
-    done
-
-    if [ -z $files ]; then
-      echo "Public ip is not yet assigned. So exit" >> $LOG
-      exit 0
-    fi
-    for x in $files
-    do
-        PUBLIC_IP="$x"
-    done
-
-
-else 
-   PUBLIC_IP="$files"
-fi
-
-
-for i in `/usr/bin/ruby /opt/get-launch-params.rb`
-do
-    export ${i}
-done
-
-echo "Logging sys variables .. PUBLIC_IP:${PUBLIC_IP}, HOST_NAME:${HOST_NAME}, KEY:${KEY}, PORTS=${PORTS}, BAM:${BAM_IP}, GITREPO:${GIT_REPO}" >> $LOG
-
-mkdir -p  /etc/agent/conf
-
-echo "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:agen=\"http://service.agent.cartridge.carbon.wso2.org\">
-  <soapenv:Header/>
-  <soapenv:Body>
-     <agen:register>
-        <registrant> 
-           <alarmingLowerRate>${ALARMING_LOWER_RATE}</alarmingLowerRate>
-           <alarmingUpperRate>${ALARMING_UPPER_RATE}</alarmingUpperRate>
-           <hostName>${HOST_NAME}</hostName>
-           <key>${KEY}</key>
-          <maxInstanceCount>${MAX}</maxInstanceCount>
-      <maxRequestsPerSecond>${MAX_REQUESTS_PER_SEC}</maxRequestsPerSecond>
-          <minInstanceCount>${MIN}</minInstanceCount> " > /etc/agent/conf/request.xml
-
-IFS='|' read -ra PT <<< "${PORTS}"
-for i in "${PT[@]}"; do
-IFS=':' read -ra PP <<< "$i"
-echo "          <portMappings>
-                        <primaryPort>${PP[1]}</primaryPort>
-                        <proxyPort>${PP[2]}</proxyPort>
-                        <type>${PP[0]}</type>
-                </portMappings>">> /etc/agent/conf/request.xml
-done
-
-echo "          <remoteHost>${PUBLIC_IP}</remoteHost>
-           <service>${SERVICE}</service>
-       <remoteHost>${PUBLIC_IP}</remoteHost>
-           <roundsToAverage>${ROUNDS_TO_AVERAGE}</roundsToAverage>
-           <scaleDownFactor>${SCALE_DOWN_FACTOR}</scaleDownFactor>
-           <tenantRange>${TENANT_RANGE}</tenantRange>
-        </registrant>
-     </agen:register>
-  </soapenv:Body>
-</soapenv:Envelope>
-" >> /etc/agent/conf/request.xml
-
-echo "Creating repoinfo request  " >> $LOG
-echo "TENANT_ID and SERVICE ${TENANT_ID} and ${SERVICE} " >> $LOG
-set -- "${HOST_NAME}" 
-IFS="."; declare -a Array=($*)
-ALIAS="${Array[0]}"
-echo "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://org.apache.axis2/xsd\">
-   <soapenv:Header/>
-   <soapenv:Body>
-      <xsd:getRepositoryCredentials>
-         <xsd:tenantId>${TENANT_ID}</xsd:tenantId>
-         <xsd:cartridgeType>${SERVICE}</xsd:cartridgeType>
-         <xsd:alias>${ALIAS}</xsd:alias>
-      </xsd:getRepositoryCredentials>
-   </soapenv:Body>
-</soapenv:Envelope>" > /opt/repoinforequest.xml
-
-echo "Repoinfo request created " >> $LOG
-
-echo "Private Key....Copying to .ssh  " >> $LOG
-
-cp ${instance_path}/payload/id_rsa /root/.ssh/id_rsa
-chmod 0600 /root/.ssh/id_rsa
-echo "StrictHostKeyChecking no" >> /root/.ssh/config
-
-
-cp -f ${instance_path}/payload/ssl-cert-snakeoil.pem /etc/ssl/certs/ssl-cert-snakeoil.pem
-cp -f ${instance_path}/payload/ssl-cert-snakeoil.key /etc/ssl/private/ssl-cert-snakeoil.key
-
-/etc/init.d/apache2 restart
-
-echo "Sending register request to Cartridge agent service" >> $LOG
-
-curl -X POST -H "Content-Type: text/xml" -H "SOAPAction: urn:register" -d @/etc/agent/conf/request.xml -k --silent --output /dev/null "${CARTRIDGE_AGENT_EPR}"
-
-#echo "Getting repo username password from repoInfoService" >> $LOG
-#curl -X POST -H "Content-Type: text/xml" -d @/etc/agent/conf/request.xml --silent --output /dev/null "${CARTRIDGE_AGENT_EPR}"
-
-echo "Git repo sync" >> $LOG
-
-# If repo is available do a git pull, else clone
-echo "#!/bin/bash
-if [ -d \"${APP_PATH}/.git\" ]; then
-    cd ${APP_PATH}
-    
-    curl -X POST -H \"Content-Type: text/xml\" -H \"SOAPAction: urn:getRepositoryCredentials\" -d @/opt/repoinforequest.xml --silent  \"${REPO_INFO_EPR}\" --insecure > /tmp/git.xml
-   sed '1,5d' /tmp/git.xml > /tmp/git1.xml
-   sed '2d' /tmp/git1.xml > /tmp/git.xml
-   username=\`xml_grep 'ax211:userName' /tmp/git.xml --text_only\`
-   password=\`xml_grep 'ax211:password' /tmp/git.xml --text_only\`
-   repo=\`xml_grep 'ax211:url' /tmp/git.xml --text_only\`
-   rm /tmp/git1.xml
-   rm /tmp/git.xml
-   url=\`echo \$repo |sed 's/http.*\/\///g' |sed 's/\:.*//g' |sed 's/\/.*//g'\`
-   echo \"machine \${url} login \${username} password \${password}\" > ~/.netrc
-   sudo echo \"machine \${url} login \${username} password \${password}\" > /root/.netrc
-   chmod 600 ~/.netrc
-   sudo chmod 600 /root/.netrc
-   sudo git pull
-   rm ~/.netrc
-   sudo rm /root/.netrc
-
-    sudo chown -R www-data:www-data ${APP_PATH}/www
-    if [ -f \"${APP_PATH}/sql/alter.sql\" ]; then
-        mysql -h ${MYSQL_HOST} -u ${MYSQL_USER} -p${MYSQL_PASSWORD} < ${APP_PATH}/sql/alter.sql
-    fi
-else
-    sudo rm -f ${APP_PATH}/index.html
-   curl -X POST -H \"Content-Type: text/xml\" -H \"SOAPAction: urn:getRepositoryCredentials\" -d @/opt/repoinforequest.xml --silent  \"${REPO_INFO_EPR}\" --insecure > /tmp/git.xml
-   sed '1,5d' /tmp/git.xml > /tmp/git1.xml
-   sed '2d' /tmp/git1.xml > /tmp/git.xml
-   username=\`xml_grep 'ax211:userName' /tmp/git.xml --text_only\`
-   password=\`xml_grep 'ax211:password' /tmp/git.xml --text_only\`
-   repo=\`xml_grep 'ax211:url' /tmp/git.xml --text_only\`
-   rm /tmp/git1.xml
-   rm /tmp/git.xml
-   url=\`echo \$repo |sed 's/http.*\/\///g' |sed 's/\:.*//g' |sed 's/\/.*//g'\`
-   echo \"machine \${url} login \${username} password \${password}\" > ~/.netrc
-   sudo echo \"machine \${url} login \${username} password \${password}\" > /root/.netrc
-   chmod 600 ~/.netrc
-   sudo chmod 600 /root/.netrc
-   sudo git clone \${repo} ${APP_PATH}
-   rm ~/.netrc
-   sudo rm /root/.netrc
- 
-
-    if [ -f \"${APP_PATH}/sql/init.sql\" ]; then
-        mysql -h ${MYSQL_HOST} -u ${MYSQL_USER} -p${MYSQL_PASSWORD} < ${APP_PATH}/sql/init.sql
-    fi
-    echo \"SetEnv STRATOS_MYSQL_USER ${MYSQL_USER}
-    SetEnv STRATOS_MYSQL_HOST ${MYSQL_HOST}
-    SetEnv STRATOS_MYSQL_PASSWORD ${MYSQL_PASSWORD}
-    \" > /tmp/.htaccess
-    sudo mv /tmp/.htaccess ${APP_PATH}/
-    sudo chown -R www-data:www-data ${APP_PATH}/www
-    
-
-
-fi" > /opt/git.sh
-echo "File created.." >> $LOG
-chmod 755 /opt/git.sh
-echo "running git clone........" >> $LOG
-su - ubuntu /opt/git.sh
-
-
-# ========================== // End of script ===========================================================

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d81971d0/tools/cartridge_create/init_scripts/hello/hello
----------------------------------------------------------------------
diff --git a/tools/cartridge_create/init_scripts/hello/hello b/tools/cartridge_create/init_scripts/hello/hello
deleted file mode 100644
index f7c9910..0000000
--- a/tools/cartridge_create/init_scripts/hello/hello
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-INSTANCE=$1
-INSTANCE_USER=$2
-KEY=$3
-SOFTWARE=$4
-
-SCP="scp -i ./$KEY"
-SSH="ssh -i ./$KEY"
-
-$SCP ./openstack/wso2-cartridge-init.sh $INSTANCE_USER@$INSTANCE:
-$SCP ./hello.ctrg $INSTANCE_USER@$INSTANCE:
-$SCP ./openstack/get-launch-params.rb $INSTANCE_USER@$INSTANCE:
-$SCP ./ $INSTANCE_USER@$INSTANCE:
-
-# Copy additional software
-arr=$(echo $SOFTWARE | tr ":" "\n")
-for x in $arr
-do
-   $SCP $x $INSTANCE_USER@$INSTANCE:
-done
-
-# Execute the cartridge creation process in the remoter server
-$SSH $INSTANCE_USER@$INSTANCE "sudo chmod 755 ./hello.ctrg;sudo ./hello.ctrg"

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d81971d0/tools/cartridge_create/init_scripts/hello/hello.ctrg
----------------------------------------------------------------------
diff --git a/tools/cartridge_create/init_scripts/hello/hello.ctrg b/tools/cartridge_create/init_scripts/hello/hello.ctrg
deleted file mode 100644
index 36ea603..0000000
--- a/tools/cartridge_create/init_scripts/hello/hello.ctrg
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-mv ./wso2-cartridge-init.sh /opt/
-mv ./get-launch-params.rb /opt/
-mv ./*.tar.gz /opt/
-mv ./*.zip /opt/
-
-# In the following section you will install necessary software for your cartridge. Since this is a demo cartridge
-# we will just create a file called hello_world in /home/ubuntu folder
-
-echo "hello world" > hello_world
-
-#apt-get update
-#apt-get install nano
-
-    echo "#!/bin/bash -e
-chmod 755 /opt/wso2-cartridge-init.sh
-/opt/wso2-cartridge-init.sh > /var/log/wso2-cartridge-init.log
-exit 0
-    " > /etc/rc.local
-
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d81971d0/tools/cartridge_create/init_scripts/hello/openstack/get-launch-params.rb
----------------------------------------------------------------------
diff --git a/tools/cartridge_create/init_scripts/hello/openstack/get-launch-params.rb b/tools/cartridge_create/init_scripts/hello/openstack/get-launch-params.rb
deleted file mode 100755
index 068e6c6..0000000
--- a/tools/cartridge_create/init_scripts/hello/openstack/get-launch-params.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /usr/bin/ruby
-
-### get-launch-params.rb
-
-# The following script obtains the launch parameters from 
-# the file /tmp/payload/launch-params, then parses out the 
-# parameters for this instance by using the launch index
-# of this particular EC2 instance.
-#
-# Pass the command the -e flag to output the instance 
-# parameters as exports of shell variables. Any other 
-# arguments are ignored.
-
-def get_launch_params(launch_params_file)
-  IO.readlines launch_params_file
-end
-
-export_stmt = ""
-
-launch_params = get_launch_params(
-  "/var/lib/cloud/instance/payload/launch-params")
-
-if launch_params.length > 0
-  instance_params_str = launch_params[0]
-
-  instance_params = instance_params_str.split(',')
-
-  export_stmt = "export " if ARGV.length > 0 && ARGV.include?("-e")
-
-  instance_params.each { |param|
-    puts export_stmt + param
-  }
-
-end
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d81971d0/tools/cartridge_create/init_scripts/hello/openstack/wso2-cartridge-init.sh
----------------------------------------------------------------------
diff --git a/tools/cartridge_create/init_scripts/hello/openstack/wso2-cartridge-init.sh b/tools/cartridge_create/init_scripts/hello/openstack/wso2-cartridge-init.sh
deleted file mode 100644
index 0128131..0000000
--- a/tools/cartridge_create/init_scripts/hello/openstack/wso2-cartridge-init.sh
+++ /dev/null
@@ -1,230 +0,0 @@
-#!/bin/bash
-
-# ----------------------------------------------------------------------------
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-
-# ----------------------------------------------------------------------------
-export LOG=/var/log/wso2-cartridge.log
-instance_path=/var/lib/cloud/instance
-PUBLIC_IP=""
-KEY=`uuidgen`
-CRON_DURATION=1
-RETRY_COUNT=30
-SLEEP_DURATION=3
-
-
-if [ ! -d ${instance_path}/payload ]; then
-
-    echo "creating payload dir ... " >> $LOG
-    mkdir ${instance_path}/payload
-    echo "payload dir created ... " >> $LOG
-    cp ${instance_path}/user-data.txt ${instance_path}/payload/user-data.zip
-    echo "payload copied  ... "  >> $LOG
-    unzip -d ${instance_path}/payload ${instance_path}/payload/user-data.zip
-    echo "unzippeddd..." >> $LOG
-
-    for i in `/usr/bin/ruby /opt/get-launch-params.rb`
-    do
-    echo "exporting to bashrc $i ... " >> $LOG
-        echo "export" ${i} >> /home/ubuntu/.bashrc
-    done
-    source /home/ubuntu/.bashrc
-    # Write a cronjob to execute wso2-cartridge-init.sh periodically until public ip is assigned
-    #crontab -l > ./mycron
-    #echo "*/${CRON_DURATION} * * * * /opt/wso2-cartridge-init.sh > /var/log/wso2-cartridge-init.log" >> ./mycron
-    #crontab ./mycron
-    #rm ./mycron
-
-fi
-
-
-echo ---------------------------- >> $LOG
-echo "getting public ip from metadata service" >> $LOG
-
-wget http://169.254.169.254/latest/meta-data/public-ipv4
-files="`cat public-ipv4`"
-if [[ -z ${files} ]]; then
-    echo "getting public ip" >> $LOG
-    for i in {1..30}
-    do
-      rm -f ./public-ipv4
-      wget http://169.254.169.254/latest/meta-data/public-ipv4
-      files="`cat public-ipv4`"
-      if [ -z $files ]; then
-          echo "Public ip is not yet assigned. Wait and continue for $i the time ..." >> $LOG
-          sleep $SLEEP_DURATION
-      else
-          echo "Public ip assigned" >> $LOG
-          #crontab -r
-          break
-      fi
-    done
-
-    if [ -z $files ]; then
-      echo "Public ip is not yet assigned. So exit" >> $LOG
-      exit 0
-    fi
-    for x in $files
-    do
-        PUBLIC_IP="$x"
-    done
-
-
-else 
-   PUBLIC_IP="$files"
-   #crontab -r
-fi
-
-
-for i in `/usr/bin/ruby /opt/get-launch-params.rb`
-do
-    export ${i}
-done
-
-echo "Logging sys variables .. PUBLIC_IP:${PUBLIC_IP}, HOST_NAME:${HOST_NAME}, KEY:${KEY}, PORTS=${PORTS}, BAM:${BAM_IP}, GITREPO:${GIT_REPO}" >> $LOG
-
-mkdir -p  /etc/agent/conf
-
-echo "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:agen=\"http://service.agent.cartridge.carbon.wso2.org\">
-  <soapenv:Header/>
-  <soapenv:Body>
-     <agen:register>
-        <registrant> 
-           <alarmingLowerRate>${ALARMING_LOWER_RATE}</alarmingLowerRate>
-           <alarmingUpperRate>${ALARMING_UPPER_RATE}</alarmingUpperRate>
-           <hostName>${HOST_NAME}</hostName>
-           <key>${KEY}</key>
-          <maxInstanceCount>${MAX}</maxInstanceCount>
-      <maxRequestsPerSecond>${MAX_REQUESTS_PER_SEC}</maxRequestsPerSecond>
-          <minInstanceCount>${MIN}</minInstanceCount> " > /etc/agent/conf/request.xml
-
-IFS='|' read -ra PT <<< "${PORTS}"
-for i in "${PT[@]}"; do
-IFS=':' read -ra PP <<< "$i"
-echo "          <portMappings>
-                        <primaryPort>${PP[1]}</primaryPort>
-                        <proxyPort>${PP[2]}</proxyPort>
-                        <type>${PP[0]}</type>
-                </portMappings>">> /etc/agent/conf/request.xml
-done
-
-echo "          <remoteHost>${PUBLIC_IP}</remoteHost>
-           <service>${SERVICE}</service>
-       <remoteHost>${PUBLIC_IP}</remoteHost>
-           <roundsToAverage>${ROUNDS_TO_AVERAGE}</roundsToAverage>
-           <scaleDownFactor>${SCALE_DOWN_FACTOR}</scaleDownFactor>
-           <tenantRange>${TENANT_RANGE}</tenantRange>
-        </registrant>
-     </agen:register>
-  </soapenv:Body>
-</soapenv:Envelope>
-" >> /etc/agent/conf/request.xml
-
-echo "Creating repoinfo request  " >> $LOG
-echo "TENANT_ID and SERVICE ${TENANT_ID} and ${SERVICE} " >> $LOG
-set -- "${HOST_NAME}" 
-IFS="."; declare -a Array=($*)
-ALIAS="${Array[0]}"
-echo "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://org.apache.axis2/xsd\">
-   <soapenv:Header/>
-   <soapenv:Body>
-      <xsd:getRepositoryCredentials>
-         <xsd:tenantId>${TENANT_ID}</xsd:tenantId>
-         <xsd:cartridgeType>${SERVICE}</xsd:cartridgeType>
-         <xsd:alias>${ALIAS}</xsd:alias>
-      </xsd:getRepositoryCredentials>
-   </soapenv:Body>
-</soapenv:Envelope>" > /opt/repoinforequest.xml
-
-
-
-echo "Sending register request to Cartridge agent service" >> $LOG
-
-curl -X POST -H "Content-Type: text/xml" -H "SOAPAction: urn:register" -d @/etc/agent/conf/request.xml -k --silent --output /dev/null "${CARTRIDGE_AGENT_EPR}"
-
-sleep 5
-
-/etc/init.d/apache2 restart
-
-echo "Git repo sync" >> $LOG
-
-# If repo is available do a git pull, else clone
-echo "#!/bin/bash
-if [ -d \"${APP_PATH}/.git\" ]; then
-    cd ${APP_PATH}
-
-    curl -X POST -H \"Content-Type: text/xml\" -H \"SOAPAction: urn:getRepositoryCredentials\" -d @/opt/repoinforequest.xml --silent  \"${REPO_INFO_EPR}\" --insecure > /tmp/git.xml
-   sed '1,5d' /tmp/git.xml > /tmp/git1.xml
-   sed '2d' /tmp/git1.xml > /tmp/git.xml
-   username=\`xml_grep 'ax211:userName' /tmp/git.xml --text_only\`
-   password=\`xml_grep 'ax211:password' /tmp/git.xml --text_only\`
-   repo=\`xml_grep 'ax211:url' /tmp/git.xml --text_only\`
-   rm /tmp/git1.xml
-   rm /tmp/git.xml
-   url=\`echo \$repo |sed 's/http.*\/\///g' |sed 's/\:.*//g' |sed 's/\/.*//g'\`
-   echo \"machine \${url} login \${username} password \${password}\" > ~/.netrc
-   sudo echo \"machine \${url} login \${username} password \${password}\" > /root/.netrc
-   chmod 600 ~/.netrc
-   sudo chmod 600 /root/.netrc
-   sudo git pull
-   rm ~/.netrc
-   sudo rm /root/.netrc
-
-    sudo chown -R www-data:www-data ${APP_PATH}/www
-    if [ -f \"${APP_PATH}/sql/alter.sql\" ]; then
-        mysql -h ${MYSQL_HOST} -u ${MYSQL_USER} -p${MYSQL_PASSWORD} < ${APP_PATH}/sql/alter.sql
-    fi
-else
-    sudo rm -f ${APP_PATH}/index.html
-   curl -X POST -H \"Content-Type: text/xml\" -H \"SOAPAction: urn:getRepositoryCredentials\" -d @/opt/repoinforequest.xml --silent  \"${REPO_INFO_EPR}\" --insecure > /tmp/git.xml
-   sed '1,5d' /tmp/git.xml > /tmp/git1.xml
-   sed '2d' /tmp/git1.xml > /tmp/git.xml
-   username=\`xml_grep 'ax211:userName' /tmp/git.xml --text_only\`
-   password=\`xml_grep 'ax211:password' /tmp/git.xml --text_only\`
-   repo=\`xml_grep 'ax211:url' /tmp/git.xml --text_only\`
-   rm /tmp/git1.xml
-   rm /tmp/git.xml
-   url=\`echo \$repo |sed 's/http.*\/\///g' |sed 's/\:.*//g' |sed 's/\/.*//g'\`
-   echo \"machine \${url} login \${username} password \${password}\" > ~/.netrc
-   sudo echo \"machine \${url} login \${username} password \${password}\" > /root/.netrc
-   chmod 600 ~/.netrc
-   sudo chmod 600 /root/.netrc
-   sudo git clone \${repo} ${APP_PATH}
-   rm ~/.netrc
-   sudo rm /root/.netrc
-
-    if [ -f \"${APP_PATH}/sql/init.sql\" ]; then
-        mysql -h ${MYSQL_HOST} -u ${MYSQL_USER} -p${MYSQL_PASSWORD} < ${APP_PATH}/sql/init.sql
-    fi
-    echo \"SetEnv STRATOS_MYSQL_USER ${MYSQL_USER}
-    SetEnv STRATOS_MYSQL_HOST ${MYSQL_HOST}
-    SetEnv STRATOS_MYSQL_PASSWORD ${MYSQL_PASSWORD}
-    \" > /tmp/.htaccess
-    sudo mv /tmp/.htaccess ${APP_PATH}/
-    sudo chown -R www-data:www-data ${APP_PATH}/www
-    
-
-
-fi" > /opt/git.sh
-echo "File created.." >> $LOG
-chmod 755 /opt/git.sh
-echo "running git clone........" >> $LOG
-su - ubuntu /opt/git.sh
-
-
-# ========================== // End of script ===========================================================