Skip to content

Commit

Permalink
Merge remote-tracking branch 'trunk'
Browse files Browse the repository at this point in the history
  • Loading branch information
fabrizyo committed Oct 22, 2015
2 parents fd6db73 + 8c51774 commit 1d17377
Show file tree
Hide file tree
Showing 6 changed files with 602 additions and 689 deletions.
26 changes: 16 additions & 10 deletions ChefCookbooks/installation.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
#!/bin/bash
#SpagoBI Chef installation script
set -e
set -x

#install chef 12 client
wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/10.04/x86_64/chef_12.5.1-1_amd64.deb
sudo dpkg -i chef_12.5.1-1_amd64.deb
rm -f chef_12.5.1-1_amd64.deb
if [ ! -d "/opt/chef" ]; then
wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/10.04/x86_64/chef_12.5.1-1_amd64.deb
sudo dpkg -i chef_12.5.1-1_amd64.deb
rm -f chef_12.5.1-1_amd64.deb
fi

#download recipes
sudo apt-get update -q
sudo apt-get -y install unzip
wget https://github.com/SpagoBILabs/SpagoBI/releases/download/fiware-v5.1-1feb2d97af/chef-cookbooks.zip
unzip chef-cookbooks.zip
rm -f chef-cookbooks.zip
sudo apt-get -y install subversion
rm -rf cookbooks
svn checkout https://github.com/SpagoBILabs/SpagoBI/trunk/ChefCookbooks/ cookbooks


#install spagobi
sudo chef-client -z -o 'recipe[spagobi::1.0.2_install]'
if [ "$1" == "demo" ]; then
echo '{"demo":true}' | sudo chef-client -z -o 'recipe[spagobi::1.0.2_install]' -j /dev/stdin
else
sudo chef-client -z -o 'recipe[spagobi::1.0.2_install]'
fi

#remove recipes
rm -rf cookbooks
12 changes: 10 additions & 2 deletions ChefCookbooks/spagobi/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

##### SPAGOBI GENERIC ATTRIBUTES #############################################

default["demo"] = false
default["spagobi"]["home_dir"] = "/opt/spagobi/"
default["spagobi"]["server_dir"] = "All-in-One-SpagoBI-5.1-1feb2d97af/"
default["spagobi"]["file_name"] = "All-in-One-SpagoBI-5.1-1feb2d97af.zip"
Expand All @@ -14,8 +15,15 @@
default["spagobi"]["Xmx"] = 1024
default["spagobi"]["MaxPermSize"] = 512
default["spagobi"]["java_security_egd"] = "file:/dev/./urandom"
default["spagobi"]["db_dialect"] = "org.hibernate.dialect.MySQLDialect"
default["spagobi"]["quartz_driver"] = "org.quartz.impl.jdbcjobstore.StdJDBCDelegate"

if node[:demo] == true
default["spagobi"]["db_dialect"] = "org.hibernate.dialect.HSQLDialect"
default["spagobi"]["quartz_driver"] = "org.quartz.impl.jdbcjobstore.HSQLDBDelegate"
else
default["spagobi"]["db_dialect"] = "org.hibernate.dialect.MySQLDialect"
default["spagobi"]["quartz_driver"] = "org.quartz.impl.jdbcjobstore.StdJDBCDelegate"
end


###### OAUTH 2 #################################################

Expand Down
20 changes: 14 additions & 6 deletions ChefCookbooks/spagobi/recipes/1.0.2_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,20 @@
action :delete
end


template "#{node[:spagobi][:home_dir]}#{node[:spagobi][:server_dir]}conf/server.xml" do
source "server.xml.erb"
owner node[:spagobi][:server_user]
group node[:spagobi][:server_group]
mode 0755
if node[:demo] == true
template "#{node[:spagobi][:home_dir]}#{node[:spagobi][:server_dir]}conf/server.xml" do
source "server-demo.xml.erb"
owner node[:spagobi][:server_user]
group node[:spagobi][:server_group]
mode 0755
end
else
template "#{node[:spagobi][:home_dir]}#{node[:spagobi][:server_dir]}conf/server.xml" do
source "server.xml.erb"
owner node[:spagobi][:server_user]
group node[:spagobi][:server_group]
mode 0755
end
end


