[Piuparts-commits] rev 274 - piatti piatti/home/piupartsm piatti/home/piupartss piatti/home/piupartss/bin trunk trunk/debian

Holger Levsen holger at alioth.debian.org
Tue Mar 17 21:21:28 UTC 2009


Author: holger
Date: 2009-03-17 21:21:28 +0000 (Tue, 17 Mar 2009)
New Revision: 274

Added:
   piatti/home/piupartsm/.bashrc
   piatti/home/piupartss/.bashrc
Modified:
   piatti/README.txt
   piatti/home/piupartss/bin/update-piuparts-setup
   trunk/Makefile
   trunk/TODO
   trunk/debian/changelog
Log:
more documentation, enhance update script to create initial configuration too, put $date in versionstring if distrinution=UNRELEASED

Modified: piatti/README.txt
===================================================================
--- piatti/README.txt	2009-03-17 13:21:02 UTC (rev 273)
+++ piatti/README.txt	2009-03-17 21:21:28 UTC (rev 274)
@@ -1,29 +1,20 @@
-Notes about the installation 
-============================
+Notes about the piuparts installation on piatti.debian.org 
+==========================================================
 
 todo
 ----
+- script for starting piuparts-slave in screen and cronjob to send mail with its output
 - use local mirror
-- document/do: /var/www needs to be populated, /etc/apache2/ too
-- fix the Makefile so that there is clean way not to install example configuration
 - there should be a 2nd group of piuparts-people. those who can sudo into piupartsm to process logfiles. maybe make that the qa-group
 
-done
-----
-- in /org/
-	svn co svn://svn.debian.org/svn/piuparts/piatti/org/piuparts.debian.org .
-	mkdir slave master tmp cd slave && mkdir sid squeeze lenny2squeeze \
-          && cd ../master && mkdir sid squeeze lenny2squeeze && cd .. && chmod g+w slave master
-- in /home/piupartss:
-	put "export PYTHONPATH=/org/piuparts.debian.org/lib/python2.4/site-packages:/org/piuparts.debian.org/lib/python2.5/site-packages" into .bashrc
-- in /home/piupartsm:
-	put id_rsa.pub from piupartss into .ssh/authorized_keys
-	put "export PYTHONPATH=/org/piuparts.debian.org/lib/python2.4/site-packages:/org/piuparts.debian.org/lib/python2.5/site-packages" into .bashrc
 
-piuparts users
---------------
+User setup
+----------
 A piupartss and a piupartsm user is need. Both are members of the group piuparts and /org/piuparts.debian.org is 774 piupartss.piuparts.
+Both user have some files in $HOME which are kept in svn, including hidden files.
 
+Create an SSH keypair for piupartss and put it into ~/.ssh/authorized_keys of the piupartsm user, so the piupartss can login with ssh to localhost as piupartsm.
+
 '/etc/sudoers' for piatti
 -------------------------
 # The piuparts slave needs to handle chroots
@@ -36,20 +27,43 @@
 
 piuparts installation from svn source
 -------------------------------------
+* sudo apt-get install apt python debootstrap lsof lsb-release python-debian 
+* Copy 'svn:/svn.debian.org/svn/piuparts/piatti/home/piupartss/bin/update-piuparts-setup' on the host and run it. It assumes you want to set it up in '/org/piuparts.debian.org' and does all further svn checkouts as well as source code installation. It needs the piupartss and piupartsm user set up as described below, though.
+	
+Apache configuration
+--------------------
+(Any other webserver will do.)
+----
+<VirtualHost *:80>
+        ServerName piuparts.debian.org
+        ServerAlias piuparts.cs.helsinki.fi
 
-cd /org/puiparts.debian.org
-svn co svn://svn.debian.org/svn/piuparts/trunk src
-# checkout elsewhere
-# run script
+        ServerAdmin debian-admin at debian.org
 
-generating reports
-------------------
+        ErrorLog /var/log/apache2/piuparts.debian.org-error.log
+        CustomLog /var/log/apache2/piuparts.debian.org-access.log combined
+
+        DocumentRoot /srv/piuparts.debian.org/htdocs
+
+        HostnameLookups Off
+        UseCanonicalName Off
+        ServerSignature On
+        <IfModule mod_userdir.c>
+                UserDir disabled
+        </IfModule>
+</VirtualHost>
+----
+
+Generating reports for the website
+----------------------------------
 piuparts-report.py is run from ~/piupartsm/crontab
 
 to start a new run and throw away all results:
 ----------------------------------------------
