You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2015/02/27 15:46:53 UTC

[30/50] [abbrv] stratos git commit: fixing wordpress-extended-v1 sample

fixing wordpress-extended-v1 sample


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

Branch: refs/heads/master-deployment-policy-fix-merge
Commit: 469e245dff79b66295c880c7bbc4fcb79a23ccc6
Parents: 250c214
Author: R-Rajkumar <rr...@gmail.com>
Authored: Thu Feb 26 15:07:05 2015 +0530
Committer: R-Rajkumar <rr...@gmail.com>
Committed: Fri Feb 27 19:41:36 2015 +0530

----------------------------------------------------------------------
 .../artifacts/application-policy.json                | 12 ++++++++++++
 .../wordpress-extended-v1/artifacts/application.json | 12 +++++++-----
 .../artifacts/deployment-policy.json                 | 15 +++++++++++++++
 .../artifacts/network-partition-2.json               | 15 +++++++++++++++
 .../artifacts/network-partition.json                 | 15 +++++++++++++++
 .../wordpress-extended-v1/scripts/common/deploy.sh   |  9 ++++++++-
 samples/cartridges-groups/mysql-php-group.json       |  2 +-
 7 files changed, 73 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/469e245d/samples/applications/wordpress-extended-v1/artifacts/application-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/application-policy.json b/samples/applications/wordpress-extended-v1/artifacts/application-policy.json
new file mode 100644
index 0000000..5aa91dd
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/artifacts/application-policy.json
@@ -0,0 +1,12 @@
+{
+   "networkPartition":[
+      {
+         "id":"network-partition-1",
+         "activeByDefault":"true"
+      },
+      {
+         "id":"network-partition-2",
+         "activeByDefault":"false"
+      }
+   ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/469e245d/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
index 8ee0286..9c9d937 100644
--- a/samples/applications/wordpress-extended-v1/artifacts/application.json
+++ b/samples/applications/wordpress-extended-v1/artifacts/application.json
@@ -5,16 +5,17 @@
         "groups": [
             {
                 "name": "mysql-php-group",
-                "alias": "mysql-php-group1",
+                "alias": "my-mysql-php-group",
                 "groupMinInstances": 1,
                 "groupMaxInstances": 1,
+	     	"deploymentPolicy":"deployment-policy-1",
                 "cartridges": [
                     {
                         "type": "mysql",
                         "cartridgeMin": 2,
                         "cartridgeMax": 5,
                         "subscribableInfo": {
-                            "alias": "mysql1",
+                            "alias": "my-mysql",
                             "autoscalingPolicy": "autoscaling-policy-1"
                         }
                     },
@@ -23,7 +24,7 @@
                         "cartridgeMin": 2,
                         "cartridgeMax": 5,
                         "subscribableInfo": {
-                            "alias": "php1",
+                            "alias": "my-php",
                             "autoscalingPolicy": "autoscaling-policy-1",
                             "artifactRepository":{
                                "privateRepo":false,
@@ -40,8 +41,9 @@
                 "cartridgeMin": 2,
                 "cartridgeMax": 5,
                 "subscribableInfo": {
-                    "alias": "tomcat1",
+                    "alias": "my-tomcat",
                     "autoscalingPolicy": "autoscaling-policy-1",
+		    "deploymentPolicy":"deployment-policy-1",
                     "artifactRepository":{
                         "privateRepo":false,
                         "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git"
@@ -51,7 +53,7 @@
         ],
         "dependencies": {
             "startupOrders": [
-                "group.mysql-php-group1,cartridge.tomcat1"
+                "group.my-mysql-php-group,cartridge.my-tomcat"
             ],
             "terminationBehaviour": "terminate-none"
         }

http://git-wip-us.apache.org/repos/asf/stratos/blob/469e245d/samples/applications/wordpress-extended-v1/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/deployment-policy.json b/samples/applications/wordpress-extended-v1/artifacts/deployment-policy.json
new file mode 100644
index 0000000..666c299
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/artifacts/deployment-policy.json
@@ -0,0 +1,15 @@
+{
+   "id": "deployment-policy-1",
+   "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/469e245d/samples/applications/wordpress-extended-v1/artifacts/network-partition-2.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/network-partition-2.json b/samples/applications/wordpress-extended-v1/artifacts/network-partition-2.json
new file mode 100644
index 0000000..0d07838
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/artifacts/network-partition-2.json
@@ -0,0 +1,15 @@
+{
+    "id": "network-partition-2",
+    "partitions": [
+        {
+            "id": "partition-2",
+            "provider": "mock",
+            "property": [
+                {
+                    "name": "region",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/469e245d/samples/applications/wordpress-extended-v1/artifacts/network-partition.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/network-partition.json b/samples/applications/wordpress-extended-v1/artifacts/network-partition.json
new file mode 100644
index 0000000..2a5b7ec
--- /dev/null
+++ b/samples/applications/wordpress-extended-v1/artifacts/network-partition.json
@@ -0,0 +1,15 @@
+{
+    "id": "network-partition-1",
+    "partitions": [
+        {
+            "id": "partition-1",
+            "provider": "mock",
+            "property": [
+                {
+                    "name": "region",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/469e245d/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
index 1a736a6..4672be7 100755
--- a/samples/applications/wordpress-extended-v1/scripts/common/deploy.sh
+++ b/samples/applications/wordpress-extended-v1/scripts/common/deploy.sh
@@ -23,6 +23,13 @@ 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 network partitions..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/network-partition.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/network-partition-2.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
+
+echo "Adding deployment policy..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
+
 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
 
@@ -44,4 +51,4 @@ curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/applicat
 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
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application-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/469e245d/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 cc72fbf..2c286a1 100644
--- a/samples/cartridges-groups/mysql-php-group.json
+++ b/samples/cartridges-groups/mysql-php-group.json
@@ -7,7 +7,7 @@
     ],
     "dependencies": {
         "startupOrders": [
-            "cartridge.mysql1,cartridge.php1"
+            "cartridge.my-mysql,cartridge.my-php"
         ],
         "scalingDependants": [
         ],