Brian O'Connor

Updating onos-edit-config to unblock push for release

Some minor fixes for onos-release-prerequisites

Change-Id: I3c0003fef9de6cf26ce33ca4930db3c4b6000ce5
......@@ -8,7 +8,7 @@ set -e
GERRIT_USER=${GERRIT_USER:-$USER}
GERRIT_PROJECT=${GERRIT_PROJECT:-onos}
function setup() {
function setup {
DIR=$(mktemp -d /tmp/$GERRIT_PROJECT-config.XXXXX) || { echo "Failed to create temp file"; exit 1; }
cd $DIR
git init
......@@ -17,22 +17,30 @@ function setup() {
git checkout meta/config
}
function cleanup() {
function cleanup {
# clean up the directory
rm -rf $OUT
rm -rf $DIR
}
function testReleaseMembership {
trap "echo 'ERROR: Not a member of the ONOS Release group'; cleanup" ERR
ssh -p 29418 gerrit.onosproject.org gerrit ls-members "ONOS\ Release" | grep -q $GERRIT_USER
}
setup
case $1 in
block)
testReleaseMembership
sed -i '' "s/submit = group/submit = block group/g" project.config
sed -i '' "s/push = block group ONOS Release/push = group ONOS Release/g" project.config
git diff
git commit -am"Blocking submit for all users in project"
git push origin HEAD:refs/meta/config
;;
unblock)
echo unblock
testReleaseMembership
sed -i '' "s/submit = block group/submit = group/g" project.config
sed -i '' "s/push = group ONOS Release/push = block group ONOS Release/g" project.config
git diff
git commit -am"Unblocking submit for all users in project"
git push origin HEAD:refs/meta/config
......
......@@ -6,15 +6,17 @@
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
GERRIT_USER=${GERRIT_USER:-$USER}
WIKI_USER=${WIKI_USER:-$USER}
set -e
# Test access to Gerrit (Administrator)
function testGerritAccess {
trap "echo 'FAILED'" ERR
printf "Checking Gerrit Administrator access... "
ssh -p 29418 gerrit.onosproject.org gerrit ls-members Administrators \
printf "Checking Gerrit ONOS Release group access... "
ssh -p 29418 gerrit.onosproject.org gerrit ls-members "ONOS\ Release"\
--recursive | grep -q $GERRIT_USER
echo "OK"
}
......@@ -22,7 +24,7 @@ function testGerritAccess {
function testWikiAccess {
trap "echo 'FAILED'" ERR
printf "Checking Wiki access... "
ssh $USER@api.onosproject.org "test -w /var/www/api/index.html"
ssh $WIKI_USER@wiki.onosproject.org "test -w /var/www/api/index.html"
echo "OK"
}
......