Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#! /bin/bash
#set -ex
SF_URL=https://review.rdoproject.org
SF_PWD=REPLACE_ME
RDOINFO=~/rdoinfo
# Retrieve list of registered users
registered_users=`sfmanager --url $SF_URL --auth admin:$SF_PWD membership list`
# Iterate over listed projects
projects=`awk '/project:/ { print $3 }' $RDOINFO/rdo.yml`
for project in $projects; do
# Iterate over maintainers
output=`rdopkg info -l $RDOINFO project:"^$project\$"`
maintainers=`echo "$output" | awk '/.*@.*/ { print $2 }'`
for maintainer in $maintainers; do
# Show unregistered maintainers in Sofware Factory
(echo "$registered_users" | grep $maintainer &>/dev/null) || (echo "$maintainer is not registered in $SF_URL"; continue)
# Add maintainers to their respective project core group
namespace=openstack
[[ $project == puppet* ]] && namespace=puppet
sfmanager --url $SF_URL --auth admin:$SF_PWD membership add --user $maintainer --project $namespace/$project --groups core-group
sfmanager --url $SF_URL --auth admin:$SF_PWD membership add --user $maintainer --project $namespace/$project-distgit --groups core-group
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.