Commit 8a460a14 authored by Vitaly Lipatov's avatar Vitaly Lipatov

set GITHOST and GEARHOST and use GEARHOST

parent 60f9982b
......@@ -12,7 +12,7 @@ mygetopts()
{
if [ "$1" = "-h" ] ; then
echog "gacl - acl control for gear repo in $GIRARHOST"
echog "gacl - acl control for gear repo in $GEARHOST"
echo
echog "Usage: gacl [GIRAR] [-b REPONAME] [package] command [params]"
echo
......@@ -78,13 +78,13 @@ set_binaryrepo $MENV
case "$COMMAND" in
"add"|"del")
[ -n "$PARAM" ] || fatal "Param for command is missed"
echo "$GIRARHOST:$BINARYREPO ACL for $PROJECTNAME: $COMMAND $PARAM..."
docmd ssh $GIRARHOST acl $BINARYREPO $PROJECTNAME $COMMAND $PARAM
echo "$GEARHOST:$BINARYREPO ACL for $PROJECTNAME: $COMMAND $PARAM..."
docmd ssh $GEARHOST acl $BINARYREPO $PROJECTNAME $COMMAND $PARAM
;;
"show")
showcmd ssh $GIRARHOST acl $BINARYREPO $PROJECTNAME $COMMAND
echo -n "$GIRARHOST:$BINARYREPO ACL for "
ssh $GIRARHOST acl $BINARYREPO $PROJECTNAME $COMMAND
showcmd ssh $GEARHOST acl $BINARYREPO $PROJECTNAME $COMMAND
echo -n "$GEARHOST:$BINARYREPO ACL for "
ssh $GEARHOST acl $BINARYREPO $PROJECTNAME $COMMAND
echo
;;
*)
......
......@@ -240,15 +240,15 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then
# TODO: add check for repo (as in rpmgp) and run ginit if needed
docmd gpush $GIRARHOST $FORCE || fatal "gpush failed. Possibly you need to run '\$ ginit $GIRARHOST' for create remote repo."
echo
echo "Run build $PROJECTNAME at $GIRARHOST"
echo "Run build $PROJECTNAME at $GEARHOST"
if [ -n "$PREPARETASK" ] ; then
docmd ssh $GIRARHOST task add $TASKNUMBER repo $PROJECTNAME $TAG 2>&1 | tee $RPMDIR/uploaded.log.tmp
docmd ssh $GEARHOST task add $TASKNUMBER repo $PROJECTNAME $TAG 2>&1 | tee $RPMDIR/uploaded.log.tmp
else
docmd ssh $GIRARHOST build $(usearg -b $BINARYREPO sisyphus) $(usearg -p $POCKET) $PROJECTNAME $TAG 2>&1 | tee $RPMDIR/uploaded.log.tmp
docmd ssh $GEARHOST build $(usearg -b $BINARYREPO sisyphus) $(usearg -p $POCKET) $PROJECTNAME $TAG 2>&1 | tee $RPMDIR/uploaded.log.tmp
fi
# FIXME: incorporate
cat $RPMDIR/uploaded.log.tmp | grep task | head -n2 | tail -n1 >> $RPMDIR/uploaded.log
echo " run $TASKNUMBER task $PROJECTNAME with tag $TAG at $GIRARHOST (in $BINARYREPO) at `date "+%c"`" >>$RPMDIR/uploaded.log
echo " run $TASKNUMBER task $PROJECTNAME with tag $TAG at $GEARHOST (in $BINARYREPO) at `date "+%c"`" >>$RPMDIR/uploaded.log
rm -f $RPMDIR/uploaded.log.tmp
exit
fi
......@@ -334,10 +334,10 @@ for i in $LISTBUILT ; do
done
if [ -n "$PREPARETASK" ] ; then
echo "Add $TASKLIST to task $TASKNUMBER"
docmd ssh $GIRARHOST task add $TASKNUMBER $TASKLIST 2>&1 | tee $RPMDIR/uploaded.log.tmp
docmd ssh $GEARHOST task add $TASKNUMBER $TASKLIST 2>&1 | tee $RPMDIR/uploaded.log.tmp
else
echo "Create task for $TASKLIST"
docmd ssh $GIRARHOST build $(usearg -b $BINARYREPO sisyphus) $TASKLIST 2>&1 | tee $RPMDIR/uploaded.log.tmp
docmd ssh $GEARHOST build $(usearg -b $BINARYREPO sisyphus) $TASKLIST 2>&1 | tee $RPMDIR/uploaded.log.tmp
fi
# FIXME: parse and incorporate
......
......@@ -70,11 +70,24 @@ is_one_girar_name()
[ -n "$RES" ]
}
# TODO: check the same code in giter
set_gear_host()
{
assert_var GIRARHOST
GITHOST="$GIRARHOST"
GEARHOST="$GITHOST"
[ "$GEARHOST" = "git.alt" ] && GEARHOST="gear.alt"
return 0
}
# Try autodetect GIRARHOST. Return true, if get it from arg (need for shift args)
set_girar_host()
{
if is_girar_name "$1" ; then
GIRARHOST="$1"
set_gear_host
return 0
fi
......@@ -83,6 +96,7 @@ set_girar_host()
if is_one_girar_name "$REMOTELIST" ; then
# use one target if it one
GIRARHOST="$REMOTELIST"
set_gear_host
return 1
fi
......@@ -92,6 +106,7 @@ set_girar_host()
#[ -n "$GIRARHOST" ] || fatal "Can't get default girar alias (like git.alt) from ~/.ssh/config"
fi
set_gear_host
return 1
}
......
......@@ -61,9 +61,9 @@ get_numrelease()
get_default_txtrelease()
{
# assert GIRARHOST
# assert GITHOST
# TODO: check for git.alt in ~/.ssh/config?
echo ${GIRARHOST/git./}
echo ${GITHOST/git./}
}
# get alt from alt11
......
......@@ -86,7 +86,7 @@ for i in $SPECLIST ; do
remove_if_empty $i.GIT.PUBLISHED
if [ -r "$i.GIT.PUBLISHED" ] ; then
ssh $GIRARHOST acl sisyphus $PKGNAME show 2>> $i.GIT.PUBLISHED
ssh $GEARHOST acl sisyphus $PKGNAME show 2>> $i.GIT.PUBLISHED
fi
#grep " $USER\$" $i.acl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment