http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/artifacts/application.json ---------------------------------------------------------------------- diff --git a/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/artifacts/application.json b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/artifacts/application.json new file mode 100644 index 0000000..10f8c83 --- /dev/null +++ b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/artifacts/application.json @@ -0,0 +1,121 @@ +{ + "alias": "mycompositeapp", + "applicationId": "my-compositeapp", + "components": { + "groups": [ + { + "name": "app-group", + "alias": "my-appgroup", + "cartridges": [ + { + "type": "tomcat", + "cartridgeMax": 2, + "cartridgeMin": 1, + "subscribableInfo": { + "alias": "my-tomcat", + "artifactRepository": { + "alias": "my-tomcat", + "privateRepo": true, + "repoPassword": "password", + "repoUrl": "http://xxx:10080/git/default.git", + "repoUsername": "user" + }, + "autoscalingPolicy": "autoscaling-policy-1", + "deploymentPolicy": "deployment-policy-2" + } + }, + { + "type": "php", + "cartridgeMax": 2, + "cartridgeMin": 1, + "subscribableInfo": { + "alias": "my-php", + "artifactRepository": { + + "privateRepo": true, + "repoPassword": "password", + "repoUrl": "http://xxx:10080/git/default.git", + "repoUsername": "user" + }, + "autoscalingPolicy": "autoscaling-policy-1", + "deploymentPolicy": "deployment-policy-2" + } + } + ], + "groupMaxInstances": 2, + "groupMinInstances": 1, + "groupScalingEnabled": true + }, + { + "name": "db-group", + "alias": "my-dbgroup", + "cartridges": [ + { + "type": "postgres", + "cartridgeMax": 2, + "cartridgeMin": 1, + "subscribableInfo": { + "alias": "my-postgres", + "artifactRepository": { + "alias": "my-postgres", + "privateRepo": false, + "repoPassword": "password", + "repoUrl": "http://xxx:10080/git/default.git", + "repoUsername": "user" + }, + "autoscalingPolicy": "autoscaling-policy-1", + "deploymentPolicy": "deployment-policy-2" + } + }, + { + "type": "mysql", + "cartridgeMax": 2, + "cartridgeMin": 1, + "subscribableInfo": { + "alias": "my-mysql", + "artifactRepository": { + "alias": "my-mysql", + "privateRepo": true, + "repoPassword": "password", + "repoUrl": "http://xxx:10080/git/default.git", + "repoUsername": "user" + }, + "autoscalingPolicy": "autoscaling-policy-1", + "deploymentPolicy": "deployment-policy-2" + } + } + ], + "groupMaxInstances": 2, + "groupMinInstances": 1, + "groupScalingEnabled": true + } + ], + "cartridges": [ + { + "type": "esb", + "cartridgeMax": 2, + "cartridgeMin": 1, + "subscribableInfo": { + "alias": "my-esb", + "artifactRepository": { + "privateRepo": true, + "repoPassword": "password", + "repoUrl": "http://xxx:10080/git/default.git", + "repoUsername": "user" + }, + "autoscalingPolicy": "autoscaling-policy-1", + "deploymentPolicy": "deployment-policy-2" + } + } + ], + "dependencies": { + "scalingDependants": { + "@xsi.nil": "true" + }, + "startupOrders": [ + "group.my-dbgroup,group.my-appgroup","group.my-dbgroup,cartridge.my-esb" + ], + "terminationBehaviour": "terminate-none" + } + } + }
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-domain-mappings.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-domain-mappings.sh b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-domain-mappings.sh new file mode 100755 index 0000000..74c6ed7 --- /dev/null +++ b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-domain-mappings.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +export host_ip="localhost" +export artifacts_path="../../artifacts" + +pushd ${artifacts_path} +echo "Adding domain mappings..." +curl -X POST -H "Content-Type: application/json" -d @'domain-mappings.json' -k -u admin:admin https://${host_ip}:9443/api/applications/single-cartridge-app/domainMappings +popd \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-network-partition.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-network-partition.sh b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-network-partition.sh new file mode 100644 index 0000000..56c7c6c --- /dev/null +++ b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-network-partition.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +export host_ip="localhost" +export artifacts_path="../../artifacts" + +pushd ${artifacts_path} +echo "Adding network partition..." +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 +popd http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/deploy.sh b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/deploy.sh new file mode 100755 index 0000000..3023afc --- /dev/null +++ b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/deploy.sh @@ -0,0 +1,65 @@ +#!/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` +autoscaling_policies_path=`cd "${script_path}/../../../../../autoscaling-policies"; pwd` +network_partitions_path=`cd "${script_path}/../../../../../network-partitions/${iaas}"; pwd` +deployment_policies_path=`cd "${script_path}/../../../../../deployment-policies"; pwd` +application_policies_path=`cd "${script_path}/../../../../../application-policies"; pwd` + +set -e + +if [[ -z "${iaas}" ]]; then + echo "Usage: deploy.sh [iaas]" + exit +fi + +echo ${autoscaling_policies_path}/autoscaling-policy-1.json +echo "Adding autoscale policy..." +curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-1.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 "@${network_partitions_path}/network-partition-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions +curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions + +echo "Adding deployment policies..." +curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies +curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-2.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 +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/postgres.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/esb.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges +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 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 mysql-php-group group..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/app-group.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/db-group.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups + +sleep 1 + +echo "Adding application policy..." +curl -X POST -H "Content-Type: application/json" -d "@${application_policies_path}/application-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies + +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" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/my-compositeapp/deploy/application-policy-1 + http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/get-application-runtime.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/get-application-runtime.sh b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/get-application-runtime.sh new file mode 100755 index 0000000..ed80688 --- /dev/null +++ b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/get-application-runtime.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +iaas=$1 +host_ip="localhost" +host_port=9443 + +set -e + +echo "Getting application runtime..." +curl -X GET -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/single-cartridge-app/runtime http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-domain-mappings.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-domain-mappings.sh b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-domain-mappings.sh new file mode 100755 index 0000000..0b49f6f --- /dev/null +++ b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-domain-mappings.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "Listing domain mappings..." +curl -X GET -H "Content-Type: application/json" -k -u admin:admin https://localhost:9443/api/applications/single-cartridge-app/domainMappings \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-network-partition.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-network-partition.sh b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-network-partition.sh new file mode 100755 index 0000000..6e3812d --- /dev/null +++ b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-network-partition.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "Listing network partitions..." +curl -X GET -H "Content-Type: application/json" -k -u admin:admin https://localhost:9443/api/networkPartitions \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/undeploy.sh b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/undeploy.sh new file mode 100644 index 0000000..54613ed --- /dev/null +++ b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/undeploy.sh @@ -0,0 +1,37 @@ +#!/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/my-compositeapp/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/my-compositeapp + +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/postgres +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 +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/esb + + +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 + +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 +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies/deployment-policy-2 + +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 + +echo "Removing application policies..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies/application-policy-1 + http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/update-deployment-policy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/update-deployment-policy.sh b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/update-deployment-policy.sh new file mode 100755 index 0000000..d28fb40 --- /dev/null +++ b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/common/update-deployment-policy.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +iaas=$1 +host_ip="localhost" +host_port=9443 + +script_path=`cd "$prgdir"; pwd` + +deployment_policies_path=`cd "${script_path}/../../../../../deployment-policies"; pwd` + +curl -X PUT -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies + http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/mock/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/mock/deploy.sh b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/mock/deploy.sh new file mode 100755 index 0000000..93f8517 --- /dev/null +++ b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/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/aaa8a0f4/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/mock/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/mock/undeploy.sh b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/scripts/mock/undeploy.sh new file mode 100755 index 0000000..17d8c71 --- /dev/null +++ b/samples/applications/complex/php-tomcat-group-postgres-mysql-group-esb/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/aaa8a0f4/samples/applications/complex/tomcat-single-signon/README.md ---------------------------------------------------------------------- diff --git a/samples/applications/complex/tomcat-single-signon/README.md b/samples/applications/complex/tomcat-single-signon/README.md new file mode 100644 index 0000000..5247a3f --- /dev/null +++ b/samples/applications/complex/tomcat-single-signon/README.md @@ -0,0 +1,30 @@ +#Tomcat Single Sign On Sample Application + +This sample application demonstrate how Single Sign On (SAML2) configuration can be automated with Composite +Application Model using Tomcat and WSO2 Identity Server. It includes a cartridge for Tomcat 7 and WSO2 Identity +Server 5.0.0 and a set of cartridge agent plugins for handling the SSO configuration. + +###Tomcat Dockerfile +https://github.com/apache/stratos/tree/master/tools/docker-images/cartridge-docker-images/service-images/tomcat-saml-sso/Dockerfile + +###Tomcat Cartridge Agent Plugins +https://github.com/apache/stratos/tree/master/tools/docker-images/cartridge-docker-images/service-images/tomcat-saml-sso/packs/plugins + +###WSO2 Identity Server Dockerfile: +https://github.com/apache/stratos/tree/master/tools/docker-images/cartridge-docker-images/service-images/wso2is-saml-sso/Dockerfile + +###WSO2 Identity Server Cartridge Agent Plugins +https://github.com/apache/stratos/tree/master/tools/docker-images/cartridge-docker-images/service-images/wso2is-saml-sso/packs/plugins + +###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 +``` \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/tomcat-single-signon/artifacts/application.json ---------------------------------------------------------------------- diff --git a/samples/applications/complex/tomcat-single-signon/artifacts/application.json b/samples/applications/complex/tomcat-single-signon/artifacts/application.json new file mode 100644 index 0000000..2f237c1 --- /dev/null +++ b/samples/applications/complex/tomcat-single-signon/artifacts/application.json @@ -0,0 +1,38 @@ +{ + "applicationId": "tomcat-single-signon", + "alias": "tomcat-single-signon", + "components": { + + "cartridges": [ + { + "type": "tomcat3", + "cartridgeMin": 1, + "cartridgeMax": 1, + "subscribableInfo": { + "alias": "mytomcat3", + "autoscalingPolicy": "autoscaling-policy-1", + "deploymentPolicy": "deployment-policy-3", + "artifactRepository":{ + "privateRepo":false, + "repoUrl":"https://github.com/chamilad/travelocity-sample", + "repoUsername":"", + "repoPassword":"" + } + } + }, + { + "type": "wso2is", + "cartridgeMin": 1, + "cartridgeMax": 1, + "subscribableInfo": { + "alias": "mywso2is", + "autoscalingPolicy": "autoscaling-policy-1", + "deploymentPolicy": "deployment-policy-3" + } + } + ], + "dependencies": { + "terminationBehaviour": "terminate-none" + } + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/tomcat-single-signon/scripts/common/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/tomcat-single-signon/scripts/common/deploy.sh b/samples/applications/complex/tomcat-single-signon/scripts/common/deploy.sh new file mode 100755 index 0000000..5507206 --- /dev/null +++ b/samples/applications/complex/tomcat-single-signon/scripts/common/deploy.sh @@ -0,0 +1,54 @@ +#!/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_cartridges_path=`cd "${script_path}/../../../../../cartridges/${iaas}"; pwd` +cartridges_groups_path=`cd "${script_path}/../../../../../cartridges-groups"; pwd` +autoscaling_policies_path=`cd "${script_path}/../../../../../autoscaling-policies"; pwd` +network_partitions_path=`cd "${script_path}/../../../../../network-partitions/${iaas}"; pwd` +deployment_policies_path=`cd "${script_path}/../../../../../deployment-policies"; pwd` +application_policies_path=`cd "${script_path}/../../../../../application-policies"; 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 "@${autoscaling_policies_path}/autoscaling-policy-1.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 "@${network_partitions_path}/network-partition-3.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions + +echo "Adding deployment policy..." +curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-3.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies + +echo "Adding tomcat cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${iaas_cartridges_path}/tomcat3.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +echo "Adding wso2-is cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${iaas_cartridges_path}/wso2-is.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +sleep 1 + +echo "Adding application policy..." +curl -X POST -H "Content-Type: application/json" -d "@${application_policies_path}/application-policy-2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies + +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" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/tomcat-single-signon/deploy/application-policy-2 http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/tomcat-single-signon/scripts/common/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/tomcat-single-signon/scripts/common/undeploy.sh b/samples/applications/complex/tomcat-single-signon/scripts/common/undeploy.sh new file mode 100644 index 0000000..9e50142 --- /dev/null +++ b/samples/applications/complex/tomcat-single-signon/scripts/common/undeploy.sh @@ -0,0 +1,27 @@ +#!/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/tomcat-single-signon/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/single-cartridge-app + +echo "Removing cartridges..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat3 +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/wso2-is + +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 + +echo "Removing application policies..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies/application-policy-2 + + + http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/tomcat-single-signon/scripts/ec2/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/tomcat-single-signon/scripts/ec2/deploy.sh b/samples/applications/complex/tomcat-single-signon/scripts/ec2/deploy.sh new file mode 100755 index 0000000..1370667 --- /dev/null +++ b/samples/applications/complex/tomcat-single-signon/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/aaa8a0f4/samples/applications/complex/tomcat-single-signon/scripts/ec2/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/tomcat-single-signon/scripts/ec2/undeploy.sh b/samples/applications/complex/tomcat-single-signon/scripts/ec2/undeploy.sh new file mode 100644 index 0000000..17d8c71 --- /dev/null +++ b/samples/applications/complex/tomcat-single-signon/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/aaa8a0f4/samples/applications/complex/tomcat-single-signon/scripts/kubernetes/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/tomcat-single-signon/scripts/kubernetes/deploy.sh b/samples/applications/complex/tomcat-single-signon/scripts/kubernetes/deploy.sh new file mode 100755 index 0000000..eab754c --- /dev/null +++ b/samples/applications/complex/tomcat-single-signon/scripts/kubernetes/deploy.sh @@ -0,0 +1,16 @@ +#!/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` +kubernetes_clusters_path=`cd "${script_path}/../../../../../kubernetes-clusters"; pwd` + + +echo "Adding kubernetes cluster..." +curl -X POST -H "Content-Type: application/json" -d "@${kubernetes_clusters_path}/kubernetes-cluster-1.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/aaa8a0f4/samples/applications/complex/tomcat-single-signon/scripts/kubernetes/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/tomcat-single-signon/scripts/kubernetes/undeploy.sh b/samples/applications/complex/tomcat-single-signon/scripts/kubernetes/undeploy.sh new file mode 100755 index 0000000..c450ea0 --- /dev/null +++ b/samples/applications/complex/tomcat-single-signon/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-ec2 http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/tomcat-single-signon/scripts/mock/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/tomcat-single-signon/scripts/mock/deploy.sh b/samples/applications/complex/tomcat-single-signon/scripts/mock/deploy.sh new file mode 100755 index 0000000..93f8517 --- /dev/null +++ b/samples/applications/complex/tomcat-single-signon/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/aaa8a0f4/samples/applications/complex/tomcat-single-signon/scripts/mock/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/tomcat-single-signon/scripts/mock/undeploy.sh b/samples/applications/complex/tomcat-single-signon/scripts/mock/undeploy.sh new file mode 100755 index 0000000..17d8c71 --- /dev/null +++ b/samples/applications/complex/tomcat-single-signon/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/aaa8a0f4/samples/applications/complex/tomcat-single-signon/scripts/openstack/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/tomcat-single-signon/scripts/openstack/deploy.sh b/samples/applications/complex/tomcat-single-signon/scripts/openstack/deploy.sh new file mode 100755 index 0000000..4c39959 --- /dev/null +++ b/samples/applications/complex/tomcat-single-signon/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/aaa8a0f4/samples/applications/complex/tomcat-single-signon/scripts/openstack/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/tomcat-single-signon/scripts/openstack/undeploy.sh b/samples/applications/complex/tomcat-single-signon/scripts/openstack/undeploy.sh new file mode 100644 index 0000000..17d8c71 --- /dev/null +++ b/samples/applications/complex/tomcat-single-signon/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/aaa8a0f4/samples/applications/complex/wordpress-app/README.md ---------------------------------------------------------------------- diff --git a/samples/applications/complex/wordpress-app/README.md b/samples/applications/complex/wordpress-app/README.md new file mode 100644 index 0000000..9b61ca1 --- /dev/null +++ b/samples/applications/complex/wordpress-app/README.md @@ -0,0 +1,20 @@ +Wordpress Application +===================== +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 +---------------------------- +``` +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/aaa8a0f4/samples/applications/complex/wordpress-app/artifacts/application.json ---------------------------------------------------------------------- diff --git a/samples/applications/complex/wordpress-app/artifacts/application.json b/samples/applications/complex/wordpress-app/artifacts/application.json new file mode 100644 index 0000000..4220fe2 --- /dev/null +++ b/samples/applications/complex/wordpress-app/artifacts/application.json @@ -0,0 +1,41 @@ +{ + "applicationId": "wordpress", + "alias": "wordpress", + "components": { + "groups": [ + { + "name": "mysql-php-group", + "alias": "mysql-php-group", + "groupMinInstances": 1, + "groupMaxInstances": 1, + "cartridges": [ + { + "type": "mysql", + "cartridgeMin": 2, + "cartridgeMax": 5, + "subscribableInfo": { + "alias": "my-mysql", + "deploymentPolicy":"deployment-policy-2", + "autoscalingPolicy": "autoscaling-policy-1" + } + }, + { + "type": "php", + "cartridgeMin": 2, + "cartridgeMax": 5, + "subscribableInfo": { + "alias": "my-php", + "deploymentPolicy":"deployment-policy-2", + "autoscalingPolicy": "autoscaling-policy-1", + "artifactRepository":{ + "privateRepo":false, + "repoUrl":"https://github.com/imesh/stratos-php-applications.git" + } + } + } + ] + } + ] + } +} + http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/wordpress-app/scripts/common/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/wordpress-app/scripts/common/deploy.sh b/samples/applications/complex/wordpress-app/scripts/common/deploy.sh new file mode 100755 index 0000000..d76e621 --- /dev/null +++ b/samples/applications/complex/wordpress-app/scripts/common/deploy.sh @@ -0,0 +1,60 @@ +#!/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` +autoscaling_policies_path=`cd "${script_path}/../../../../../autoscaling-policies"; pwd` +network_partitions_path=`cd "${script_path}/../../../../../network-partitions/${iaas}"; pwd` +deployment_policies_path=`cd "${script_path}/../../../../../deployment-policies"; pwd` +application_policies_path=`cd "${script_path}/../../../../../application-policies"; pwd` + +set -e + +if [[ -z "${iaas}" ]]; then + echo "Usage: deploy.sh [iaas]" + exit +fi + +echo ${autoscaling_policies_path}/autoscaling-policy-1.json +echo "Adding autoscale policy..." +curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-1.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 "@${network_partitions_path}/network-partition-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions +curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions + +echo "Adding deployment policies..." +curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies +curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-2.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 + +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 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 "Adding application policy..." +curl -X POST -H "Content-Type: application/json" -d "@${application_policies_path}/application-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies + +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" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/wordpress/deploy/application-policy-1 http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/wordpress-app/scripts/common/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/wordpress-app/scripts/common/undeploy.sh b/samples/applications/complex/wordpress-app/scripts/common/undeploy.sh new file mode 100644 index 0000000..7969cca --- /dev/null +++ b/samples/applications/complex/wordpress-app/scripts/common/undeploy.sh @@ -0,0 +1,35 @@ +#!/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/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 + +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 + +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 + +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 +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies/deployment-policy-2 + +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 + +echo "Removing application policies..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies/application-policy-1 http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/wordpress-app/scripts/ec2/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/wordpress-app/scripts/ec2/deploy.sh b/samples/applications/complex/wordpress-app/scripts/ec2/deploy.sh new file mode 100755 index 0000000..1370667 --- /dev/null +++ b/samples/applications/complex/wordpress-app/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/aaa8a0f4/samples/applications/complex/wordpress-app/scripts/ec2/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/wordpress-app/scripts/ec2/undeploy.sh b/samples/applications/complex/wordpress-app/scripts/ec2/undeploy.sh new file mode 100644 index 0000000..17d8c71 --- /dev/null +++ b/samples/applications/complex/wordpress-app/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/aaa8a0f4/samples/applications/complex/wordpress-app/scripts/kubernetes/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/wordpress-app/scripts/kubernetes/deploy.sh b/samples/applications/complex/wordpress-app/scripts/kubernetes/deploy.sh new file mode 100755 index 0000000..c8f11f7 --- /dev/null +++ b/samples/applications/complex/wordpress-app/scripts/kubernetes/deploy.sh @@ -0,0 +1,16 @@ +#!/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` +kubernetes_clusters_path=`cd "${script_path}/../../../../../kubernets-clusters"; pwd` + +echo "Adding kubernetes cluster..." +curl -X POST -H "Content-Type: application/json" -d "@${kubernetes_clusters_path}/kubernetes-cluster-1.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters + +bash ${common_folder}/deploy.sh ${iaas} http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/complex/wordpress-app/scripts/kubernetes/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/wordpress-app/scripts/kubernetes/undeploy.sh b/samples/applications/complex/wordpress-app/scripts/kubernetes/undeploy.sh new file mode 100644 index 0000000..0054670 --- /dev/null +++ b/samples/applications/complex/wordpress-app/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/aaa8a0f4/samples/applications/complex/wordpress-app/scripts/mock/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/wordpress-app/scripts/mock/deploy.sh b/samples/applications/complex/wordpress-app/scripts/mock/deploy.sh new file mode 100755 index 0000000..93f8517 --- /dev/null +++ b/samples/applications/complex/wordpress-app/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/aaa8a0f4/samples/applications/complex/wordpress-app/scripts/mock/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/wordpress-app/scripts/mock/undeploy.sh b/samples/applications/complex/wordpress-app/scripts/mock/undeploy.sh new file mode 100755 index 0000000..17d8c71 --- /dev/null +++ b/samples/applications/complex/wordpress-app/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/aaa8a0f4/samples/applications/complex/wordpress-app/scripts/openstack/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/wordpress-app/scripts/openstack/deploy.sh b/samples/applications/complex/wordpress-app/scripts/openstack/deploy.sh new file mode 100755 index 0000000..4c39959 --- /dev/null +++ b/samples/applications/complex/wordpress-app/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/aaa8a0f4/samples/applications/complex/wordpress-app/scripts/openstack/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex/wordpress-app/scripts/openstack/undeploy.sh b/samples/applications/complex/wordpress-app/scripts/openstack/undeploy.sh new file mode 100644 index 0000000..17d8c71 --- /dev/null +++ b/samples/applications/complex/wordpress-app/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/aaa8a0f4/samples/applications/dependent-scaling/sample-cartridges/README.md ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-cartridges/README.md b/samples/applications/dependent-scaling/sample-cartridges/README.md deleted file mode 100644 index 34feba2..0000000 --- a/samples/applications/dependent-scaling/sample-cartridges/README.md +++ /dev/null @@ -1,13 +0,0 @@ -sample-cartridges -================= - -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/aaa8a0f4/samples/applications/dependent-scaling/sample-cartridges/artifacts/application.json ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-cartridges/artifacts/application.json b/samples/applications/dependent-scaling/sample-cartridges/artifacts/application.json deleted file mode 100644 index 03fe033..0000000 --- a/samples/applications/dependent-scaling/sample-cartridges/artifacts/application.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "applicationId": "dependency-scaling-cartridges-app", - "alias": "my-dependency-scaling-cartridges-app", - "components": { - "cartridges": [ - { - "type": "tomcat", - "cartridgeMin": 1, - "cartridgeMax": 2, - "subscribableInfo": { - "alias": "my-tomcat", - "autoscalingPolicy": "autoscaling-policy-1", - "deploymentPolicy":"deployment-policy-1", - "artifactRepository":{ - "privateRepo":false, - "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git", - "repoUsername":"", - "repoPassword":"" - } - } - }, - { - "type": "php", - "cartridgeMin": 2, - "cartridgeMax": 4, - "subscribableInfo": { - "alias": "my-php", - "autoscalingPolicy": "autoscaling-policy-1", - "deploymentPolicy":"deployment-policy-1", - "artifactRepository":{ - "privateRepo":false, - "repoUrl":"https://github.com/imesh/stratos-php-applications.git", - "repoUsername":"", - "repoPassword":"" - } - } - } - ], - "dependencies": { - "scalingDependants": [ - "cartridge.my-tomcat, cartridge.my-php" - ], - "terminationBehaviour": "terminate-none" - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/dependent-scaling/sample-cartridges/scripts/common/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-cartridges/scripts/common/deploy.sh b/samples/applications/dependent-scaling/sample-cartridges/scripts/common/deploy.sh deleted file mode 100755 index b55c736..0000000 --- a/samples/applications/dependent-scaling/sample-cartridges/scripts/common/deploy.sh +++ /dev/null @@ -1,53 +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` -cartridges_path=`cd "${script_path}/../../../../../cartridges/${iaas}"; pwd` -autoscaling_policies_path=`cd "${script_path}/../../../../../autoscaling-policies"; pwd` -network_partitions_path=`cd "${script_path}/../../../../../network-partitions/${iaas}"; pwd` -deployment_policies_path=`cd "${script_path}/../../../../../deployment-policies"; pwd` -application_policies_path=`cd "${script_path}/../../../../../application-policies"; pwd` - -set -e - -if [[ -z "${iaas}" ]]; then - echo "Usage: deploy.sh [iaas]" - exit -fi - -echo ${autoscaling_policies_path}/autoscaling-policy-1.json -echo "Adding autoscale policy..." -curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-1.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 "@${network_partitions_path}/network-partition-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions - -echo "Adding deployment policies..." -curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies - -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 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 - -sleep 1 -echo "Adding application policy..." -curl -X POST -H "Content-Type: application/json" -d "@${application_policies_path}/application-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies - - -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" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/dependency-scaling-cartridges-app/deploy/application-policy-1 - http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/dependent-scaling/sample-cartridges/scripts/common/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-cartridges/scripts/common/undeploy.sh b/samples/applications/dependent-scaling/sample-cartridges/scripts/common/undeploy.sh deleted file mode 100644 index 79ce013..0000000 --- a/samples/applications/dependent-scaling/sample-cartridges/scripts/common/undeploy.sh +++ /dev/null @@ -1,21 +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/sample-cartridges-app/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/sample-cartridges-app - -echo "Removing cartridges..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/php - -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/aaa8a0f4/samples/applications/dependent-scaling/sample-cartridges/scripts/ec2/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-cartridges/scripts/ec2/deploy.sh b/samples/applications/dependent-scaling/sample-cartridges/scripts/ec2/deploy.sh deleted file mode 100755 index 1370667..0000000 --- a/samples/applications/dependent-scaling/sample-cartridges/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/aaa8a0f4/samples/applications/dependent-scaling/sample-cartridges/scripts/ec2/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-cartridges/scripts/ec2/undeploy.sh b/samples/applications/dependent-scaling/sample-cartridges/scripts/ec2/undeploy.sh deleted file mode 100644 index 17d8c71..0000000 --- a/samples/applications/dependent-scaling/sample-cartridges/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/aaa8a0f4/samples/applications/dependent-scaling/sample-cartridges/scripts/kubernetes/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-cartridges/scripts/kubernetes/deploy.sh b/samples/applications/dependent-scaling/sample-cartridges/scripts/kubernetes/deploy.sh deleted file mode 100755 index 32eff3c..0000000 --- a/samples/applications/dependent-scaling/sample-cartridges/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/aaa8a0f4/samples/applications/dependent-scaling/sample-cartridges/scripts/kubernetes/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-cartridges/scripts/kubernetes/undeploy.sh b/samples/applications/dependent-scaling/sample-cartridges/scripts/kubernetes/undeploy.sh deleted file mode 100644 index 0054670..0000000 --- a/samples/applications/dependent-scaling/sample-cartridges/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/aaa8a0f4/samples/applications/dependent-scaling/sample-cartridges/scripts/mock/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-cartridges/scripts/mock/deploy.sh b/samples/applications/dependent-scaling/sample-cartridges/scripts/mock/deploy.sh deleted file mode 100755 index 93f8517..0000000 --- a/samples/applications/dependent-scaling/sample-cartridges/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/aaa8a0f4/samples/applications/dependent-scaling/sample-cartridges/scripts/mock/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-cartridges/scripts/mock/undeploy.sh b/samples/applications/dependent-scaling/sample-cartridges/scripts/mock/undeploy.sh deleted file mode 100755 index 17d8c71..0000000 --- a/samples/applications/dependent-scaling/sample-cartridges/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/aaa8a0f4/samples/applications/dependent-scaling/sample-cartridges/scripts/openstack/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-cartridges/scripts/openstack/deploy.sh b/samples/applications/dependent-scaling/sample-cartridges/scripts/openstack/deploy.sh deleted file mode 100755 index 4c39959..0000000 --- a/samples/applications/dependent-scaling/sample-cartridges/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/aaa8a0f4/samples/applications/dependent-scaling/sample-cartridges/scripts/openstack/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-cartridges/scripts/openstack/undeploy.sh b/samples/applications/dependent-scaling/sample-cartridges/scripts/openstack/undeploy.sh deleted file mode 100644 index 17d8c71..0000000 --- a/samples/applications/dependent-scaling/sample-cartridges/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/aaa8a0f4/samples/applications/dependent-scaling/sample-groups/README.md ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-groups/README.md b/samples/applications/dependent-scaling/sample-groups/README.md deleted file mode 100644 index d1adf79..0000000 --- a/samples/applications/dependent-scaling/sample-groups/README.md +++ /dev/null @@ -1,13 +0,0 @@ -sample-groups -============= - -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/aaa8a0f4/samples/applications/dependent-scaling/sample-groups/artifacts/application.json ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-groups/artifacts/application.json b/samples/applications/dependent-scaling/sample-groups/artifacts/application.json deleted file mode 100644 index f261596..0000000 --- a/samples/applications/dependent-scaling/sample-groups/artifacts/application.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "applicationId": "dependency-scaling-groups-app", - "alias": "my-dependency-scaling-groups-app", - "components": { - "groups": [ - { - "name": "esb-php-group", - "alias": "my-esb-php-group", - "groupMinInstances": 1, - "groupMaxInstances": 2, - "deploymentPolicy": "deployment-policy-1", - "cartridges": [ - { - "type": "esb", - "cartridgeMin": 1, - "cartridgeMax": 2, - "subscribableInfo": { - "alias": "my-esb", - "autoscalingPolicy": "autoscaling-policy-1", - "deploymentPolicy":"deployment-policy-1", - "artifactRepository":{ - "privateRepo":false, - "repoUrl":"https://github.com/imesh/stratos-esb-applications.git", - "repoUsername":"", - "repoPassword":"" - } - } - }, - { - "type": "php", - "cartridgeMin": 1, - "cartridgeMax": 2, - "subscribableInfo": { - "alias": "my-php", - "autoscalingPolicy": "autoscaling-policy-1", - "deploymentPolicy":"deployment-policy-1", - "artifactRepository":{ - "privateRepo":false, - "repoUrl":"https://github.com/imesh/stratos-php-applications.git", - "repoUsername":"", - "repoPassword":"" - } - } - } - ] - } - ], - "cartridges": [ - { - "type": "tomcat", - "cartridgeMin": 2, - "cartridgeMax": 4, - "subscribableInfo": { - "alias": "my-tomcat", - "autoscalingPolicy": "autoscaling-policy-1", - "deploymentPolicy":"deployment-policy-1", - "artifactRepository":{ - "privateRepo":false, - "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git", - "repoUsername":"", - "repoPassword":"" - } - } - } - ], - "dependencies": { - "scalingDependants": [ - "group.my-esb-php-group, cartridge.my-tomcat" - ], - "terminationBehaviour": "terminate-none" - } - } -} - http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/dependent-scaling/sample-groups/scripts/common/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-groups/scripts/common/deploy.sh b/samples/applications/dependent-scaling/sample-groups/scripts/common/deploy.sh deleted file mode 100755 index 884b33c..0000000 --- a/samples/applications/dependent-scaling/sample-groups/scripts/common/deploy.sh +++ /dev/null @@ -1,58 +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` -cartridges_path=`cd "${script_path}/../../../../../cartridges/${iaas}"; pwd` -cartridges_groups_path=`cd "${script_path}/../../../../../cartridges-groups"; pwd` -autoscaling_policies_path=`cd "${script_path}/../../../../../autoscaling-policies"; pwd` -network_partitions_path=`cd "${script_path}/../../../../../network-partitions/${iaas}"; pwd` -deployment_policies_path=`cd "${script_path}/../../../../../deployment-policies"; pwd` -application_policies_path=`cd "${script_path}/../../../../../application-policies"; pwd` - -set -e - -if [[ -z "${iaas}" ]]; then - echo "Usage: deploy.sh [iaas]" - exit -fi - -echo ${autoscaling_policies_path}/autoscaling-policy-1.json -echo "Adding autoscale policy..." -curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-1.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 "@${network_partitions_path}/network-partition-1.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions - -echo "Adding deployment policies..." -curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies - -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 esb cartridge..." -curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/esb.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 esb-php-group group..." -curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/esb-php-group.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups - -sleep 1 -echo "Adding application policy..." -curl -X POST -H "Content-Type: application/json" -d "@${application_policies_path}/application-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies - -sleep 1 -echo "Adding 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" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/dependency-scaling-groups-app/deploy/application-policy-1 - http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/dependent-scaling/sample-groups/scripts/common/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-groups/scripts/common/undeploy.sh b/samples/applications/dependent-scaling/sample-groups/scripts/common/undeploy.sh deleted file mode 100644 index a69d60d..0000000 --- a/samples/applications/dependent-scaling/sample-groups/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/dependency-scaling-groups-app/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/dependency-scaling-groups-app - -echo "Removing groups..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups/esb-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/tomcat -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/esb -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/php - -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 http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/dependent-scaling/sample-groups/scripts/ec2/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-groups/scripts/ec2/deploy.sh b/samples/applications/dependent-scaling/sample-groups/scripts/ec2/deploy.sh deleted file mode 100755 index 1370667..0000000 --- a/samples/applications/dependent-scaling/sample-groups/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/aaa8a0f4/samples/applications/dependent-scaling/sample-groups/scripts/ec2/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-groups/scripts/ec2/undeploy.sh b/samples/applications/dependent-scaling/sample-groups/scripts/ec2/undeploy.sh deleted file mode 100644 index 17d8c71..0000000 --- a/samples/applications/dependent-scaling/sample-groups/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/aaa8a0f4/samples/applications/dependent-scaling/sample-groups/scripts/kubernetes/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-groups/scripts/kubernetes/deploy.sh b/samples/applications/dependent-scaling/sample-groups/scripts/kubernetes/deploy.sh deleted file mode 100755 index 32eff3c..0000000 --- a/samples/applications/dependent-scaling/sample-groups/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/aaa8a0f4/samples/applications/dependent-scaling/sample-groups/scripts/kubernetes/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-groups/scripts/kubernetes/undeploy.sh b/samples/applications/dependent-scaling/sample-groups/scripts/kubernetes/undeploy.sh deleted file mode 100644 index 0054670..0000000 --- a/samples/applications/dependent-scaling/sample-groups/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/aaa8a0f4/samples/applications/dependent-scaling/sample-groups/scripts/mock/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-groups/scripts/mock/deploy.sh b/samples/applications/dependent-scaling/sample-groups/scripts/mock/deploy.sh deleted file mode 100755 index 93f8517..0000000 --- a/samples/applications/dependent-scaling/sample-groups/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/aaa8a0f4/samples/applications/dependent-scaling/sample-groups/scripts/mock/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-groups/scripts/mock/undeploy.sh b/samples/applications/dependent-scaling/sample-groups/scripts/mock/undeploy.sh deleted file mode 100755 index 17d8c71..0000000 --- a/samples/applications/dependent-scaling/sample-groups/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/aaa8a0f4/samples/applications/dependent-scaling/sample-groups/scripts/openstack/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-groups/scripts/openstack/deploy.sh b/samples/applications/dependent-scaling/sample-groups/scripts/openstack/deploy.sh deleted file mode 100755 index 4c39959..0000000 --- a/samples/applications/dependent-scaling/sample-groups/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/aaa8a0f4/samples/applications/dependent-scaling/sample-groups/scripts/openstack/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/dependent-scaling/sample-groups/scripts/openstack/undeploy.sh b/samples/applications/dependent-scaling/sample-groups/scripts/openstack/undeploy.sh deleted file mode 100644 index 17d8c71..0000000 --- a/samples/applications/dependent-scaling/sample-groups/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/aaa8a0f4/samples/applications/esb-php-nested-with-esb-php-nested-with-mysql-php-app/README.md ---------------------------------------------------------------------- diff --git a/samples/applications/esb-php-nested-with-esb-php-nested-with-mysql-php-app/README.md b/samples/applications/esb-php-nested-with-esb-php-nested-with-mysql-php-app/README.md deleted file mode 100644 index af2349a..0000000 --- a/samples/applications/esb-php-nested-with-esb-php-nested-with-mysql-php-app/README.md +++ /dev/null @@ -1,23 +0,0 @@ -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/aaa8a0f4/samples/applications/esb-php-nested-with-esb-php-nested-with-mysql-php-app/artifacts/application.json ---------------------------------------------------------------------- diff --git a/samples/applications/esb-php-nested-with-esb-php-nested-with-mysql-php-app/artifacts/application.json b/samples/applications/esb-php-nested-with-esb-php-nested-with-mysql-php-app/artifacts/application.json deleted file mode 100644 index da8e512..0000000 --- a/samples/applications/esb-php-nested-with-esb-php-nested-with-mysql-php-app/artifacts/application.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "applicationId": "esb-php-nested-with-esb-php-nested-with-mysql-php-app", - "alias": "my-esb-php-nested-with-esb-php-nested-with-mysql-php-app", - "components": { - "groups": [ - { - "name": "esb-php-nested-with-esb-php-nested-with-mysql-php", - "alias": "my-esb-php-nested-with-esb-php-nested-with-mysql-php", - "groupMinInstances": 1, - "groupMaxInstances": 2, - "groups": [ - { - "name": "esb-php-nested-with-mysql-php", - "alias": "my-esb-php-nested-with-mysql-php", - "groupMinInstances": 1, - "groupMaxInstances": 2, - "groups": [ - { - "name": "mysql-php", - "alias": "my-mysql-php", - "groupMinInstances": 1, - "groupMaxInstances": 2, - "cartridges": [ - { - "type": "mysql", - "cartridgeMin": 2, - "cartridgeMax": 5, - "subscribableInfo": { - "alias": "my-mysql-php-mysql", - "deploymentPolicy":"deployment-policy-1", - "autoscalingPolicy": "autoscaling-policy-1" - } - }, - { - "type": "php", - "cartridgeMin": 2, - "cartridgeMax": 5, - "subscribableInfo": { - "alias": "my-mysql-php-php", - "deploymentPolicy":"deployment-policy-1", - "autoscalingPolicy": "autoscaling-policy-1", - "artifactRepository":{ - "privateRepo":false, - "repoUrl":"https://github.com/imesh/stratos-php-applications.git" - } - } - } - ] - } - ], - "cartridges": [ - { - "type": "esb", - "cartridgeMin": 2, - "cartridgeMax": 5, - "subscribableInfo": { - "alias": "my-esb-php-nested-with-mysql-php-esb", - "deploymentPolicy":"deployment-policy-1", - "autoscalingPolicy": "autoscaling-policy-1" - } - }, - { - "type": "php", - "cartridgeMin": 2, - "cartridgeMax": 5, - "subscribableInfo": { - "alias": "my-esb-php-nested-with-mysql-php-php", - "deploymentPolicy":"deployment-policy-1", - "autoscalingPolicy": "autoscaling-policy-1", - "artifactRepository":{ - "privateRepo":false, - "repoUrl":"https://github.com/imesh/stratos-php-applications.git" - } - } - } - ] - } - ], - "cartridges": [ - { - "type": "esb", - "cartridgeMin": 2, - "cartridgeMax": 5, - "subscribableInfo": { - "alias": "my-esb-php-nested-with-esb-php-nested-with-mysql-php-esb", - "deploymentPolicy":"deployment-policy-1", - "autoscalingPolicy": "autoscaling-policy-1" - } - }, - { - "type": "php", - "cartridgeMin": 2, - "cartridgeMax": 5, - "subscribableInfo": { - "alias": "my-esb-php-nested-with-esb-php-nested-with-mysql-php-php", - "deploymentPolicy":"deployment-policy-1", - "autoscalingPolicy": "autoscaling-policy-1", - "artifactRepository":{ - "privateRepo":false, - "repoUrl":"https://github.com/imesh/stratos-php-applications.git" - } - } - } - ] - } - ], - "cartridges" : [ - { - "type": "esb", - "cartridgeMin": 2, - "cartridgeMax": 5, - "subscribableInfo": { - "alias": "my-esb", - "deploymentPolicy":"deployment-policy-1", - "autoscalingPolicy": "autoscaling-policy-1", - "artifactRepository":{ - "privateRepo":false, - "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git" - } - } - } - ], - "cartridges" : [ - { - "type": "php", - "cartridgeMin": 2, - "cartridgeMax": 5, - "subscribableInfo": { - "alias": "my-php", - "deploymentPolicy":"deployment-policy-1", - "autoscalingPolicy": "autoscaling-policy-1", - "artifactRepository":{ - "privateRepo":false, - "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git" - } - } - } - ] - } -} -
