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

set GITHOST and GEARHOST and use GEARHOST

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