+----
 piupartss at piatti:/org/piuparts.debian.org$ ./update-piuparts-setup
 piupartss at piatti:/org/piuparts.debian.org/slave$ nice python ../../share/piuparts/piuparts-slave.py 
+----
 
 filing bugs
 -----------

Added: piatti/home/piupartsm/.bashrc
===================================================================
--- piatti/home/piupartsm/.bashrc	                        (rev 0)
+++ piatti/home/piupartsm/.bashrc	2009-03-17 21:21:28 UTC (rev 274)
@@ -0,0 +1,103 @@
+# ~/.bashrc: executed by bash(1) for non-login shells.
+# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
+# for examples
+
+# If not running interactively, don't do anything
+[ -z "$PS1" ] && return
+
+# don't put duplicate lines in the history. See bash(1) for more options
+# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
+export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
+# ... or force ignoredups and ignorespace
+export HISTCONTROL=ignoreboth
+
+# append to the history file, don't overwrite it
+shopt -s histappend
+
+# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
+
+# check the window size after each command and, if necessary,
+# update the values of LINES and COLUMNS.
+shopt -s checkwinsize
+
+# make less more friendly for non-text input files, see lesspipe(1)
+#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
+
+# set variable identifying the chroot you work in (used in the prompt below)
+if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
+    debian_chroot=$(cat /etc/debian_chroot)
+fi
+
+# set a fancy prompt (non-color, unless we know we "want" color)
+case "$TERM" in
+    xterm-color) color_prompt=yes;;
+esac
+
+# uncomment for a colored prompt, if the terminal has the capability; turned
+# off by default to not distract the user: the focus in a terminal window
+# should be on the output of commands, not on the prompt
+#force_color_prompt=yes
+
+if [ -n "$force_color_prompt" ]; then
+    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
+	# We have color support; assume it's compliant with Ecma-48
+	# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
+	# a case would tend to support setf rather than setaf.)
+	color_prompt=yes
+    else
+	color_prompt=
+    fi
+fi
+
+if [ "$color_prompt" = yes ]; then
+    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
+else
+    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
+fi
+unset color_prompt force_color_prompt
+
+# If this is an xterm set the title to user at host:dir
+case "$TERM" in
+xterm*|rxvt*)
+    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
+    ;;
+*)
+    ;;
+esac
+
+# Alias definitions.
+# You may want to put all your additions into a separate file like
+# ~/.bash_aliases, instead of adding them here directly.
+# See /usr/share/doc/bash-doc/examples in the bash-doc package.
+
+#if [ -f ~/.bash_aliases ]; then
+#    . ~/.bash_aliases
+#fi
+
+# enable color support of ls and also add handy aliases
+if [ -x /usr/bin/dircolors ]; then
+    eval "`dircolors -b`"
+    alias ls='ls --color=auto'
+    #alias dir='dir --color=auto'
+    #alias vdir='vdir --color=auto'
+
+    #alias grep='grep --color=auto'
+    #alias fgrep='fgrep --color=auto'
+    #alias egrep='egrep --color=auto'
+fi
+
+# some more ls aliases
+#alias ll='ls -l'
+#alias la='ls -A'
+#alias l='ls -CF'
+
+# enable programmable completion features (you don't need to enable
+# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
+# sources /etc/bash.bashrc).
+if [ -f /etc/bash_completion ]; then
+    . /etc/bash_completion
+fi
+
+PYTHONPATH=/org/piuparts.debian.org/lib/python2.4/site-packages:/org/piuparts.debian.org/lib/python2.5/site-packages 
+export PYTHONPATH
+

