You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2015/02/20 10:34:54 UTC
[2/2] stratos git commit: Introducing wordpress extended v1 & v2
sample applications
Introducing wordpress extended v1 & v2 sample applications
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/954a1012
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/954a1012
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/954a1012
Branch: refs/heads/master
Commit: 954a1012faa51936f4176aed9c2b990725303f1d
Parents: 6356e7f
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Feb 20 15:04:45 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Fri Feb 20 15:04:45 2015 +0530
----------------------------------------------------------------------
.../wordpress-extended-v1/README.md | 22 +++++++
.../artifacts/application.json | 60 ++++++++++++++++++++
.../artifacts/autoscaling-policy.json | 14 +++++
.../artifacts/ec2/deployment-policy.json | 55 ++++++++++++++++++
.../artifacts/kubernetes/deployment-policy.json | 55 ++++++++++++++++++
.../kubernetes/kubernetes-cluster.json | 56 ++++++++++++++++++
.../artifacts/mock/deployment-policy.json | 55 ++++++++++++++++++
.../artifacts/openstack/deployment-policy.json | 55 ++++++++++++++++++
.../scripts/common/deploy.sh | 47 +++++++++++++++
.../scripts/common/undeploy.sh | 25 ++++++++
.../wordpress-extended-v1/scripts/ec2/deploy.sh | 9 +++
.../scripts/ec2/undeploy.sh | 7 +++
.../scripts/kubernetes/deploy.sh | 15 +++++
.../scripts/kubernetes/undeploy.sh | 13 +++++
.../scripts/mock/deploy.sh | 9 +++
.../scripts/mock/undeploy.sh | 7 +++
.../scripts/openstack/deploy.sh | 9 +++
.../scripts/openstack/undeploy.sh | 7 +++
.../wordpress-extended-v2/README.md | 23 ++++++++
.../artifacts/application.json | 60 ++++++++++++++++++++
.../artifacts/autoscaling-policy.json | 14 +++++
.../artifacts/ec2/deployment-policy.json | 55 ++++++++++++++++++
.../artifacts/kubernetes/deployment-policy.json | 55 ++++++++++++++++++
.../kubernetes/kubernetes-cluster.json | 56 ++++++++++++++++++
.../artifacts/mock/deployment-policy.json | 55 ++++++++++++++++++
.../artifacts/openstack/deployment-policy.json | 55 ++++++++++++++++++
.../scripts/common/deploy.sh | 47 +++++++++++++++
.../scripts/common/undeploy.sh | 25 ++++++++
.../wordpress-extended-v2/scripts/ec2/deploy.sh | 9 +++
.../scripts/ec2/undeploy.sh | 7 +++
.../scripts/kubernetes/deploy.sh | 15 +++++
.../scripts/kubernetes/undeploy.sh | 13 +++++
.../scripts/mock/deploy.sh | 9 +++
.../scripts/mock/undeploy.sh | 7 +++
.../scripts/openstack/deploy.sh | 9 +++
.../scripts/openstack/undeploy.sh | 7 +++
.../applications/wordpress-extended/README.md | 20 -------
.../artifacts/application.json | 60 --------------------
.../artifacts/autoscaling-policy.json | 14 -----
.../artifacts/ec2/deployment-policy.json | 55 ------------------
.../artifacts/kubernetes/deployment-policy.json | 55 ------------------
.../kubernetes/kubernetes-cluster.json | 56 ------------------
.../artifacts/mock/deployment-policy.json | 55 ------------------
.../artifacts/openstack/deployment-policy.json | 55 ------------------
.../wordpress-extended/scripts/common/deploy.sh | 47 ---------------
.../scripts/common/undeploy.sh | 25 --------
.../wordpress-extended/scripts/ec2/deploy.sh | 9 ---
.../wordpress-extended/scripts/ec2/undeploy.sh | 7 ---
.../scripts/kubernetes/deploy.sh | 15 -----
.../scripts/kubernetes/undeploy.sh | 13 -----
.../wordpress-extended/scripts/mock/deploy.sh | 9 ---
.../wordpress-extended/scripts/mock/undeploy.sh | 7 ---
.../scripts/openstack/deploy.sh | 9 ---
.../scripts/openstack/undeploy.sh | 7 ---
samples/applications/wordpress/README.md | 5 +-
.../wordpress/artifacts/application.json | 16 +++---
.../artifacts/mock/deployment-policy.json | 4 +-
samples/cartridges-groups/group6c.json | 2 +-
samples/cartridges-groups/mysql-php-group.json | 2 +-
59 files changed, 1055 insertions(+), 533 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/README.md b/samples/applications/wordpress-extended-v1/README.md
new file mode 100644
index 0000000..14249a1
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/README.md
@@ -0,0 +1,22 @@
+Wordpress Extended V1 Application
+=================================
+Wordpress extended v1 application consists of a cartridge group which includes a MySQL cartridge and PHP cartridge and
+a Tomcat cartridge at the top level. The cartridge group defines a startup dependency to first start MySQL cluster and
+then the PHP cluster once the MySQL cluster is active. Group scaling has been disabled in MySQL, PHP group. The
+application has defined a startup dependency to first start the MySQL, PHP group clusters and then the Tomcat cluster.
+
+
+Application folder structure
+----------------------------
+```
+artifacts/<iaas>/ IaaS specific artifacts
+scripts/common/ Common scripts for all iaases
+scripts/<iaas> IaaS specific scripts
+```
+
+How to run
+----------
+```
+cd scripts/<iaas>/
+./deploy.sh
+```
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/application.json b/samples/applications/wordpress-extended-v1/artifacts/application.json
new file mode 100644
index 0000000..8ee0286
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/artifacts/application.json
@@ -0,0 +1,60 @@
+{
+ "applicationId": "wordpress-extended",
+ "alias": "wordpress",
+ "components": {
+ "groups": [
+ {
+ "name": "mysql-php-group",
+ "alias": "mysql-php-group1",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 1,
+ "cartridges": [
+ {
+ "type": "mysql",
+ "cartridgeMin": 2,
+ "cartridgeMax": 5,
+ "subscribableInfo": {
+ "alias": "mysql1",
+ "autoscalingPolicy": "autoscaling-policy-1"
+ }
+ },
+ {
+ "type": "php",
+ "cartridgeMin": 2,
+ "cartridgeMax": 5,
+ "subscribableInfo": {
+ "alias": "php1",
+ "autoscalingPolicy": "autoscaling-policy-1",
+ "artifactRepository":{
+ "privateRepo":false,
+ "repoUrl":"https://github.com/imesh/stratos-php-applications.git"
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges" : [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 2,
+ "cartridgeMax": 5,
+ "subscribableInfo": {
+ "alias": "tomcat1",
+ "autoscalingPolicy": "autoscaling-policy-1",
+ "artifactRepository":{
+ "privateRepo":false,
+ "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git"
+ }
+ }
+ }
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "group.mysql-php-group1,cartridge.tomcat1"
+ ],
+ "terminationBehaviour": "terminate-none"
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/artifacts/autoscaling-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/autoscaling-policy.json b/samples/applications/wordpress-extended-v1/artifacts/autoscaling-policy.json
new file mode 100755
index 0000000..b41726e
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/artifacts/autoscaling-policy.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscaling-policy-1",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 80
+ },
+ "memoryConsumption": {
+ "threshold": 90
+ },
+ "loadAverage": {
+ "threshold": 50
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/artifacts/ec2/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/ec2/deployment-policy.json b/samples/applications/wordpress-extended-v1/artifacts/ec2/deployment-policy.json
new file mode 100644
index 0000000..67f5a5f
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/artifacts/ec2/deployment-policy.json
@@ -0,0 +1,55 @@
+{
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "provider": "ec2",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mysql",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "php",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/artifacts/kubernetes/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/kubernetes/deployment-policy.json b/samples/applications/wordpress-extended-v1/artifacts/kubernetes/deployment-policy.json
new file mode 100644
index 0000000..cb72ffd
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/artifacts/kubernetes/deployment-policy.json
@@ -0,0 +1,55 @@
+{
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "provider": "kubernetes",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mysql",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "php",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/artifacts/kubernetes/kubernetes-cluster.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/kubernetes/kubernetes-cluster.json b/samples/applications/wordpress-extended-v1/artifacts/kubernetes/kubernetes-cluster.json
new file mode 100644
index 0000000..2988ed1
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/artifacts/kubernetes/kubernetes-cluster.json
@@ -0,0 +1,56 @@
+{
+ "clusterId": "kubernetes-cluster-1",
+ "description": "Kubernetes CoreOS cluster",
+ "kubernetesMaster": {
+ "hostId": "KubHostMaster1",
+ "hostname": "master.dev.kubernetes.example.org",
+ "privateIPAddress": "172.17.8.100",
+ "publicIPAddress": "172.17.8.100",
+ "property": [
+ ]
+ },
+ "portRange": {
+ "upper": "5000",
+ "lower": "4500"
+ },
+ "kubernetesHosts": [
+ {
+ "hostId": "KubHostSlave1",
+ "hostname": "slave1.dev.kubernetes.example.org",
+ "privateIPAddress": "172.17.8.101",
+ "publicIPAddress": "172.17.8.101",
+ "property": [
+ ]
+ },
+ {
+ "hostId": "KubHostSlave2",
+ "hostname": "slave2.dev.kubernetes.example.org",
+ "privateIPAddress": "172.17.8.102",
+ "publicIPAddress": "172.17.8.102",
+ "property": [
+ ]
+ }
+ ],
+ "property": [
+ {
+ "name": "payload_parameter.MB_IP",
+ "value": "172.17.8.1"
+ },
+ {
+ "name": "payload_parameter.MB_PORT",
+ "value": "1883"
+ },
+ {
+ "name": "payload_parameter.CEP_IP",
+ "value": "172.17.8.1"
+ },
+ {
+ "name": "payload_parameter.CEP_PORT",
+ "value": "7711"
+ },
+ {
+ "name": "payload_parameter.LOG_LEVEL",
+ "value": "DEBUG"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/artifacts/mock/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/mock/deployment-policy.json b/samples/applications/wordpress-extended-v1/artifacts/mock/deployment-policy.json
new file mode 100644
index 0000000..a9548fd
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/artifacts/mock/deployment-policy.json
@@ -0,0 +1,55 @@
+{
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "provider": "mock",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mysql-php-group1",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "tomcat1",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/artifacts/openstack/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/openstack/deployment-policy.json b/samples/applications/wordpress-extended-v1/artifacts/openstack/deployment-policy.json
new file mode 100644
index 0000000..a2d1e8c
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/artifacts/openstack/deployment-policy.json
@@ -0,0 +1,55 @@
+{
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "provider": "openstack",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mysql",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "php",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/scripts/common/deploy.sh b/samples/applications/wordpress-extended-v1/scripts/common/deploy.sh
new file mode 100755
index 0000000..1a736a6
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/scripts/common/deploy.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+iaas=$1
+host_ip="localhost"
+host_port=9443
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+
+artifacts_path=`cd "${script_path}/../../artifacts"; pwd`
+iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
+cartridges_path=`cd "${script_path}/../../../../cartridges/${iaas}"; pwd`
+cartridges_groups_path=`cd "${script_path}/../../../../cartridges-groups"; pwd`
+
+set -e
+
+if [[ -z "${iaas}" ]]; then
+ echo "Usage: deploy.sh [iaas]"
+ exit
+fi
+
+echo ${artifacts_path}/autoscaling-policy.json
+echo "Adding autoscale policy..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+
+echo "Adding mysql cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/mysql.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+echo "Adding php cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/php.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+echo "Adding tomcat cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+
+echo "Adding mysql-php-group group..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/mysql-php-group.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups
+
+sleep 1
+
+echo "Creating application..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications
+
+sleep 1
+
+echo "Deploying application..."
+curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/wordpress-extended/deploy
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/scripts/common/undeploy.sh b/samples/applications/wordpress-extended-v1/scripts/common/undeploy.sh
new file mode 100644
index 0000000..410c429
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/scripts/common/undeploy.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+
+set -e
+
+echo "Undeploying application..."
+curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/wordpress-extended/undeploy
+
+sleep 10
+
+echo "Deleting application..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/wordpress-extended
+
+echo "Removing groups..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups/mysql-php-group
+
+echo "Removing cartridges..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/php
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/mysql
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat
+
+echo "Removing autoscale policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-1
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/scripts/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/scripts/ec2/deploy.sh b/samples/applications/wordpress-extended-v1/scripts/ec2/deploy.sh
new file mode 100755
index 0000000..1370667
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/scripts/ec2/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="ec2"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/deploy.sh ${iaas}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/scripts/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/scripts/ec2/undeploy.sh b/samples/applications/wordpress-extended-v1/scripts/ec2/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/scripts/ec2/undeploy.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/scripts/kubernetes/deploy.sh b/samples/applications/wordpress-extended-v1/scripts/kubernetes/deploy.sh
new file mode 100755
index 0000000..32eff3c
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/scripts/kubernetes/deploy.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+iaas="kubernetes"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
+
+echo "Adding kubernetes cluster..."
+curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/kubernetes-cluster.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
+
+bash ${common_folder}/deploy.sh ${iaas}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/scripts/kubernetes/undeploy.sh b/samples/applications/wordpress-extended-v1/scripts/kubernetes/undeploy.sh
new file mode 100644
index 0000000..0054670
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/scripts/kubernetes/undeploy.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh
+
+echo "Removing kubernetes cluster..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters/kubernetes-cluster-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/scripts/mock/deploy.sh b/samples/applications/wordpress-extended-v1/scripts/mock/deploy.sh
new file mode 100755
index 0000000..93f8517
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/scripts/mock/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+iaas="mock"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/deploy.sh ${iaas}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/scripts/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/scripts/mock/undeploy.sh b/samples/applications/wordpress-extended-v1/scripts/mock/undeploy.sh
new file mode 100755
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/scripts/mock/undeploy.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/scripts/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/scripts/openstack/deploy.sh b/samples/applications/wordpress-extended-v1/scripts/openstack/deploy.sh
new file mode 100755
index 0000000..4c39959
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/scripts/openstack/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="openstack"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/deploy.sh ${iaas}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v1/scripts/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/scripts/openstack/undeploy.sh b/samples/applications/wordpress-extended-v1/scripts/openstack/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/scripts/openstack/undeploy.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/README.md b/samples/applications/wordpress-extended-v2/README.md
new file mode 100644
index 0000000..af2349a
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/README.md
@@ -0,0 +1,23 @@
+Wordpress Extended V2 Application
+=================================
+Wordpress extended v2 application consists of a cartridge group which includes a MySQL cartridge and PHP cartridge and
+a Tomcat cartridge at the top level. The cartridge group defines a startup dependency to first start MySQL cluster and
+then the PHP cluster once the MySQL cluster is active. Group scaling has been enabled in MySQL, PHP group and the
+maximum number of group instances has been set to two. The application has defined a startup dependency to first start
+the MySQL, PHP group clusters and then the Tomcat cluster.
+
+
+Application folder structure
+----------------------------
+```
+artifacts/<iaas>/ IaaS specific artifacts
+scripts/common/ Common scripts for all iaases
+scripts/<iaas> IaaS specific scripts
+```
+
+How to run
+----------
+```
+cd scripts/<iaas>/
+./deploy.sh
+```
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/application.json b/samples/applications/wordpress-extended-v2/artifacts/application.json
new file mode 100644
index 0000000..11cc0e6
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/artifacts/application.json
@@ -0,0 +1,60 @@
+{
+ "applicationId": "wordpress-extended",
+ "alias": "wordpress",
+ "components": {
+ "groups": [
+ {
+ "name": "mysql-php-group",
+ "alias": "mysql-php-group1",
+ "groupMinInstances": 2,
+ "groupMaxInstances": 2,
+ "cartridges": [
+ {
+ "type": "mysql",
+ "cartridgeMin": 2,
+ "cartridgeMax": 5,
+ "subscribableInfo": {
+ "alias": "mysql1",
+ "autoscalingPolicy": "autoscaling-policy-1"
+ }
+ },
+ {
+ "type": "php",
+ "cartridgeMin": 2,
+ "cartridgeMax": 5,
+ "subscribableInfo": {
+ "alias": "php1",
+ "autoscalingPolicy": "autoscaling-policy-1",
+ "artifactRepository":{
+ "privateRepo":false,
+ "repoUrl":"https://github.com/imesh/stratos-php-applications.git"
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges" : [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 2,
+ "cartridgeMax": 5,
+ "subscribableInfo": {
+ "alias": "tomcat1",
+ "autoscalingPolicy": "autoscaling-policy-1",
+ "artifactRepository":{
+ "privateRepo":false,
+ "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git"
+ }
+ }
+ }
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "group.mysql-php-group1,cartridge.tomcat1"
+ ],
+ "terminationBehaviour": "terminate-none"
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/artifacts/autoscaling-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/autoscaling-policy.json b/samples/applications/wordpress-extended-v2/artifacts/autoscaling-policy.json
new file mode 100755
index 0000000..b41726e
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/artifacts/autoscaling-policy.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscaling-policy-1",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 80
+ },
+ "memoryConsumption": {
+ "threshold": 90
+ },
+ "loadAverage": {
+ "threshold": 50
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/artifacts/ec2/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/ec2/deployment-policy.json b/samples/applications/wordpress-extended-v2/artifacts/ec2/deployment-policy.json
new file mode 100644
index 0000000..67f5a5f
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/artifacts/ec2/deployment-policy.json
@@ -0,0 +1,55 @@
+{
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "provider": "ec2",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mysql",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "php",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/artifacts/kubernetes/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/kubernetes/deployment-policy.json b/samples/applications/wordpress-extended-v2/artifacts/kubernetes/deployment-policy.json
new file mode 100644
index 0000000..cb72ffd
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/artifacts/kubernetes/deployment-policy.json
@@ -0,0 +1,55 @@
+{
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "provider": "kubernetes",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mysql",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "php",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/artifacts/kubernetes/kubernetes-cluster.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/kubernetes/kubernetes-cluster.json b/samples/applications/wordpress-extended-v2/artifacts/kubernetes/kubernetes-cluster.json
new file mode 100644
index 0000000..2988ed1
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/artifacts/kubernetes/kubernetes-cluster.json
@@ -0,0 +1,56 @@
+{
+ "clusterId": "kubernetes-cluster-1",
+ "description": "Kubernetes CoreOS cluster",
+ "kubernetesMaster": {
+ "hostId": "KubHostMaster1",
+ "hostname": "master.dev.kubernetes.example.org",
+ "privateIPAddress": "172.17.8.100",
+ "publicIPAddress": "172.17.8.100",
+ "property": [
+ ]
+ },
+ "portRange": {
+ "upper": "5000",
+ "lower": "4500"
+ },
+ "kubernetesHosts": [
+ {
+ "hostId": "KubHostSlave1",
+ "hostname": "slave1.dev.kubernetes.example.org",
+ "privateIPAddress": "172.17.8.101",
+ "publicIPAddress": "172.17.8.101",
+ "property": [
+ ]
+ },
+ {
+ "hostId": "KubHostSlave2",
+ "hostname": "slave2.dev.kubernetes.example.org",
+ "privateIPAddress": "172.17.8.102",
+ "publicIPAddress": "172.17.8.102",
+ "property": [
+ ]
+ }
+ ],
+ "property": [
+ {
+ "name": "payload_parameter.MB_IP",
+ "value": "172.17.8.1"
+ },
+ {
+ "name": "payload_parameter.MB_PORT",
+ "value": "1883"
+ },
+ {
+ "name": "payload_parameter.CEP_IP",
+ "value": "172.17.8.1"
+ },
+ {
+ "name": "payload_parameter.CEP_PORT",
+ "value": "7711"
+ },
+ {
+ "name": "payload_parameter.LOG_LEVEL",
+ "value": "DEBUG"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/artifacts/mock/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/mock/deployment-policy.json b/samples/applications/wordpress-extended-v2/artifacts/mock/deployment-policy.json
new file mode 100644
index 0000000..a9548fd
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/artifacts/mock/deployment-policy.json
@@ -0,0 +1,55 @@
+{
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "provider": "mock",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mysql-php-group1",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "tomcat1",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/artifacts/openstack/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/openstack/deployment-policy.json b/samples/applications/wordpress-extended-v2/artifacts/openstack/deployment-policy.json
new file mode 100644
index 0000000..a2d1e8c
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/artifacts/openstack/deployment-policy.json
@@ -0,0 +1,55 @@
+{
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "provider": "openstack",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mysql",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "php",
+ "networkPartition": [
+ {
+ "id": "network-partition-1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/scripts/common/deploy.sh b/samples/applications/wordpress-extended-v2/scripts/common/deploy.sh
new file mode 100755
index 0000000..1a736a6
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/scripts/common/deploy.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+iaas=$1
+host_ip="localhost"
+host_port=9443
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+
+artifacts_path=`cd "${script_path}/../../artifacts"; pwd`
+iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
+cartridges_path=`cd "${script_path}/../../../../cartridges/${iaas}"; pwd`
+cartridges_groups_path=`cd "${script_path}/../../../../cartridges-groups"; pwd`
+
+set -e
+
+if [[ -z "${iaas}" ]]; then
+ echo "Usage: deploy.sh [iaas]"
+ exit
+fi
+
+echo ${artifacts_path}/autoscaling-policy.json
+echo "Adding autoscale policy..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+
+echo "Adding mysql cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/mysql.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+echo "Adding php cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/php.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+echo "Adding tomcat cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+
+echo "Adding mysql-php-group group..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/mysql-php-group.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups
+
+sleep 1
+
+echo "Creating application..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications
+
+sleep 1
+
+echo "Deploying application..."
+curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/wordpress-extended/deploy
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/scripts/common/undeploy.sh b/samples/applications/wordpress-extended-v2/scripts/common/undeploy.sh
new file mode 100644
index 0000000..410c429
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/scripts/common/undeploy.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+
+set -e
+
+echo "Undeploying application..."
+curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/wordpress-extended/undeploy
+
+sleep 10
+
+echo "Deleting application..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/wordpress-extended
+
+echo "Removing groups..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups/mysql-php-group
+
+echo "Removing cartridges..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/php
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/mysql
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat
+
+echo "Removing autoscale policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-1
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/scripts/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/scripts/ec2/deploy.sh b/samples/applications/wordpress-extended-v2/scripts/ec2/deploy.sh
new file mode 100755
index 0000000..1370667
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/scripts/ec2/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="ec2"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/deploy.sh ${iaas}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/scripts/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/scripts/ec2/undeploy.sh b/samples/applications/wordpress-extended-v2/scripts/ec2/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/scripts/ec2/undeploy.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/scripts/kubernetes/deploy.sh b/samples/applications/wordpress-extended-v2/scripts/kubernetes/deploy.sh
new file mode 100755
index 0000000..32eff3c
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/scripts/kubernetes/deploy.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+iaas="kubernetes"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
+
+echo "Adding kubernetes cluster..."
+curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/kubernetes-cluster.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
+
+bash ${common_folder}/deploy.sh ${iaas}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/scripts/kubernetes/undeploy.sh b/samples/applications/wordpress-extended-v2/scripts/kubernetes/undeploy.sh
new file mode 100644
index 0000000..0054670
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/scripts/kubernetes/undeploy.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh
+
+echo "Removing kubernetes cluster..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters/kubernetes-cluster-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/scripts/mock/deploy.sh b/samples/applications/wordpress-extended-v2/scripts/mock/deploy.sh
new file mode 100755
index 0000000..93f8517
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/scripts/mock/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+iaas="mock"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/deploy.sh ${iaas}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/scripts/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/scripts/mock/undeploy.sh b/samples/applications/wordpress-extended-v2/scripts/mock/undeploy.sh
new file mode 100755
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/scripts/mock/undeploy.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/scripts/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/scripts/openstack/deploy.sh b/samples/applications/wordpress-extended-v2/scripts/openstack/deploy.sh
new file mode 100755
index 0000000..4c39959
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/scripts/openstack/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="openstack"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/deploy.sh ${iaas}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended-v2/scripts/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/scripts/openstack/undeploy.sh b/samples/applications/wordpress-extended-v2/scripts/openstack/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/wordpress-extended-v2/scripts/openstack/undeploy.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/README.md b/samples/applications/wordpress-extended/README.md
deleted file mode 100644
index 004af34..0000000
--- a/samples/applications/wordpress-extended/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-Wordpress Extended Application
-=====================
-Wordpress extended application consists of a cartridge group which includes a MySQL cartridge, a PHP cartridge and
-an extra Tomcat cartridge on the top level.
-
-
-Application folder structure
-----------------------------
-```
-artifacts/<iaas>/ IaaS specific artifacts
-scripts/common/ Common scripts for all iaases
-scripts/<iaas> IaaS specific scripts
-```
-
-How to run
-----------
-```
-cd scripts/<iaas>/
-./deploy.sh
-```
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/artifacts/application.json b/samples/applications/wordpress-extended/artifacts/application.json
deleted file mode 100644
index 2ea517a..0000000
--- a/samples/applications/wordpress-extended/artifacts/application.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "applicationId": "wordpress-extended",
- "alias": "wordpress",
- "components": {
- "groups": [
- {
- "name": "mysql-php-group",
- "alias": "mysql-php-group",
- "groupMinInstances": 1,
- "groupMaxInstances": 1,
- "cartridges": [
- {
- "type": "mysql",
- "cartridgeMin": 1,
- "cartridgeMax": 2,
- "subscribableInfo": {
- "alias": "mysql",
- "autoscalingPolicy": "autoscaling-policy-1"
- }
- },
- {
- "type": "php",
- "cartridgeMin": 1,
- "cartridgeMax": 2,
- "subscribableInfo": {
- "alias": "php",
- "autoscalingPolicy": "autoscaling-policy-1",
- "artifactRepository":{
- "privateRepo":false,
- "repoUrl":"https://github.com/imesh/stratos-php-applications.git"
- }
- }
- }
- ]
- }
- ],
- "cartridges" : [
- {
- "type": "tomcat",
- "cartridgeMin": 1,
- "cartridgeMax": 2,
- "subscribableInfo": {
- "alias": "tomcat",
- "autoscalingPolicy": "autoscaling-policy-1",
- "artifactRepository":{
- "privateRepo":false,
- "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git"
- }
- }
- }
- ],
- "dependencies": {
- "startupOrders": [
- "group.mysql-php-group,cartridge.tomcat"
- ],
- "terminationBehaviour": "terminate-none"
- }
- }
-}
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/artifacts/autoscaling-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/artifacts/autoscaling-policy.json b/samples/applications/wordpress-extended/artifacts/autoscaling-policy.json
deleted file mode 100755
index b41726e..0000000
--- a/samples/applications/wordpress-extended/artifacts/autoscaling-policy.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "id": "autoscaling-policy-1",
- "loadThresholds": {
- "requestsInFlight": {
- "threshold": 80
- },
- "memoryConsumption": {
- "threshold": 90
- },
- "loadAverage": {
- "threshold": 50
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/artifacts/ec2/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/artifacts/ec2/deployment-policy.json b/samples/applications/wordpress-extended/artifacts/ec2/deployment-policy.json
deleted file mode 100644
index 67f5a5f..0000000
--- a/samples/applications/wordpress-extended/artifacts/ec2/deployment-policy.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "applicationPolicy": {
- "networkPartition": [
- {
- "id": "network-partition-1",
- "activeByDefault": "true",
- "partitions": [
- {
- "id": "partition-1",
- "provider": "ec2",
- "property": [
- {
- "name": "region",
- "value": "default"
- }
- ]
- }
- ]
- }
- ]
- },
- "childPolicies": [
- {
- "alias": "mysql",
- "networkPartition": [
- {
- "id": "network-partition-1",
- "partitionAlgo": "one-after-another",
- "partitions": [
- {
- "id": "partition-1",
- "max": 5
- }
- ]
- }
- ]
- },
- {
- "alias": "php",
- "networkPartition": [
- {
- "id": "network-partition-1",
- "partitionAlgo": "one-after-another",
- "partitions": [
- {
- "id": "partition-1",
- "max": 5
- }
- ]
- }
- ]
- }
- ]
-}
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/artifacts/kubernetes/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/artifacts/kubernetes/deployment-policy.json b/samples/applications/wordpress-extended/artifacts/kubernetes/deployment-policy.json
deleted file mode 100644
index cb72ffd..0000000
--- a/samples/applications/wordpress-extended/artifacts/kubernetes/deployment-policy.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "applicationPolicy": {
- "networkPartition": [
- {
- "id": "network-partition-1",
- "activeByDefault": "true",
- "partitions": [
- {
- "id": "partition-1",
- "provider": "kubernetes",
- "property": [
- {
- "name": "region",
- "value": "default"
- }
- ]
- }
- ]
- }
- ]
- },
- "childPolicies": [
- {
- "alias": "mysql",
- "networkPartition": [
- {
- "id": "network-partition-1",
- "partitionAlgo": "one-after-another",
- "partitions": [
- {
- "id": "partition-1",
- "max": 5
- }
- ]
- }
- ]
- },
- {
- "alias": "php",
- "networkPartition": [
- {
- "id": "network-partition-1",
- "partitionAlgo": "one-after-another",
- "partitions": [
- {
- "id": "partition-1",
- "max": 5
- }
- ]
- }
- ]
- }
- ]
-}
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/artifacts/kubernetes/kubernetes-cluster.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/artifacts/kubernetes/kubernetes-cluster.json b/samples/applications/wordpress-extended/artifacts/kubernetes/kubernetes-cluster.json
deleted file mode 100644
index 2988ed1..0000000
--- a/samples/applications/wordpress-extended/artifacts/kubernetes/kubernetes-cluster.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "clusterId": "kubernetes-cluster-1",
- "description": "Kubernetes CoreOS cluster",
- "kubernetesMaster": {
- "hostId": "KubHostMaster1",
- "hostname": "master.dev.kubernetes.example.org",
- "privateIPAddress": "172.17.8.100",
- "publicIPAddress": "172.17.8.100",
- "property": [
- ]
- },
- "portRange": {
- "upper": "5000",
- "lower": "4500"
- },
- "kubernetesHosts": [
- {
- "hostId": "KubHostSlave1",
- "hostname": "slave1.dev.kubernetes.example.org",
- "privateIPAddress": "172.17.8.101",
- "publicIPAddress": "172.17.8.101",
- "property": [
- ]
- },
- {
- "hostId": "KubHostSlave2",
- "hostname": "slave2.dev.kubernetes.example.org",
- "privateIPAddress": "172.17.8.102",
- "publicIPAddress": "172.17.8.102",
- "property": [
- ]
- }
- ],
- "property": [
- {
- "name": "payload_parameter.MB_IP",
- "value": "172.17.8.1"
- },
- {
- "name": "payload_parameter.MB_PORT",
- "value": "1883"
- },
- {
- "name": "payload_parameter.CEP_IP",
- "value": "172.17.8.1"
- },
- {
- "name": "payload_parameter.CEP_PORT",
- "value": "7711"
- },
- {
- "name": "payload_parameter.LOG_LEVEL",
- "value": "DEBUG"
- }
- ]
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/artifacts/mock/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/artifacts/mock/deployment-policy.json b/samples/applications/wordpress-extended/artifacts/mock/deployment-policy.json
deleted file mode 100644
index ed89a69..0000000
--- a/samples/applications/wordpress-extended/artifacts/mock/deployment-policy.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "applicationPolicy": {
- "networkPartition": [
- {
- "id": "network-partition-1",
- "activeByDefault": "true",
- "partitions": [
- {
- "id": "partition-1",
- "provider": "mock",
- "property": [
- {
- "name": "region",
- "value": "default"
- }
- ]
- }
- ]
- }
- ]
- },
- "childPolicies": [
- {
- "alias": "mysql-php-group",
- "networkPartition": [
- {
- "id": "network-partition-1",
- "partitionAlgo": "one-after-another",
- "partitions": [
- {
- "id": "partition-1",
- "max": 5
- }
- ]
- }
- ]
- },
- {
- "alias": "tomcat",
- "networkPartition": [
- {
- "id": "network-partition-1",
- "partitionAlgo": "one-after-another",
- "partitions": [
- {
- "id": "partition-1",
- "max": 5
- }
- ]
- }
- ]
- }
- ]
-}
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/artifacts/openstack/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/artifacts/openstack/deployment-policy.json b/samples/applications/wordpress-extended/artifacts/openstack/deployment-policy.json
deleted file mode 100644
index a2d1e8c..0000000
--- a/samples/applications/wordpress-extended/artifacts/openstack/deployment-policy.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "applicationPolicy": {
- "networkPartition": [
- {
- "id": "network-partition-1",
- "activeByDefault": "true",
- "partitions": [
- {
- "id": "partition-1",
- "provider": "openstack",
- "property": [
- {
- "name": "region",
- "value": "default"
- }
- ]
- }
- ]
- }
- ]
- },
- "childPolicies": [
- {
- "alias": "mysql",
- "networkPartition": [
- {
- "id": "network-partition-1",
- "partitionAlgo": "one-after-another",
- "partitions": [
- {
- "id": "partition-1",
- "max": 5
- }
- ]
- }
- ]
- },
- {
- "alias": "php",
- "networkPartition": [
- {
- "id": "network-partition-1",
- "partitionAlgo": "one-after-another",
- "partitions": [
- {
- "id": "partition-1",
- "max": 5
- }
- ]
- }
- ]
- }
- ]
-}
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/scripts/common/deploy.sh b/samples/applications/wordpress-extended/scripts/common/deploy.sh
deleted file mode 100755
index 1a736a6..0000000
--- a/samples/applications/wordpress-extended/scripts/common/deploy.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/bash
-
-iaas=$1
-host_ip="localhost"
-host_port=9443
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-
-artifacts_path=`cd "${script_path}/../../artifacts"; pwd`
-iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
-cartridges_path=`cd "${script_path}/../../../../cartridges/${iaas}"; pwd`
-cartridges_groups_path=`cd "${script_path}/../../../../cartridges-groups"; pwd`
-
-set -e
-
-if [[ -z "${iaas}" ]]; then
- echo "Usage: deploy.sh [iaas]"
- exit
-fi
-
-echo ${artifacts_path}/autoscaling-policy.json
-echo "Adding autoscale policy..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
-
-echo "Adding mysql cartridge..."
-curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/mysql.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
-
-echo "Adding php cartridge..."
-curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/php.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
-
-echo "Adding tomcat cartridge..."
-curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
-
-
-echo "Adding mysql-php-group group..."
-curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/mysql-php-group.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups
-
-sleep 1
-
-echo "Creating application..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications
-
-sleep 1
-
-echo "Deploying application..."
-curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/wordpress-extended/deploy
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/scripts/common/undeploy.sh b/samples/applications/wordpress-extended/scripts/common/undeploy.sh
deleted file mode 100644
index 410c429..0000000
--- a/samples/applications/wordpress-extended/scripts/common/undeploy.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-host_ip="localhost"
-host_port=9443
-
-set -e
-
-echo "Undeploying application..."
-curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/wordpress-extended/undeploy
-
-sleep 10
-
-echo "Deleting application..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/wordpress-extended
-
-echo "Removing groups..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups/mysql-php-group
-
-echo "Removing cartridges..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/php
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/mysql
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat
-
-echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-1
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/scripts/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/scripts/ec2/deploy.sh b/samples/applications/wordpress-extended/scripts/ec2/deploy.sh
deleted file mode 100755
index 1370667..0000000
--- a/samples/applications/wordpress-extended/scripts/ec2/deploy.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-iaas="ec2"
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-
-bash ${common_folder}/deploy.sh ${iaas}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/scripts/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/scripts/ec2/undeploy.sh b/samples/applications/wordpress-extended/scripts/ec2/undeploy.sh
deleted file mode 100644
index 17d8c71..0000000
--- a/samples/applications/wordpress-extended/scripts/ec2/undeploy.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-
-bash ${common_folder}/undeploy.sh
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/scripts/kubernetes/deploy.sh b/samples/applications/wordpress-extended/scripts/kubernetes/deploy.sh
deleted file mode 100755
index 32eff3c..0000000
--- a/samples/applications/wordpress-extended/scripts/kubernetes/deploy.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-
-host_ip="localhost"
-host_port=9443
-iaas="kubernetes"
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
-
-echo "Adding kubernetes cluster..."
-curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/kubernetes-cluster.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
-
-bash ${common_folder}/deploy.sh ${iaas}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/scripts/kubernetes/undeploy.sh b/samples/applications/wordpress-extended/scripts/kubernetes/undeploy.sh
deleted file mode 100644
index 0054670..0000000
--- a/samples/applications/wordpress-extended/scripts/kubernetes/undeploy.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-host_ip="localhost"
-host_port=9443
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-
-bash ${common_folder}/undeploy.sh
-
-echo "Removing kubernetes cluster..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters/kubernetes-cluster-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/scripts/mock/deploy.sh b/samples/applications/wordpress-extended/scripts/mock/deploy.sh
deleted file mode 100755
index 93f8517..0000000
--- a/samples/applications/wordpress-extended/scripts/mock/deploy.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-iaas="mock"
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-
-bash ${common_folder}/deploy.sh ${iaas}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/scripts/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/scripts/mock/undeploy.sh b/samples/applications/wordpress-extended/scripts/mock/undeploy.sh
deleted file mode 100755
index 17d8c71..0000000
--- a/samples/applications/wordpress-extended/scripts/mock/undeploy.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-
-bash ${common_folder}/undeploy.sh
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/scripts/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/scripts/openstack/deploy.sh b/samples/applications/wordpress-extended/scripts/openstack/deploy.sh
deleted file mode 100755
index 4c39959..0000000
--- a/samples/applications/wordpress-extended/scripts/openstack/deploy.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-iaas="openstack"
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-
-bash ${common_folder}/deploy.sh ${iaas}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress-extended/scripts/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended/scripts/openstack/undeploy.sh b/samples/applications/wordpress-extended/scripts/openstack/undeploy.sh
deleted file mode 100644
index 17d8c71..0000000
--- a/samples/applications/wordpress-extended/scripts/openstack/undeploy.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-
-bash ${common_folder}/undeploy.sh
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress/README.md b/samples/applications/wordpress/README.md
index ffdfbdc..9b61ca1 100644
--- a/samples/applications/wordpress/README.md
+++ b/samples/applications/wordpress/README.md
@@ -1,7 +1,8 @@
Wordpress Application
=====================
-Wordpress application consists of a cartridge group which includes a MySQL cartridge and PHP cartridge. It defines a
-startup dependency to start MySQL cluster first and PHP cluster second once the MySQL cluster is active.
+Wordpress application consists of a cartridge group which includes a MySQL cartridge and PHP cartridge. The cartridge
+group defines a startup dependency to first start MySQL cluster and then the PHP cluster second once the MySQL cluster
+is active. Group scaling has been disabled in MySQL, PHP group.
Application folder structure
----------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress/artifacts/application.json b/samples/applications/wordpress/artifacts/application.json
index d17ce9c..8d3b9fd 100644
--- a/samples/applications/wordpress/artifacts/application.json
+++ b/samples/applications/wordpress/artifacts/application.json
@@ -11,19 +11,19 @@
"cartridges": [
{
"type": "mysql",
- "cartridgeMin": 1,
- "cartridgeMax": 2,
+ "cartridgeMin": 2,
+ "cartridgeMax": 5,
"subscribableInfo": {
- "alias": "mysql",
+ "alias": "mysql1",
"autoscalingPolicy": "autoscaling-policy-1"
}
},
{
"type": "php",
- "cartridgeMin": 1,
- "cartridgeMax": 2,
+ "cartridgeMin": 2,
+ "cartridgeMax": 5,
"subscribableInfo": {
- "alias": "php",
+ "alias": "php1",
"autoscalingPolicy": "autoscaling-policy-1",
"artifactRepository":{
"privateRepo":false,
@@ -33,9 +33,7 @@
}
]
}
- ],
- "dependencies": {
- }
+ ]
}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/applications/wordpress/artifacts/mock/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress/artifacts/mock/deployment-policy.json b/samples/applications/wordpress/artifacts/mock/deployment-policy.json
index 5150b23..40b8692 100644
--- a/samples/applications/wordpress/artifacts/mock/deployment-policy.json
+++ b/samples/applications/wordpress/artifacts/mock/deployment-policy.json
@@ -21,7 +21,7 @@
},
"childPolicies": [
{
- "alias": "mysql",
+ "alias": "mysql1",
"networkPartition": [
{
"id": "network-partition-1",
@@ -36,7 +36,7 @@
]
},
{
- "alias": "php",
+ "alias": "php1",
"networkPartition": [
{
"id": "network-partition-1",
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/cartridges-groups/group6c.json
----------------------------------------------------------------------
diff --git a/samples/cartridges-groups/group6c.json b/samples/cartridges-groups/group6c.json
index 3a99427..e7feca5 100644
--- a/samples/cartridges-groups/group6c.json
+++ b/samples/cartridges-groups/group6c.json
@@ -13,7 +13,7 @@
],
"dependencies": {
"startupOrders": [
- "group.group7,cartridge.tomcat2"
+ "group.tom1group6,cartridge.tom2group6"
],
"terminationBehaviour": "terminate-all"
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/954a1012/samples/cartridges-groups/mysql-php-group.json
----------------------------------------------------------------------
diff --git a/samples/cartridges-groups/mysql-php-group.json b/samples/cartridges-groups/mysql-php-group.json
index 4f36d3d..cc72fbf 100644
--- a/samples/cartridges-groups/mysql-php-group.json
+++ b/samples/cartridges-groups/mysql-php-group.json
@@ -7,7 +7,7 @@
],
"dependencies": {
"startupOrders": [
- "cartridge.mysql,cartridge.php"
+ "cartridge.mysql1,cartridge.php1"
],
"scalingDependants": [
],