Browse Source

Autostart baangt

bernhardbuhl 4 years ago
parent
commit
faad17a1d9
6 changed files with 16 additions and 32 deletions
  1. 1 0
      .gitignore
  2. 4 4
      Dockerfile
  3. 5 0
      baangt.ini
  4. 2 1
      baangt.sh
  5. 0 26
      getdrivers.sh
  6. 4 1
      xstartup

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+/.project

+ 4 - 4
Dockerfile

@@ -32,7 +32,7 @@ RUN apt-get update -q && \
     rm -rf /var/lib/apt/lists/*
 
 # Install Baangt
-RUN git clone https://gogs.earthsquad.global/athos/baangt && \
+RUN git clone -b master https://gogs.earthsquad.global/athos/baangt --single-branch && \
     pip3 install -r baangt/requirements.txt
 
 WORKDIR /root/
@@ -49,15 +49,15 @@ RUN touch /root/.vnc/passwd && \
 
 COPY start-vncserver.sh /root/
 COPY baangt.sh /root/
-COPY getdrivers.sh /root/
 RUN chmod a+x /root/start-vncserver.sh && \
     chmod a+x /root/baangt.sh && \
-    chmod a+x /root/getdrivers.sh && \
-    /root/getdrivers.sh && \
     echo "mycontainer" > /etc/hostname && \
     echo "127.0.0.1	localhost" > /etc/hosts && \
     echo "127.0.0.1	mycontainer" >> /etc/hosts
 
+WORKDIR /baangt/
+RUN python3 baangt.py --reloadDrivers=True
+
 EXPOSE 5901
 ENV USER root
 CMD [ "/root/start-vncserver.sh" ]

+ 5 - 0
baangt.ini

@@ -0,0 +1,5 @@
+[DEFAULT]
+path = /baangt/examples
+testrun = simpleAutomationpractice.xlsx
+globals = globals.json
+position = (51, 40)

+ 2 - 1
baangt.sh

@@ -1 +1,2 @@
-python3 /baangt/baangt.py
+cd /baangt/
+python3 baangt.py

+ 0 - 26
getdrivers.sh

@@ -1,26 +0,0 @@
-#!/bin/bash
-
-INSTALL_DIR="/usr/local/bin"
-
-json=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest)
-url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("linux64"))')
-curl -s -L "$url" | tar -xz
-chmod +x geckodriver
-mv geckodriver "$INSTALL_DIR"
-echo "installed geckodriver binary in $INSTALL_DIR"
-
-# Chromedriver 
-a=$(uname -m) &&
-rm -r /tmp/chromedriver/
-mkdir /tmp/chromedriver/ &&
-wget -O /tmp/chromedriver/LATEST_RELEASE http://chromedriver.storage.googleapis.com/LATEST_RELEASE &&
-if [ $a == i686 ]; then b=32; elif [ $a == x86_64 ]; then b=64; fi &&
-latest=$(cat /tmp/chromedriver/LATEST_RELEASE) &&
-wget -O /tmp/chromedriver/chromedriver.zip 'http://chromedriver.storage.googleapis.com/'$latest'/chromedriver_linux'$b'.zip' &&
-unzip /tmp/chromedriver/chromedriver.zip chromedriver -d /usr/local/bin/ &&
-echo 'success?'
-
-# Copy Chromedriver and Geckodriver to baangt
-cp /usr/local/bin/geckodriver /baangt/browserDrivers/
-cp /usr/local/bin/chromedriver /baangt/browserDrivers/
-

+ 4 - 1
xstartup

@@ -1,4 +1,7 @@
 export XKL_XMODMAP_DISABLE=1
 #export DISPLAY=:1
 #autocutsel -fork
-exec /usr/bin/startlxde
+exec /usr/bin/startlxde &
+chmod a+x /baangt/browserDrivers/*
+cd /baangt/
+python3 /baangt/baangt.py