Added: piatti/home/piupartss/.bashrc
===================================================================
--- piatti/home/piupartss/.bashrc	                        (rev 0)
+++ piatti/home/piupartss/.bashrc	2009-03-17 21:21:28 UTC (rev 274)
@@ -0,0 +1,102 @@
+# ~/.bashrc: executed by bash(1) for non-login shells.
+# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
+# for examples
+
+# If not running interactively, don't do anything
+[ -z "$PS1" ] && return
+
+# don't put duplicate lines in the history. See bash(1) for more options
+# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
+export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
+# ... or force ignoredups and ignorespace
+export HISTCONTROL=ignoreboth
+
+# append to the history file, don't overwrite it
+shopt -s histappend
+
+# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
+
+# check the window size after each command and, if necessary,
+# update the values of LINES and COLUMNS.
+shopt -s checkwinsize
+
+# make less more friendly for non-text input files, see lesspipe(1)
+#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
+
+# set variable identifying the chroot you work in (used in the prompt below)
+if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
+    debian_chroot=$(cat /etc/debian_chroot)
+fi
+
+# set a fancy prompt (non-color, unless we know we "want" color)
+case "$TERM" in
+    xterm-color) color_prompt=yes;;
+esac
+
+# uncomment for a colored prompt, if the terminal has the capability; turned
+# off by default to not distract the user: the focus in a terminal window
+# should be on the output of commands, not on the prompt
+#force_color_prompt=yes
+
+if [ -n "$force_color_prompt" ]; then
+    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
+	# We have color support; assume it's compliant with Ecma-48
+	# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
+	# a case would tend to support setf rather than setaf.)
+	color_prompt=yes
+    else
+	color_prompt=
+    fi
+fi
+
+if [ "$color_prompt" = yes ]; then
+    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
+else
+    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
+fi
+unset color_prompt force_color_prompt
+
+# If this is an xterm set the title to user at host:dir
+case "$TERM" in
+xterm*|rxvt*)
+    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
+    ;;
+*)
+    ;;
+esac
+
+# Alias definitions.
+# You may want to put all your additions into a separate file like
+# ~/.bash_aliases, instead of adding them here directly.
+# See /usr/share/doc/bash-doc/examples in the bash-doc package.
+
+#if [ -f ~/.bash_aliases ]; then
+#    . ~/.bash_aliases
+#fi
+
+# enable color support of ls and also add handy aliases
+if [ -x /usr/bin/dircolors ]; then
+    eval "`dircolors -b`"
+    alias ls='ls --color=auto'
+    #alias dir='dir --color=auto'
+    #alias vdir='vdir --color=auto'
+
+    #alias grep='grep --color=auto'
+    #alias fgrep='fgrep --color=auto'
+    #alias egrep='egrep --color=auto'
+fi
+
+# some more ls aliases
+#alias ll='ls -l'
+#alias la='ls -A'
+#alias l='ls -CF'
+
+# enable programmable completion features (you don't need to enable
+# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
+# sources /etc/bash.bashrc).
+if [ -f /etc/bash_completion ]; then
+    . /etc/bash_completion
+fi
+
+PYTHONPATH=/org/piuparts.debian.org/lib/python2.4/site-packages:/org/piuparts.debian.org/lib/python2.5/site-packages 
+export PYTHONPATH

Modified: piatti/home/piupartss/bin/update-piuparts-setup
===================================================================
--- piatti/home/piupartss/bin/update-piuparts-setup	2009-03-17 13:21:02 UTC (rev 273)
+++ piatti/home/piupartss/bin/update-piuparts-setup	2009-03-17 21:21:28 UTC (rev 274)
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/sh 
 
 #
 #  update piuparts setup on piatti.debian.org
@@ -17,7 +17,10 @@
 #
 # update slave home, mostly scripts
 #
-cd ~
+cd 
+if [ ! -d .svn ] ; then
+	svn co svn://svn.debian.org/svn/piuparts/piatti/home/piupartss .
+fi
 pwd
 svn up
 svn status
@@ -28,28 +31,41 @@
 # this is done as piupartsm user, as else ~piupartsm needs to be writeable
 # by the group, which prevents ssh logins...
 #
+cd ~piupartsm
+if [ ! -d .svn ] ; then
+	sudo su - piupartsm -c "cd ; svn co svn://svn.debian.org/svn/piuparts/piatti/home/piupartsm ."
+fi
 sudo su - piupartsm -c "pwd ; svn up ; svn status"
 sudo su - piupartsm -c "crontab crontab"
 
 #
-# update configuration + htdocs
+# update /org/piuparts.debian.org
 #
-cd /org/piuparts.debian.org/etc
+if [ ! -d /org/piuparts.debian.org/.svn ] ; then
+        sudo mkdir -p /org/piuparts.debian.org/
+	cd /org/piuparts.debian.org/
+	svn co svn://svn.debian.org/svn/piuparts/piatti/org/piuparts.debian.org/ .
+fi
+cd /org/piuparts.debian.org/
 pwd
 svn up
 svn status
-cd ../htdocs
-pwd
-svn up
-svn status
+mkdir -p master slave
+chown piupartss.piuparts slave
+chown piupartsm.piuparts master
+chmod 755 master slave
 
 #
 # update source
 #