Expand Down
192 changes: 192 additions & 0 deletions ChefCookbooks/spagobi/templates/default/server-demo.xml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
-->
<Server port="8005" shutdown="SHUTDOWN">
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />

<Environment name="spagobi_resource_path" type="java.lang.String" value="${catalina.base}/resources"/>
<Environment name="spagobi_sso_class" type="java.lang.String" value="<%= node['spagobi']['spagobi_sso_class'] %>"/>
<Environment name="spagobi_service_url" type="java.lang.String" value="http://<%= node['spagobi']['public_ip'] %>:8080/SpagoBI"/>
<Environment name="spagobi_host_url" type="java.lang.String" value="http://<%= node['spagobi']['public_ip'] %>:8080"/>

<!--
<Resource auth="Container"
driverClassName="com.mysql.jdbc.Driver"
maxActive="20"
maxIdle="10"
maxWait="-1"
name="jdbc/spagobi"
password="<%= node[:spagobi][:db_password] %>"
type="javax.sql.DataSource"
url="jdbc:mysql://127.0.0.1:3306/<%= node[:spagobi][:db_name] %>"
username="<%= node[:spagobi][:db_username] %>" /> -->


<Resource name="jdbc/spagobi" auth="Container"
type="javax.sql.DataSource" driverClassName="org.hsqldb.jdbcDriver"
url="jdbc:hsqldb:file:${catalina.base}/database/spagobi"
username="sa" password="" maxActive="20" maxIdle="10"
maxWait="-1"/>


<Resource name="jdbc/foodmart" auth="Container"
type="javax.sql.DataSource" driverClassName="org.hsqldb.jdbcDriver"
url="jdbc:hsqldb:file:${catalina.base}/database/foodmart"
username="sa" password="" maxActive="20" maxIdle="10"
maxWait="-1" validationQuery="select 1 from INFORMATION_SCHEMA.SYSTEM_USERS"
removeAbandoned="true" removeAbandonedTimeout="3600"/>



<Resource name="jdbc/bam" auth="Container"
type="javax.sql.DataSource" driverClassName="org.hsqldb.jdbcDriver"
url="jdbc:hsqldb:file:${catalina.base}/database/bam"
username="sa" password="" maxActive="20" maxIdle="10"
maxWait="-1"/>


<Resource auth="Container" factory="de.myfoo.commonj.work.FooWorkManagerFactory"
maxThreads="5" name="wm/SpagoWorkManager"
type="commonj.work.WorkManager"/>



</GlobalNamingResources>

<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">

<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->


<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="UTF-8"
/>
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the JSSE configuration, when using APR, the
connector should be using the OpenSSL style configuration
described in the APR documentation -->
<!--
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" URIEncoding="UTF-8" protocol="AJP/1.3" redirectPort="8443" />


<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->

<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">

<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->

<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>

<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">

<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->

<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" />

</Host>
</Engine>
</Service>
</Server>
2 changes: 1 addition & 1 deletion ChefCookbooks/spagobi/templates/default/server.xml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<Resource name="jdbc/foodmart" auth="Container"
type="javax.sql.DataSource" driverClassName="org.hsqldb.jdbcDriver"
url="jdbc:hsqldb:hsql://localhost:9001/foodmart"
url="jdbc:hsqldb:file:${catalina.base}/database/foodmart"
username="sa" password="" maxActive="20" maxIdle="10"
maxWait="-1" validationQuery="select 1 from INFORMATION_SCHEMA.SYSTEM_USERS"
removeAbandoned="true" removeAbandonedTimeout="3600"/>
Expand Down

0 comments on commit 1d17377

Please sign in to comment.