Deploy the UAA in dev setup exactly like we would in bosh.

Change-Id: I393c3787dc0bb051ce0071e03e08a01a48bce5b5
This commit is contained in:
Joel D'sa 2012-05-08 00:14:31 -07:00
Родитель 97b6af10b6
Коммит d0fd9bb06c
8 изменённых файлов: 67 добавлений и 4 удалений

Просмотреть файл

@ -77,6 +77,12 @@ if vcap_components["components"].include?("cloud_controller")
vcap_components["components"].unshift(vcap_components["components"].delete("cloud_controller"))
end
if vcap_components["components"].include?("uaa")
puts "Setting up the uaa environment"
ENV["CLOUD_CONTROLLER_CONFIG_PATH"]=deployment_config_path
ENV["UAA_TOMCAT"]=File.join(deployment_config_path, "../deploy/uaa-tomcat/")
end
# Set both http_proxy and HTTP_PROXY
%w(http_proxy https_proxy no_proxy).each do |var|
ENV[var] = ENV[var] || ENV[var.upcase] unless ENV[var.upcase].nil?

Просмотреть файл

@ -0,0 +1,7 @@
= DESCRIPTION:
= REQUIREMENTS:
= ATTRIBUTES:
= USAGE:

Просмотреть файл

@ -0,0 +1,4 @@
include_attribute "deployment"
default[:tomcat][:version] = "7.0.27"
default[:tomcat][:source] = "http://www.us.apache.org/dist/tomcat/tomcat-7/v#{tomcat[:version]}/bin/apache-tomcat-#{tomcat[:version]}.tar.gz"
default[:tomcat][:base] = File.join(node[:deployment][:home], "deploy", "uaa-tomcat")

Просмотреть файл

@ -0,0 +1,7 @@
%w{ java }.each do |cb|
depends cb
end
%w{ debian ubuntu centos redhat fedora }.each do |os|
supports os
end

Просмотреть файл

@ -0,0 +1,35 @@
include_recipe "java"
case node.platform
when "redhat", "centos", "fedora"
include_recipe "jpackage"
end
remote_file File.join("", "tmp", "apache-tomcat-#{node[:tomcat][:version]}.tar.gz") do
owner node[:deployment][:user]
source node[:tomcat][:source]
not_if { ::File.exists?(File.join("", "tmp", "apache-tomcat-#{node[:tomcat][:version]}.tar.gz")) }
end
directory node[:tomcat][:base] do
owner node[:deployment][:user]
group node[:deployment][:group]
mode "0755"
recursive true
action :create
end
bash "Install Tomcat #{node[:tomcat][:path]}" do
cwd "#{node[:tomcat][:base]}"
user node[:deployment][:user]
tarball = File.join("", "tmp", "apache-tomcat-#{node[:tomcat][:version]}.tar.gz")
code <<-EOH
tar xzf #{tarball}
cp -Rf #{node[:tomcat][:base]}/apache-tomcat-#{node[:tomcat][:version]}/* #{node[:tomcat][:base]}
rm -Rf #{node[:tomcat][:base]}/apache-tomcat-#{node[:tomcat][:version]}
EOH
not_if do
::File.exists?(File.join(node[:tomcat][:base], "bin", "catalina.sh"))
end
end

Просмотреть файл

@ -13,10 +13,13 @@ template "uaa.yml" do
mode 0644
end
bash "Grab dependencies for UAA" do
bash "Build and Deploy UAA" do
user node[:deployment][:user]
cwd "#{node[:cloudfoundry][:path]}/uaa"
code "#{node[:maven][:path]}/bin/mvn install -U -DskipTests=true"
code <<-EOH
cd #{node[:cloudfoundry][:path]}/uaa; #{node[:maven][:path]}/bin/mvn clean install -U -DskipTests=true
rm -Rf #{node[:tomcat][:base]}/webapps/ROOT
cp -f #{node[:cloudfoundry][:path]}/uaa/uaa/target/cloudfoundry-identity-uaa-1.0.0.BUILD-SNAPSHOT.war #{node[:tomcat][:base]}/webapps/ROOT.war
EOH
end
cf_bundle_install(File.expand_path(File.join(node["cloudfoundry"]["path"], "uaa")))

Просмотреть файл

@ -13,5 +13,6 @@
"recipe[postgresql]",
"recipe[java]",
"recipe[maven]",
"recipe[tomcat]",
"recipe[uaa]"]
}

2
uaa

@ -1 +1 @@
Subproject commit 7cee31a47e2ae5ed5ebc98062ee6ed5dfab38d7b
Subproject commit 38ddbece7b822ed4090f85b4771ad1060dd5de6a