From: Andreas Bauer
---
src/api/config/deploy.rb | 103 ----------------------------
src/api/config/deploy.rb.template | 67 ++++++++++++++++++
src/api/config/environments/development.rb | 4 +-
src/webui/config/deploy.rb | 24 -------
src/webui/config/deploy.rb.template | 24 +++++++
5 files changed, 93 insertions(+), 129 deletions(-)
delete mode 100644 src/api/config/deploy.rb
create mode 100644 src/api/config/deploy.rb.template
delete mode 100644 src/webui/config/deploy.rb
create mode 100644 src/webui/config/deploy.rb.template
diff --git a/src/api/config/deploy.rb b/src/api/config/deploy.rb
deleted file mode 100644
index de65a4c..0000000
--- a/src/api/config/deploy.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-
-# =============================================================================
-# REQUIRED VARIABLES
-# =============================================================================
-# You must always specify the application and repository for every recipe. The
-# repository must be the URL of the repository you want this recipe to
-# correspond to. The deploy_to path must be the path on each machine that will
-# form the root of the application path.
-
-set :svnuser, ENV['USER']
-set :application, "frontend"
-set :repository, "--username #{svnuser} https://svn.suse.de/svn/opensuse/trunk/buildservice/src/#{application}"
-
-# =============================================================================
-# ROLES
-# =============================================================================
-# You can define any number of roles, each of which contains any number of
-# machines. Roles might include such things as :web, or :app, or :db, defining
-# what the purpose of each machine is. You can also specify options that can
-# be used to single out a specific subset of boxes in a particular role, like
-# :primary => true.
-
-role :web, "buildserviceapi.suse.de"
-role :app, "buildserviceapi.suse.de"
-role :db, "buildserviceapi.suse.de"
-#role :web, "www01.example.com", "www02.example.com"
-#role :app, "app01.example.com", "app02.example.com", "app03.example.com"
-#role :db, "db01.example.com", :primary => true
-#role :db, "db02.example.com", "db03.example.com"
-
-# =============================================================================
-# OPTIONAL VARIABLES
-# =============================================================================
-# set :deploy_to, "/path/to/app" # defaults to "/u/apps/#{application}"
-set :deploy_to, "/srv/www/opensuse/#{application}"
-set :user, "opensuse"
-# set :user, "flippy" # defaults to the currently logged in user
-# set :scm, :darcs # defaults to :subversion
-# set :svn, "/path/to/svn" # defaults to searching the PATH
-# set :darcs, "/path/to/darcs" # defaults to searching the PATH
-# set :cvs, "/path/to/cvs" # defaults to searching the PATH
-# set :gateway, "gate.host.com" # default to no gateway
-
-# =============================================================================
-# SSH OPTIONS
-# =============================================================================
-# ssh_options[:keys] = %w(/path/to/my/key /path/to/another/key)
-# ssh_options[:port] = 25
-
-# =============================================================================
-# TASKS
-# =============================================================================
-# Define tasks that run on all (or only some) of the machines. You can specify
-# a role (or set of roles) that each task should be executed on. You can also
-# narrow the set of servers to a subset of a role by specifying options, which
-# must match the options given for the servers to select (like :primary => true)
-
-# use common opensuse tasks
-load '../common/lib/switchtower/opensuse.rb'
-
-task :update_apidocs, :roles => :web do
- require 'tmpdir'
- apidoctmpdir = "#{Dir.tmpdir}/switchtower-svn-tmp-#{$$}"
- apidocrepo = "--username #{svnuser} https://svn.suse.de/svn/opensuse/trunk/buildservice/docs/architecture"
- apidoc_tarfile_local = "apidocs.tar.gz"
- apidoc_tarfile_remote = "#{current_path}/public/#{apidoc_tarfile_local}"
- apidoc_scptarget = "#{user}@buildserviceapi:#{apidoc_tarfile_remote}"
- schema_tarfile_local = "schema.tar.gz"
- schema_tarfile_remote = "#{current_path}/public/#{schema_tarfile_local}"
- schema_scptarget = "#{user}@buildserviceapi:#{schema_tarfile_remote}"
-
- system <<-CMD
- rm -rf #{apidoctmpdir}
- mkdir -v #{apidoctmpdir}
- cd #{apidoctmpdir}
- echo "Checking out from #{apidocrepo}"
- svn co -q #{apidocrepo} #{apidoctmpdir}
-
- #{apidoctmpdir}/restdocker --html #{apidoctmpdir}/api.txt
- mkdir -v apidocs
- mv html apidocs
- tar zcf #{apidoc_tarfile_local} apidocs
- scp #{apidoc_tarfile_local} #{apidoc_scptarget}
-
- mkdir -v schema
- cp *.xsd schema
- tar zcf #{schema_tarfile_local} schema
- scp #{schema_tarfile_local} #{schema_scptarget}
-
- rm -rf #{apidoctmpdir}
- CMD
-
- run <<-CMD
- tar zxf #{apidoc_tarfile_remote} -C #{current_path}/public &&
- rm -rf #{apidoc_tarfile_remote} &&
- tar zxf #{schema_tarfile_remote} -C #{current_path}/public &&
- rm -rf #{schema_tarfile_remote}
- CMD
-end
-
-task :after_deploy, :roles => :web do
- update_apidocs
-end
diff --git a/src/api/config/deploy.rb.template b/src/api/config/deploy.rb.template
new file mode 100644
index 0000000..304fcc5
--- /dev/null
+++ b/src/api/config/deploy.rb.template
@@ -0,0 +1,67 @@
+
+if ENV.has_key? 'BS_SVN_USER'
+ set :svnuser, ENV['BS_SVN_USER']
+else
+ set :svnuser, ENV['USER']
+end
+
+set :application, "frontend"
+set :repository, "svn+ssh://#{svnuser}@forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/#{application}"
+
+# ROLES
+#
+# change to your servers
+
+role :web, "api.my.domain"
+role :app, "api.my.domain"
+role :db, "api.my.domain"
+
+set :deploy_to, "/srv/www/opensuse/#{application}"
+set :user, "svnuser"
+
+# use common opensuse tasks
+load '../common/lib/switchtower/opensuse.rb'
+
+task :update_apidocs, :roles => :web do
+ require 'tmpdir'
+ apidoctmpdir = "#{Dir.tmpdir}/switchtower-svn-tmp-#{$$}"
+ apidocrepo = "svn+ssh://#{svnuser}@forgesvn1.novell.com/svn/opensuse/trunk/buildservice/docs/api"
+ apidoc_tarfile_local = "apidocs.tar.gz"
+ apidoc_tarfile_remote = "#{current_path}/public/#{apidoc_tarfile_local}"
+ apidoc_scptarget = "#{user}@buildserviceapi:#{apidoc_tarfile_remote}"
+ schema_tarfile_local = "schema.tar.gz"
+ schema_tarfile_remote = "#{current_path}/public/#{schema_tarfile_local}"
+ schema_scptarget = "#{user}@buildserviceapi:#{schema_tarfile_remote}"
+
+ system <<-CMD
+ rm -rf #{apidoctmpdir}
+ mkdir -v #{apidoctmpdir}
+ cd #{apidoctmpdir}
+ echo "Checking out from #{apidocrepo}"
+ svn co -q #{apidocrepo} #{apidoctmpdir}
+
+ #{apidoctmpdir}/rest_doc --html #{apidoctmpdir}/api.txt
+ mkdir -v apidocs
+ mv html apidocs
+ tar zcf #{apidoc_tarfile_local} apidocs
+ scp #{apidoc_tarfile_local} #{apidoc_scptarget}
+
+ mkdir -v schema
+ cp *.xsd schema
+ tar zcf #{schema_tarfile_local} schema
+ scp #{schema_tarfile_local} #{schema_scptarget}
+
+ rm -rf #{apidoctmpdir}
+ CMD
+
+ run <<-CMD
+ tar zxf #{apidoc_tarfile_remote} -C #{current_path}/public &&
+ rm -rf #{apidoc_tarfile_remote} &&
+ tar zxf #{schema_tarfile_remote} -C #{current_path}/public &&
+ rm -rf #{schema_tarfile_remote}
+ CMD
+end
+
+task :after_deploy, :roles => :web do
+ update_apidocs
+end
diff --git a/src/api/config/environments/development.rb b/src/api/config/environments/development.rb
index b5570d8..20e64b5 100644
--- a/src/api/config/environments/development.rb
+++ b/src/api/config/environments/development.rb
@@ -27,10 +27,10 @@ RPM_HOST = "buildservice.suse.de"
RPM_PORT = 5252
#SOURCE_HOST = "localhost"
-#SOURCE_PORT = 3002
+#SOURCE_PORT = 5352
#RPM_HOST = "localhost"
-#RPM_PORT = 3002
+#RPM_PORT = 5252
APIDOCS_LOCATION = "../../docs/architecture/html/"
SCHEMA_LOCATION = File.expand_path("#{RAILS_ROOT}/../../docs/architecture")+"/"
diff --git a/src/webui/config/deploy.rb b/src/webui/config/deploy.rb
deleted file mode 100644
index c1627ba..0000000
--- a/src/webui/config/deploy.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-
-if ENV.has_key? 'BS_SVN_USER'
- set :svnuser, ENV['BS_SVN_USER']
-else
- set :svnuser, ENV['USER']
-end
-
-set :application, "webclient"
-set :repository, "svn+ssh://#{svnuser}@forgesvn.novell.com/svn/opensuse/trunk/buildservice/src/#{application}"
-
-# ROLES
-#
-# change to your servers
-
-role :web, "build.my.domain"
-role :app, "build.my.domain"
-role :db, "build.my.domain"
-
-
-set :deploy_to, "/srv/www/opensuse/#{application}"
-set :user, "svnuser"
-
-# use common opensuse tasks
-load '../common/lib/switchtower/opensuse.rb'
diff --git a/src/webui/config/deploy.rb.template b/src/webui/config/deploy.rb.template
new file mode 100644
index 0000000..c1627ba
--- /dev/null
+++ b/src/webui/config/deploy.rb.template
@@ -0,0 +1,24 @@
+
+if ENV.has_key? 'BS_SVN_USER'
+ set :svnuser, ENV['BS_SVN_USER']
+else
+ set :svnuser, ENV['USER']
+end
+
+set :application, "webclient"
+set :repository, "svn+ssh://#{svnuser}@forgesvn.novell.com/svn/opensuse/trunk/buildservice/src/#{application}"
+
+# ROLES
+#
+# change to your servers
+
+role :web, "build.my.domain"
+role :app, "build.my.domain"
+role :db, "build.my.domain"
+
+
+set :deploy_to, "/srv/www/opensuse/#{application}"
+set :user, "svnuser"
+
+# use common opensuse tasks
+load '../common/lib/switchtower/opensuse.rb'
--
1.7.7
--
To unsubscribe, e-mail: obs-commits+unsubscribe@opensuse.org
To contact the owner, e-mail: obs-commits+owner@opensuse.org