Skip to content
Browse files

Merge branch 'master' of github.com:dieu/petstore

  • Loading branch information...
2 parents 0ece3be + 8e34208 commit 911c29667b8b0416c027cfc6f56704b312fd10e6 Anton Panasenko committed Jun 7, 2012
View
2 db/mysql/jpetstore-database.properties.erb
@@ -1,4 +1,4 @@
jdbc.driverClassName=com.mysql.jdbc.Driver
-jdbc.url=jdbc:mysql://<%= @variables['hosts'] %>:<%= @variables['port'] %>/<%= @variables['database'] %>
+jdbc.url=jdbc:mysql://<%= @variables['hosts'].join(",") %>:<%= @variables['port'] %>/<%= @variables['database'] %>
jdbc.username=<%= @variables['user'] %>
jdbc.password=<%= @variables['password'] %>
View
2 db/mysql/jpetstore-mysql-dataload.sql
@@ -1,3 +1,5 @@
+use jpetstore;
+
INSERT INTO sequence VALUES ('ordernum', 1000);
INSERT INTO sequence VALUES ('linenum', 1000);
View
14 db/mysql/jpetstore-mysql-schema.sql
@@ -1,11 +1,9 @@
use jpetstore;
create table if not exists instance (
- ip varchar(80) not null,
-primary key (ip))
+ ipaddress varchar(80) not null,
+primary key (ipaddress))
type=innodb
-min_rows=0
-max_rows=1000
pack_keys=default
row_format=default;
@@ -32,9 +30,9 @@ create table if not exists signon (
password varchar(25) not null,
primary key (username))
type=innodb
-min_rows=0
-max_rows=1000
-pack_keys=default
+min_rows=0
+max_rows=1000
+pack_keys=default
row_format=default
comment='cadastro de usu�rios';
@@ -217,4 +215,4 @@ primary key (name) )
type=innodb
pack_keys=default
row_format=default
-comment='inventory';
+comment='inventory';
View
70 manifest.yml
@@ -59,8 +59,9 @@ launch:
precedingPhases: [ install-db ]
roles: [ db-node ]
jattrs:
- setup-database:
- script: "https://schema-with-test-data-location"
+ database:
+ scheme: "https://raw.github.com/dieu/petstore/master/db/mysql/jpetstore-mysql-schema.sql"
+ data: "https://raw.github.com/dieu/petstore/master/db/mysql/jpetstore-mysql-dataload.sql"
- deploy-app:
action: war.deploy
@@ -69,34 +70,29 @@ launch:
precedingPhases: [ install-app ]
roles: [ app-node ]
jattrs:
- petstore:
- db:
- $db-hosts
- app:
- war: "https://s3.amazonaws.com/undeploy-petstore/org.springframework.samples.jpetstore-${app-version}.war"
-
- # Strawman... We need to make this configuration action explicit. Let's discuss how it might look.
- #- configure-datasource:
- # action: propfile.replace
- # phase: deploy-app
- # precedingPhases: [ deploy-app, deploy-db ]
- # parameters:
- # jattrs:
- # propfile.replace:
- # source:
- # "%DB%"
- # target:
- # $dbhosts
+ war:
+ deploy: "https://s3.amazonaws.com/undeploy-petstore/org.springframework.samples.jpetstore-${app-version}.war"
+
+ - configure-datasource:
+ action: propfile.configure
+ phase: deploy-app
+ precedingPhases: [ deploy-app, deploy-db ]
+ parameters:
+ jattrs:
+ configure:
+ source: "https://raw.github.com/dieu/petstore/master/db/mysql/jpetstore-database.properties.erb"
+ to: "jdbc.properties"
+ variables:
+ hosts: $db-hosts
- setup-lb:
action: haproxy.rebalance
parameters:
precedingPhases: [ deploy-app ]
roles: [ lb-node ]
jattrs:
- petstore:
- lb:
- nodes: $app-hosts
+ haproxy.rebalance:
+ nodes: $app-hosts
return:
app-url:
@@ -138,21 +134,19 @@ scale-up:
precedingPhases: [ install-app ]
roles: [ app-node ]
jattrs:
- petstore:
- db:
- $db-hosts
- app:
- war: "https://s3.amazonaws.com/undeploy-petstore/org.springframework.samples.jpetstore-${app-version}.war"
+ database:
+ hosts: $db-hosts
+ war:
+ deploy: "https://s3.amazonaws.com/undeploy-petstore/org.springframework.samples.jpetstore-${app-version}.war"
- update-lb:
action: haproxy.rebalance
parameters:
precedingPhases: [ deploy-app ]
roles: [ lb-node ]
jattrs:
- petstore:
- lb:
- nodes: $app-hosts
+ haproxy.rebalance:
+ nodes: $app-hosts
scale-down:
parameters:
@@ -174,9 +168,8 @@ scale-down:
precedingPhases: [ deploy-app ]
roles: [ lb-node ]
jattrs:
- petstore:
- lb:
- nodes: $app-hosts
+ haproxy.rebalance:
+ nodes: $app-hosts
update:
parameters:
@@ -193,11 +186,10 @@ update:
parameters:
roles: [ app-node ]
jattrs:
- petstore:
- db:
- $db-hosts
- app:
- war: "https://s3.amazonaws.com/undeploy-petstore/org.springframework.samples.jpetstore-${app-version}.war"
+ database:
+ hosts: $db-hosts
+ war:
+ deploy: "https://s3.amazonaws.com/undeploy-petstore/org.springframework.samples.jpetstore-${app-version}.war"
destroy:
steps:

0 comments on commit 911c296

Please sign in to comment.
Something went wrong with that request. Please try again.