[opensuse-buildservice] Patches to easy Stand Alone OBS install.
Hi, Here are some patches to make setting up a stand alone OBS install easier. They mostly remove some hard code URLs, allowing the use of the environment configuration files. Also included is a patch for the obs-server.spec file to make it work with a tarball made from current development tree. All of the patches are against r1638. -- David B. Anderson Linux Networx Sr. Software Engineer Email: danderson@lnxi.com Phone: (801) 649-1311 --- ../obs-r/buildservice/src/webclient/app/helpers/application_helper.rb 2007-05-11 16:04:41.000000000 -0600 +++ buildservice/src/webclient/app/helpers/application_helper.rb 2007-05-11 15:46:42.000000000 -0600 @@ -28,8 +28,12 @@ :project => project, :package => package end + def link_to_repo(message='', repo='') + link_to "Build Service Software #{message}", URL_SW_REPO_HOST + "/#{repo}" + end + def repo_url(project, repo='' ) - 'http://software.opensuse.org/download/' + project.gsub(':', ':/') + "/#{repo}" + URL_SW_REPO_HOST + '/download/' + project.gsub(':', ':/') + "/#{repo}" end --- ../obs-r/buildservice/src/backend/BSConfig.pm 2007-05-11 16:04:41.000000000 -0600 +++ buildservice/src/backend/BSConfig.pm 2007-05-11 15:46:42.000000000 -0600 @@ -27,6 +27,8 @@ our $stageserver = 'rsync://149.44.161.5/put-repos-main'; our $stageserver_sync = 'rsync://149.44.161.5/trigger-repos-sync'; our $repodownload = 'http://software.opensuse.org/download/repositories'; +our $gpgkeyurl = 'http://software.opensuse.org/openSUSE-Build-Service.asc'; +our $gpgcheck_flag ='1'; our $sign = '/root/bin/sign'; our $bsdir = '/bs'; our $keyfile = '/bs/openSUSE-Build-Service.asc'; --- ../obs-r/buildservice/src/webclient/config/environments/development.rb 2007-05-11 16:04:41.000000000 -0600 +++ buildservice/src/webclient/config/environments/development.rb 2007-05-11 15:46:42.000000000 -0600 @@ -42,3 +42,8 @@ ### ICHAIN_HOST = "212.12.12.12" ICHAIN_TEST_USER = "test" +# Software Repository Machine Path +URL_SW_REPO_HOST = "http://software.opensuse.org" + +# API Machine URL +URL_API_HOST ="https://api.opensuse.org" --- ../obs-r/buildservice/src/webclient/app/views/main/index.rhtml 2007-05-11 16:04:41.000000000 -0600 +++ buildservice/src/webclient/app/views/main/index.rhtml 2007-05-11 15:46:42.000000000 -0600 @@ -16,7 +16,10 @@ It can build packages for various Linux distributions.<br/> Most of the advanced features are still missing, but the basic build functionality is there.</p> -<p class="description">Everyone can download the resulting software packages via the <a href="http://software.opensuse.org">software browsing interface</a>.</p> +<p class="description">Everyone can download the resulting software packages via the + <%= link_to_repo 'browsing interface' + -%>. +</p> <!-- --- ../obs-r/buildservice/src/webclient/app/helpers/package_helper.rb 2007-05-11 16:04:41.000000000 -0600 +++ buildservice/src/webclient/app/helpers/package_helper.rb 2007-05-11 15:46:42.000000000 -0600 @@ -4,25 +4,29 @@ def build_log_url( project, package, platform, arch ) #get_frontend_url_for( :controller => 'result' ) + # "/#{project}/#{platform}/#{package}/#{arch}/log" - "https://api.opensuse.org/result/#{project}/#{platform}/#{package}/#{arch}/log" + URL_API_HOST + '/result/' + "#{project}/#{platform}/#{package}/#{arch}/log" end def file_url( project, package, filename ) #get_frontend_url_for( :controller => 'source') + # "/#{project}/#{package}/#{filename}" - "https://api.opensuse.org/source/#{project}/#{package}/#{filename}" + URL_API_HOST + '/source/' + "#{project}/#{package}/#{filename}" end def rpm_url( project, package, repository, arch, filename ) #get_frontend_url_for( :controller => 'rpm' ) + # "/#{project}/#{repository}/#{package}/#{arch}/#{filename}" - "https://api.opensuse.org/rpm/#{project}/#{repository}/#{package}/#{arch}/#{filename}" + URL_API_HOST + '/rpm/' + "#{project}/#{repository}/#{package}/#{arch}/#{filename}" end def human_readable_fsize( bytes ) - number_to_human_size(bytes, 2) + hs = number_to_human_size(bytes.to_i) + if hs == nil + hs = bytes + end + hs end end --- ../obs-r/buildservice/src/webclient/app/views/user/request_ichain.rhtml 2007-05-11 16:04:41.000000000 -0600 +++ buildservice/src/webclient/app/views/user/request_ichain.rhtml 2007-05-11 15:46:42.000000000 -0600 @@ -12,7 +12,7 @@ </p> <p> You do NOT need an account to download packages. Please go to - <a href="http://software.opensuse.org/download/">http://software.opensuse.org/download/</a> + <%= link_to_repo 'downloads', 'download' %> for downloading packages. </p> <p>The build service team will enable your account for the --- ../obs-r/buildservice/src/backend/worker/BSConfig.pm 2007-05-11 16:04:41.000000000 -0600 +++ buildservice/src/backend/worker/BSConfig.pm 2007-05-11 15:46:42.000000000 -0600 @@ -27,6 +27,8 @@ our $stageserver = 'rsync://149.44.161.5/put-repos-main'; our $stageserver_sync = 'rsync://149.44.161.5/trigger-repos-sync'; our $repodownload = 'http://software.opensuse.org/download/repositories'; +our $gpgkeyurl = 'http://software.opensuse.org/openSUSE-Build-Service.asc'; +our $gpgcheck_flag ='1'; our $sign = '/root/bin/sign'; our $bsdir = '/bs'; our $keyfile = '/bs/openSUSE-Build-Service.asc'; --- /home/danderson/Work/src/tmp/obs/rpm/obs-server.spec.org 2007-05-01 17:17:51.000000000 -0600 +++ obs-server.spec 2007-05-11 16:22:46.000000000 -0600 @@ -75,17 +75,44 @@ # # Install all web and frontend parts. # + +# First make sure our build root is clean +rm -rf %{buildroot} +mkdir -p %{buildroot} + + for i in common frontend webclient; do mkdir -p $RPM_BUILD_ROOT/srv/www/obs/ cp -a $i $RPM_BUILD_ROOT/srv/www/obs/$i done + +#These are to fix the files requires section below as these +#directories have been removed from the tarball. +#If these directories are not really needed then remove this section +#and the entries in the file section +install -d -m 755 $RPM_BUILD_ROOT/srv/www/obs/frontend/components +install -d -m 755 $RPM_BUILD_ROOT/srv/www/obs/frontend/log +install -d -m 755 $RPM_BUILD_ROOT/srv/www/obs/frontend/tmp +install -d -m 755 $RPM_BUILD_ROOT/srv/www/obs/frontend/tmp/sockets +install -d -m 755 $RPM_BUILD_ROOT/srv/www/obs/frontend/tmp/sessions +install -d -m 755 $RPM_BUILD_ROOT/srv/www/obs/frontend/tmp/cache +install -d -m 755 $RPM_BUILD_ROOT/srv/www/obs/webclient/components +install -d -m 755 $RPM_BUILD_ROOT/srv/www/obs/webclient/db +install -d -m 755 $RPM_BUILD_ROOT/srv/www/obs/webclient/vendor +install -d -m 755 $RPM_BUILD_ROOT/srv/www/obs/webclient/log +install -d -m 755 $RPM_BUILD_ROOT/srv/www/obs/webclient/tmp +install -d -m 755 $RPM_BUILD_ROOT/srv/www/obs/webclient/tmp/sockets +install -d -m 755 $RPM_BUILD_ROOT/srv/www/obs/webclient/tmp/sessions +install -d -m 755 $RPM_BUILD_ROOT/srv/www/obs/webclient/tmp/cache + + # configure lighttpd web service mkdir -p $RPM_BUILD_ROOT/etc/lighttpd/vhosts.d/ install -m 0644 %SOURCE7 $RPM_BUILD_ROOT/etc/lighttpd/vhosts.d/ install -m 0644 %SOURCE9 $RPM_BUILD_ROOT/etc/lighttpd/vhosts.d/rails.inc install -m 0644 %SOURCE8 $RPM_BUILD_ROOT/etc/lighttpd/ -rm $RPM_BUILD_ROOT/srv/www/obs/frontend/README_LOGIN -rm $RPM_BUILD_ROOT/srv/www/obs/frontend/files/specfiletemplate +rm -f $RPM_BUILD_ROOT/srv/www/obs/frontend/README_LOGIN +rm -f $RPM_BUILD_ROOT/srv/www/obs/frontend/files/specfiletemplate # fix path for i in $RPM_BUILD_ROOT/srv/www/obs/*/config/environment.rb; do sed "s,/srv/www/opensuse/common/current/lib,/srv/www/obs/common/lib," \
On Saturday, 12. May 2007 01:10, David B. Anderson wrote:
Hi,
Here are some patches to make setting up a stand alone OBS install easier. They mostly remove some hard code URLs, allowing the use of the environment configuration files.
Cool, thanks. A few comments: + def link_to_repo(message='', repo='') + link_to "Build Service Software #{message}", URL_SW_REPO_HOST + "/#{repo}" + end I'll remove the "Build Service Software" prefix, as this makes it very difficult to see what the final displayed text is. - number_to_human_size(bytes, 2) + hs = number_to_human_size(bytes.to_i) + if hs == nil + hs = bytes + end + hs I don't see the need for that. number_to_human_size can only return nil if the argument is nil. So your check effectively does nothing, because if hs == nil, bytes == nil. Additionally, the argument can never be nil as to_i, if defined, is guaranteed to always return an integer. I'll check in the fixes for the hardcoded URLs if no one else has objections.
Also included is a patch for the obs-server.spec file to make it work with a tarball made from current development tree.
All of the patches are against r1638.
-- Andreas Bauer - Novell - SUSE Internal Tools --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Thanks, Andreas Bauer wrote:
On Saturday, 12. May 2007 01:10, David B. Anderson wrote:
Hi,
Here are some patches to make setting up a stand alone OBS install easier. They mostly remove some hard code URLs, allowing the use of the environment configuration files.
Cool, thanks.
A few comments:
+ def link_to_repo(message='', repo='') + link_to "Build Service Software #{message}", URL_SW_REPO_HOST + "/#{repo}" + end
I'll remove the "Build Service Software" prefix, as this makes it very difficult to see what the final displayed text is.
Just trying to make the end user experience the same.
- number_to_human_size(bytes, 2) + hs = number_to_human_size(bytes.to_i) + if hs == nil + hs = bytes + end + hs
I don't see the need for that. number_to_human_size can only return nil if the argument is nil. So your check effectively does nothing, because if hs == nil, bytes == nil. Additionally, the argument can never be nil as to_i, if defined, is guaranteed to always return an integer.
During the initial OBS install, I was having problems with this function causing the pages to abort with exceptions. After I put the check for nil, I figured out bytes was a numerical string, hence .to_i. I left the nil check just in case bytes ever contained a none numeric value. This is a pure sanity check. I try to make it so that after I hit a problem, it will never come back.
I'll check in the fixes for the hardcoded URLs if no one else has objections.
Also included is a patch for the obs-server.spec file to make it work with a tarball made from current development tree.
All of the patches are against r1638.
Looking forward to the updates. Thanks. -- David B. Anderson Linux Networx Sr. Software Engineer Email: danderson@lnxi.com Phone: (801) 649-1311 --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (2)
-
Andreas Bauer
-
David B. Anderson