diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ba5b172..d9aa876 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,15 +1,38 @@ image: gitlab/dind +stages: + - docs + - publish + variables: VERSION: ${CI_COMMIT_REF_NAME} + CI_JOB: ${CI_JOB_ID} before_script: - apt-get update && apt-get install -y --no-install-recommends make linux-image-generic -job: +sd-image: + stage: publish script: - make sd-image artifacts: paths: - hypriotos-rpi-${VERSION}.img.zip - hypriotos-rpi-${VERSION}.img.zip.sha256 + +pages: + stage: docs + image: node:8.9 + before_script: + - npm install gitbook-cli -g # install gitbook + - gitbook fetch latest # fetch latest stable version + - gitbook install docs # add any requested plugins in book.json + script: + - gitbook build docs builder/files/var/www/docs # build to public path + after_script: + - cp -ar builder/files/var/www/docs public + artifacts: + paths: + - public +# only: +# - master diff --git a/builder/build.sh b/builder/build.sh index eaf17f2..6d56ce8 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -59,6 +59,7 @@ mount -t sysfs none ${BUILD_PATH}/sys # modify/add image files directly cp -R /builder/files/* ${BUILD_PATH}/ +cp -R /builder/scripts/* ${BUILD_PATH}/usr/local/bin/ # make our build directory the current root # and install the Rasberry Pi firmware, kernel packages, diff --git a/builder/chroot-script.sh b/builder/chroot-script.sh index f9ac33b..28ea923 100644 --- a/builder/chroot-script.sh +++ b/builder/chroot-script.sh @@ -147,6 +147,12 @@ apt-get -o Dpkg::Options::=--force-confdef \ pi-bluetooth \ lsb-release \ gettext \ + unzip \ + zip \ + libav-tools \ + gstreamer1.0-tools \ + motion \ + gpac \ cloud-init @@ -205,10 +211,23 @@ lighttpd-enable-mod fastcgi-php systemctl disable dhcpcd systemctl disable hciuart +echo "Installing ttyd web terminal" +wget -q https://github.com/tsl0922/ttyd/releases/download/1.4.2/ttyd_linux.armhf -O usr/local/bin/ttyd +chmod +x usr/local/bin/ttyd +systemctl enable ttyd + echo "Installing rpi-serial-console script" wget -q https://raw.githubusercontent.com/lurch/rpi-serial-console/master/rpi-serial-console -O usr/local/bin/rpi-serial-console chmod +x usr/local/bin/rpi-serial-console +echo "Installing RPi Cam Web Interface" +wget -q https://github.com/silvanmelchior/RPi_Cam_Web_Interface/archive/master.zip -O /tmp/rpicam.zip +cd /tmp/ +unzip rpicam.zip +cd RPi_Cam_Web_Interface-master +cp /etc/rpicam_config.txt config.txt +bash ./install.sh q + # fix eth0 interface name ln -s /dev/null /etc/systemd/network/99-default.link diff --git a/builder/files/etc/rc.local b/builder/files/etc/rc.local new file mode 100755 index 0000000..65634df --- /dev/null +++ b/builder/files/etc/rc.local @@ -0,0 +1,14 @@ +#!/bin/sh -e +# +# rc.local +# +# This script is executed at the end of each multiuser runlevel. +# Make sure that the script will "exit 0" on success or any other +# value on error. +# +# In order to enable or disable this script just change the execution +# bits. +# +# By default this script does nothing. + +exit 0 diff --git a/builder/files/etc/rpicam_config.txt b/builder/files/etc/rpicam_config.txt new file mode 100644 index 0000000..325c3f4 --- /dev/null +++ b/builder/files/etc/rpicam_config.txt @@ -0,0 +1,8 @@ +rpicamdir="cam" +webserver="" +webport="80" +user="" +webpasswd="" +autostart="yes" +jpglink="no" +phpversion="7" diff --git a/builder/files/etc/systemd/system/ttyd.service b/builder/files/etc/systemd/system/ttyd.service new file mode 100644 index 0000000..8cda233 --- /dev/null +++ b/builder/files/etc/systemd/system/ttyd.service @@ -0,0 +1,8 @@ +[Unit] +Description=ttyd Web Terminal + +[Service] +ExecStart=/usr/local/bin/ttyd login + +[Install] +WantedBy=multi-user.target diff --git a/builder/files/var/www/index.html b/builder/files/var/www/index.html index 2dc1ada..825519f 100644 --- a/builder/files/var/www/index.html +++ b/builder/files/var/www/index.html @@ -11,12 +11,22 @@
You've correctly connected to your Pi!
If you're seeing this in a pop-up, close it and open http://pi.local in a browser.
+ + ++ Documentation +
+