diff options
Diffstat (limited to 'lava-master')
-rw-r--r-- | lava-master/Dockerfile | 10 | ||||
-rw-r--r-- | lava-master/lava-patch/.empty | 0 | ||||
-rwxr-xr-x | lava-master/scripts/setup.sh | 24 | ||||
-rwxr-xr-x | lava-master/scripts/start.sh | 3 |
4 files changed, 24 insertions, 13 deletions
diff --git a/lava-master/Dockerfile b/lava-master/Dockerfile index 137a59a..7d61103 100644 --- a/lava-master/Dockerfile +++ b/lava-master/Dockerfile @@ -4,10 +4,6 @@ RUN echo "deb http://ftp.fr.debian.org/debian/ stretch-backports main" >> /etc/a RUN apt-get update -# Add services helper utilities to start and stop LAVA -COPY scripts/stop.sh . -COPY scripts/start.sh . - # Install debian packages used by the container # Configure apache to run the lava server # Log the hostname used during install for the slave name @@ -81,7 +77,6 @@ COPY device-types/ /root/device-types/ COPY users/ /root/lava-users/ COPY tokens/ /root/lava-callback-tokens/ COPY scripts/setup.sh / -RUN /start.sh && /setup.sh && /stop.sh #uncomment if you want to use squid # warning the address used must be network accessible by all slave @@ -91,7 +86,10 @@ RUN /start.sh && /setup.sh && /stop.sh COPY settings.conf /etc/lava-server/ COPY device-types-patch/ /root/device-types-patch/ -RUN cd /etc/lava-server/dispatcher-config/device-types/ && for patch in $(ls /root/device-types-patch/*patch) ; do sed -i 's,lava_scheduler_app/tests/device-types/,,' $patch && patch < $patch ; done +RUN cd /etc/lava-server/dispatcher-config/device-types/ && for patch in $(ls /root/device-types-patch/*patch) ; do sed -i 's,lava_scheduler_app/tests/device-types/,,' $patch && patch < $patch || exit $?; done + +COPY lava-patch/ /root/lava-patch +RUN cd /usr/lib/python3/dist-packages && for patch in $(ls /root/lava-patch/*patch) ; do patch -p1 < $patch || exit $?;done EXPOSE 69/udp 80 3079 5555 5556 diff --git a/lava-master/lava-patch/.empty b/lava-master/lava-patch/.empty new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/lava-master/lava-patch/.empty diff --git a/lava-master/scripts/setup.sh b/lava-master/scripts/setup.sh index 3ab2abd..585499e 100755 --- a/lava-master/scripts/setup.sh +++ b/lava-master/scripts/setup.sh @@ -20,10 +20,15 @@ if [ -e /root/lava-users ];then if [ $SUPERUSER -eq 1 ];then USER_OPTION="$USER_OPTION --superuser" fi - echo "Adding username $USER DEBUG(with $TOKEN / $PASSWORD / $USER_OPTION)" - lava-server manage users add --passwd $PASSWORD $USER_OPTION $USER || exit 1 - if [ ! -z "$TOKEN" ];then - lava-server manage tokens add --user $USER --secret $TOKEN || exit 1 + lava-server manage users list | grep -q "[[:space:]]$USER$" + if [ $? -eq 0 ];then + echo "Skip already existing $USER DEBUG(with $TOKEN / $PASSWORD / $USER_OPTION)" + else + echo "Adding username $USER DEBUG(with $TOKEN / $PASSWORD / $USER_OPTION)" + lava-server manage users add --passwd $PASSWORD $USER_OPTION $USER || exit 1 + if [ ! -z "$TOKEN" ];then + lava-server manage tokens add --user $USER --secret $TOKEN || exit 1 + fi fi done fi @@ -56,9 +61,14 @@ if [ -e /root/device-types ];then do cp $i /etc/lava-server/dispatcher-config/device-types/ devicetype=$(basename $i |sed 's,.jinja2,,') - echo "Adding custom $devicetype" - lava-server manage device-types add $devicetype || exit $? - touch /root/.lavadocker/devicetype-$devicetype + lava-server manage device-types list | grep -q "[[:space:]]$devicetype[[:space:]]" + if [ $? -eq 0 ];then + echo "Skip already known $devicetype" + else + echo "Adding custom $devicetype" + lava-server manage device-types add $devicetype || exit $? + touch /root/.lavadocker/devicetype-$devicetype + fi done fi diff --git a/lava-master/scripts/start.sh b/lava-master/scripts/start.sh index 0e223b5..c34fe34 100755 --- a/lava-master/scripts/start.sh +++ b/lava-master/scripts/start.sh @@ -25,6 +25,9 @@ start () { rm -f /var/run/lava-*.pid 2> /dev/null /etc/init.d/postgresql start + +/setup.sh || exit $? + start apache2 || exit $? start lava-logs || exit $? start lava-master || exit $? |