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/26 10:03:54 UTC
stratos git commit: updating wordpress sample
Repository: stratos
Updated Branches:
refs/heads/master-deployment-policy-fix-merge 7d740c80f -> ea0fde232
updating wordpress sample
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/ea0fde23
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/ea0fde23
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/ea0fde23
Branch: refs/heads/master-deployment-policy-fix-merge
Commit: ea0fde232016345f4c58ec168051a41f47ab5d3e
Parents: 7d740c8
Author: R-Rajkumar <rr...@gmail.com>
Authored: Thu Feb 26 14:33:35 2015 +0530
Committer: R-Rajkumar <rr...@gmail.com>
Committed: Thu Feb 26 14:33:35 2015 +0530
----------------------------------------------------------------------
.../wordpress/artifacts/application-policy.json | 12 ++++++++++++
.../wordpress/artifacts/application.json | 3 +++
.../wordpress/artifacts/deployment-policy.json | 15 +++++++++++++++
.../wordpress/artifacts/network-partition-2.json | 15 +++++++++++++++
.../wordpress/artifacts/network-partition.json | 15 +++++++++++++++
.../applications/wordpress/scripts/common/deploy.sh | 9 ++++++++-
.../wordpress/scripts/common/undeploy.sh | 10 +++++++++-
7 files changed, 77 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/ea0fde23/samples/applications/wordpress/artifacts/application-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress/artifacts/application-policy.json b/samples/applications/wordpress/artifacts/application-policy.json
new file mode 100644
index 0000000..5aa91dd
--- /dev/null
+++ b/samples/applications/wordpress/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/ea0fde23/samples/applications/wordpress/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress/artifacts/application.json b/samples/applications/wordpress/artifacts/application.json
index 8d3b9fd..9a6b0d6 100644
--- a/samples/applications/wordpress/artifacts/application.json
+++ b/samples/applications/wordpress/artifacts/application.json
@@ -8,6 +8,7 @@
"alias": "mysql-php-group",
"groupMinInstances": 1,
"groupMaxInstances": 1,
+ "deploymentPolicy":"deployment-policy-1",
"cartridges": [
{
"type": "mysql",
@@ -15,6 +16,7 @@
"cartridgeMax": 5,
"subscribableInfo": {
"alias": "mysql1",
+ "deploymentPolicy":"deployment-policy-1",
"autoscalingPolicy": "autoscaling-policy-1"
}
},
@@ -24,6 +26,7 @@
"cartridgeMax": 5,
"subscribableInfo": {
"alias": "php1",
+ "deploymentPolicy":"deployment-policy-1",
"autoscalingPolicy": "autoscaling-policy-1",
"artifactRepository":{
"privateRepo":false,
http://git-wip-us.apache.org/repos/asf/stratos/blob/ea0fde23/samples/applications/wordpress/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress/artifacts/deployment-policy.json b/samples/applications/wordpress/artifacts/deployment-policy.json
new file mode 100644
index 0000000..666c299
--- /dev/null
+++ b/samples/applications/wordpress/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/ea0fde23/samples/applications/wordpress/artifacts/network-partition-2.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress/artifacts/network-partition-2.json b/samples/applications/wordpress/artifacts/network-partition-2.json
new file mode 100644
index 0000000..0d07838
--- /dev/null
+++ b/samples/applications/wordpress/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/ea0fde23/samples/applications/wordpress/artifacts/network-partition.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress/artifacts/network-partition.json b/samples/applications/wordpress/artifacts/network-partition.json
new file mode 100644
index 0000000..2a5b7ec
--- /dev/null
+++ b/samples/applications/wordpress/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/ea0fde23/samples/applications/wordpress/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress/scripts/common/deploy.sh b/samples/applications/wordpress/scripts/common/deploy.sh
index c44f06a..3a41d05 100755
--- a/samples/applications/wordpress/scripts/common/deploy.sh
+++ b/samples/applications/wordpress/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
@@ -40,4 +47,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/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/deploy
http://git-wip-us.apache.org/repos/asf/stratos/blob/ea0fde23/samples/applications/wordpress/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress/scripts/common/undeploy.sh b/samples/applications/wordpress/scripts/common/undeploy.sh
index 90a9442..8b20dc2 100644
--- a/samples/applications/wordpress/scripts/common/undeploy.sh
+++ b/samples/applications/wordpress/scripts/common/undeploy.sh
@@ -21,4 +21,12 @@ curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://
curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/mysql
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
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-1
+
+echo "Removing deployment policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies/deployment-policy-1
+
+echo "Removing network partitions..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-1
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-2
+