-cd ../src
+if [ ! -d /org/piuparts.debian.org/src/.svn ] ; then
+        sudo mkdir -p /org/piuparts.debian.org/src/
+	cd  /org/piuparts.debian.org/src/
+	svn co svn://svn.debian.org/svn/piuparts/trunk .
+fi
+cd  /org/piuparts.debian.org/src/
 pwd
 svn up
 svn status
-sudo make prefix=/org/piuparts.debian.org etcdir=/org/piuparts.debian.org/etc install 
-sudo rm ../etc/piuparts/ -Rf
+sudo make prefix=/org/piuparts.debian.org install-py 
 

Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2009-03-17 13:21:02 UTC (rev 273)
+++ trunk/Makefile	2009-03-17 21:21:28 UTC (rev 274)
@@ -7,10 +7,13 @@
 site24 = $(libdir)/python2.4/site-packages
 site25 = $(libdir)/python2.5/site-packages
 etcdir = $(prefix)/etc
+distribution=${shell dpkg-parsechangelog | sed -n 's/^Distribution: *//p'}
+ifeq ($(distribution),UNRELEASED)
+version=${shell echo "`dpkg-parsechangelog | sed -n 's/^Version: *//p'`~`date +%Y%m%d`"}
+else
 version=${shell dpkg-parsechangelog | sed -n 's/^Version: *//p'}
+endif
 
-
-# mirror = -m 'http://liw.iki.fi/debian main'
 ignore = -I fdmount -N
 
 all: piuparts.1 
@@ -18,7 +21,13 @@
 piuparts.1: piuparts.docbook
 	docbook2x-man --encoding=utf-8 piuparts.docbook
 
-install: all
+install-conf:
+	install -d $(etcdir)/piuparts
+	for x in master slave report; do \
+	    install -m 0644 piuparts-$$x.conf.sample \
+	                    $(etcdir)/piuparts/piuparts-$$x.conf; done
+
+install-py: 
 	install -d $(sbindir) 
 	echo $(version)
 	sed -e 's/__PIUPARTS_VERSION__/$(version)/g' piuparts.py > piuparts
@@ -40,10 +49,7 @@
 	install -m 0644 piupartslib/*.py $(site24)/piupartslib
 	install -m 0644 piupartslib/*.py $(site25)/piupartslib
 
-	install -d $(etcdir)/piuparts
-	for x in master slave report; do \
-	    install -m 0644 piuparts-$$x.conf.sample \
-	                    $(etcdir)/piuparts/piuparts-$$x.conf; done
+install: install-py install-conf
 
 check:
 	python piuparts.py unittest

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2009-03-17 13:21:02 UTC (rev 273)
+++ trunk/TODO	2009-03-17 21:21:28 UTC (rev 274)
@@ -20,7 +20,6 @@
 
 - improve the config parser so we dont need redundant config entries...
 - merge conf-files into piuparts-sm.conf
-- automatically add ~$date to version string if distribution=UNRELASED
 
 for 0.37 and on
 

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2009-03-17 13:21:02 UTC (rev 273)
+++ trunk/debian/changelog	2009-03-17 21:21:28 UTC (rev 274)
@@ -20,19 +20,20 @@
       are not testable without the circular dependent package, so in case of 
       failure analysing will be harder.
   * piuparts-slave.py:
-    - support looping trough multiple sections in slave.conf via new config value
-      "sections". Thanks to Frank Ploss for writing this patch with me and helping
-      me understand the code much better!
+    - support looping trough multiple sections in slave.conf via new config 
+      value "sections". Thanks to Frank Ploss for writing this patch with me 
+      and helping me understand the code much better!
   * Re-add piuparts-reports.py which got removed/lost between 0.14 and 0.20 
     without changelog entry.
   * piuparts-reports.py: 
     - print "unknown-package" bold in state reports.
     - support sections in configuration file. 
-    - support looping trough multiple sections in report.conf via new config value
-      "sections". 
+    - support looping trough multiple sections in report.conf via new config
+      value "sections". 
     - provide links to logfiles in statistics page.
     - improve look.
   * control: depend on python (>>2.4) at least. 
+  * Makefile: add "~$date" to versionstring if building an unreleased version.
 
  -- Holger Levsen <holger at debian.org>  Tue, 10 Mar 2009 15:23:59 +0100
 




More information about the Piuparts-commits mailing list