Skip to content

Commit

Permalink
Fixed example Scripts for publisher hook
Browse files Browse the repository at this point in the history
Variable definition was broken and the destination path has to be
created on first run.
  • Loading branch information
cschneemann committed Feb 24, 2024
1 parent bf9ea2c commit e89bc01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xml/obs_ag_publish_hooks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ our $publishedhook = {
OBSHOME="/srv/obs"
SRC_REPO_DIR="$OBSHOME/repos"
LOGFILE="$OBSHOME/log/reposync.log"
$DST_REPO_DIR="/srv/repo-mirror"
DST_REPO_DIR="/srv/repo-mirror"
# Global substitution! To handle strings like Foo:Bar:testing - two
#+double-colons!
PRJ_PATH=${1//:/:\/}
PATH_TO_REPO=$2
rsync -a --log-file=$LOGFILE $PATH_TO_REPO/ $DST_REPO_DIR/$PRJ_PATH/</screen>
rsync -a --log-file=$LOGFILE --mkpath $PATH_TO_REPO/ $DST_REPO_DIR/$PRJ_PATH/</screen>
<para>For testing purposes, it can be invoked as follows:</para>
<screen>$ sudo -u obsrun /usr/local/bin/publish-hook.sh Product/SLES11-SP1 \
/srv/obs/repos/Product/SLE11-SP1</screen>
Expand All @@ -132,7 +132,7 @@ DST_REPO_DIR=$1
PRJ_PATH=${2//:/:\/}
PATH_TO_REPO=$3
mkdir -p $DST_REPO_DIR/$PRJ_PATH
rsync -a --log-file=$LOGFILE $PATH_TO_REPO/ $DST_REPO_DIR/$PRJ_PATH/</screen>
rsync -a --log-file=$LOGFILE --mkpath $PATH_TO_REPO/ $DST_REPO_DIR/$PRJ_PATH/</screen>
<para>For testing purposes, it can be invoked as follows:</para>
<screen>$ sudo -u obsrun /usr/local/bin/publish-hook.sh \
/srv/www/public_mirror/Product/SLES11-SP1 \
Expand Down

0 comments on commit e89bc01

Please sign in to comment.