summaryrefslogtreecommitdiffstats
path: root/lava-master
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2018-10-16 16:08:31 +0200
committerCorentin LABBE <clabbe@baylibre.com>2018-10-17 16:27:02 +0200
commit033ceaa64ad89cdedb45f3fc3b6269063402b1bd (patch)
tree96bdfc33a050f2a8477ee524a0c39c577252dc39 /lava-master
parent296bc5fbc5d08ed91771a39f47f02ae90164aa6b (diff)
Permit to create groups
This patch adds support for creating groups
Diffstat (limited to 'lava-master')
-rw-r--r--lava-master/Dockerfile1
-rwxr-xr-xlava-master/scripts/setup.sh24
2 files changed, 25 insertions, 0 deletions
diff --git a/lava-master/Dockerfile b/lava-master/Dockerfile
index d824135..cf47c39 100644
--- a/lava-master/Dockerfile
+++ b/lava-master/Dockerfile
@@ -11,6 +11,7 @@ COPY health-checks/* /etc/lava-server/dispatcher-config/health-checks/
COPY devices/ /root/devices/
COPY device-types/ /root/device-types/
COPY users/ /root/lava-users/
+COPY groups/ /root/lava-groups/
COPY tokens/ /root/lava-callback-tokens/
COPY scripts/setup.sh /
diff --git a/lava-master/scripts/setup.sh b/lava-master/scripts/setup.sh
index 426876f..b362d16 100755
--- a/lava-master/scripts/setup.sh
+++ b/lava-master/scripts/setup.sh
@@ -66,6 +66,30 @@ if [ -e /root/lava-users ];then
done
fi
+if [ -e /root/lava-groups ];then
+ for group in $(ls /root/lava-groups/*group)
+ do
+ GROUPNAME=""
+ SUBMIT=0
+ OPTION_SUBMIT=""
+ . $group
+ if [ $SUBMIT -eq 1 ];then
+ echo "DEBUG: $GROUPNAME can submit jobs"
+ OPTION_SUBMIT="--submitting"
+ fi
+ echo "DEBUG: Add group $GROUPNAME"
+ lava-server manage groups add $OPTION_SUBMIT $GROUPNAME || exit 1
+ if [ -e ${group}.list ];then
+ echo "DEBUG: Found ${group}.list"
+ while read username
+ do
+ echo "DEBUG: Add user $username to group $GROUPNAME"
+ lava-server manage groups update --username $username $GROUPNAME || exit 1
+ done < ${group}.list
+ fi
+ done
+fi
+
if [ -e /root/lava-callback-tokens ];then
for ct in $(ls /root/lava-callback-tokens)
do