diff --git a/.github/workflows/test_docker_debian_codename_sub.yml b/.github/workflows/test_docker_debian_codename_sub.yml index be8b5f97d..7271c7150 100644 --- a/.github/workflows/test_docker_debian_codename_sub.yml +++ b/.github/workflows/test_docker_debian_codename_sub.yml @@ -133,8 +133,11 @@ jobs: strategy: fail-fast: false matrix: - username: ['pi', 'hans'] - test_script: ['run_installation_tests.sh', 'run_install_kiosk_mode.sh', 'run_install_faststartup.sh'] + username: ['pi'] + test_script: ['run_install_test.sh', 'run_install_webapp.sh', 'run_install_faststartup.sh'] + include: + - username: hans + test_script: run_install_user_not_pi.sh steps: - name: Set up QEMU diff --git a/ci/ci-debian.Dockerfile b/ci/ci-debian.Dockerfile index b2482f9af..7f5f3f1e3 100644 --- a/ci/ci-debian.Dockerfile +++ b/ci/ci-debian.Dockerfile @@ -4,7 +4,7 @@ ARG BASE_TEST_IMAGE=test-code FROM debian:${DEBIAN_CODENAME}-slim as base ARG DEBIAN_CODENAME -ENV DOCKER_RUNNING=true TERM=xterm +ENV CI_RUNNING=true TERM=xterm # create pi configs to test installation RUN touch /boot/cmdline.txt diff --git a/ci/installation/run_install_faststartup.sh b/ci/installation/run_install_faststartup.sh index 724c913d4..f0a76bbf4 100644 --- a/ci/installation/run_install_faststartup.sh +++ b/ci/installation/run_install_faststartup.sh @@ -14,21 +14,19 @@ export DEBIAN_FRONTEND=noninteractive echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections # Run installation (in interactive mode) -# y confirm setup -# y dont use static ip -# y dont deactivate ipv6 -# y dont use autohotspot -# n use default password -# y dont deactivate bluetooth -# y dont disable on-chip audio -# n configure samba -# n dont use rfid reader -# n dont build local WebApp -# n build local docs -# - no kiosk mode (only with WebApp = y) -# - install node (only with WebApp = y) -# n dont reboot - +# y - start setup +# y - use static ip +# y - deactivate ipv6 +# y - setup autohotspot +# n - use custom password +# y - deactivate bluetooth +# y - disable on-chip audio +# n - setup samba +# n - setup rfid reader +# n - build local WebApp +# - - setup kiosk mode (only with WebApp = y) +# - - install node (only with WebApp = y) +# n - reboot "$local_install_script_path"/install-jukebox.sh <<< 'y y @@ -41,12 +39,4 @@ n n n n -n ' -INSTALLATION_EXITCODE=$? - -# count abortion due to "not user pi" as success -if [ "${INSTALLATION_EXITCODE}" -eq 2 ]; then - INSTALLATION_EXITCODE=0 -fi -exit "${INSTALLATION_EXITCODE}" diff --git a/ci/installation/run_installation_tests.sh b/ci/installation/run_install_test.sh similarity index 54% rename from ci/installation/run_installation_tests.sh rename to ci/installation/run_install_test.sh index 003ef51f4..64f3505c5 100644 --- a/ci/installation/run_installation_tests.sh +++ b/ci/installation/run_install_test.sh @@ -14,20 +14,18 @@ export DEBIAN_FRONTEND=noninteractive echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections # Run installation (in interactive mode) -# y confirm setup -# n dont use static ip -# n dont deactivate ipv6 -# n dont use autohotspot -# n dont deactivate bluetooth -# n dont disable on-chip audio -# y configure samba -# n dont use rfid reader -# y dont build local WebApp -# y build local docs -# n no kiosk mode -# y install node -# n dont reboot - +# y - start setup +# n - use static ip +# n - deactivate ipv6 +# n - setup autohotspot +# n - deactivate bluetooth +# n - disable on-chip audio +# y - setup samba +# n - setup rfid reader +# y - build local WebApp +# n - setup kiosk mode +# y - install node +# n - reboot "$local_install_script_path"/install-jukebox.sh <<< 'y n @@ -38,15 +36,7 @@ n y n y -y n y n ' -INSTALLATION_EXITCODE=$? - -# count abortion due to "not user pi" as success -if [ "${INSTALLATION_EXITCODE}" -eq 2 ]; then - INSTALLATION_EXITCODE=0 -fi -exit "${INSTALLATION_EXITCODE}" diff --git a/ci/installation/run_install_kiosk_mode.sh b/ci/installation/run_install_user_not_pi.sh similarity index 59% rename from ci/installation/run_install_kiosk_mode.sh rename to ci/installation/run_install_user_not_pi.sh index 357dd9b2f..4e18793e5 100644 --- a/ci/installation/run_install_kiosk_mode.sh +++ b/ci/installation/run_install_user_not_pi.sh @@ -14,39 +14,26 @@ export DEBIAN_FRONTEND=noninteractive echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections # Run installation (in interactive mode) -# y confirm setup -# n dont use static ip -# n dont deactivate ipv6 -# n dont use autohotspot -# n dont deactivate bluetooth -# n dont disable on-chip audio -# n configure samba -# n dont use rfid reader -# n dont build local WebApp -# n build local docs -# y no kiosk mode -# n install node -# n dont reboot - - -"$local_install_script_path"/install-jukebox.sh <<< 'y -n -n -n -n -n -n -n -y -n -y -n -n -' +# y - start setup +# n - use static ip +# n - deactivate ipv6 +# n - setup autohotspot +# n - deactivate bluetooth +# n - disable on-chip audio +# y - setup samba +# n - setup rfid reader +# y - build local WebApp +# n - setup kiosk mode +# y - install node +# n - reboot + +"$local_install_script_path"/install-jukebox.sh INSTALLATION_EXITCODE=$? -# count abortion due to "not user pi" as success +# only count abortion due to "not user pi" as success if [ "${INSTALLATION_EXITCODE}" -eq 2 ]; then INSTALLATION_EXITCODE=0 +else + INSTALLATION_EXITCODE=1 fi exit "${INSTALLATION_EXITCODE}" diff --git a/ci/installation/run_install_webapp.sh b/ci/installation/run_install_webapp.sh new file mode 100644 index 000000000..0e4e99e3a --- /dev/null +++ b/ci/installation/run_install_webapp.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +# Install Phoniebox and test it +# Used e.g. for tests on Docker + +# Objective: Test installation with script using a simple configuration + +local_install_script_path="${INSTALL_SCRIPT_PATH:-./../../installation/}" +local_install_script_path="${local_install_script_path%/}" + +# Preparations +# No interactive frontend +export DEBIAN_FRONTEND=noninteractive +echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections + +# Run installation (in interactive mode) +# y - start setup +# n - use static ip +# n - deactivate ipv6 +# n - setup autohotspot +# n - deactivate bluetooth +# n - disable on-chip audio +# n - setup samba +# n - setup rfid reader +# y - build local WebApp +# y - setup kiosk mode +# y - install node +# n - reboot + +"$local_install_script_path"/install-jukebox.sh <<< 'y +n +n +n +n +n +n +n +y +y +y +n +' diff --git a/installation/install-jukebox.sh b/installation/install-jukebox.sh index 629525176..9382e6c62 100755 --- a/installation/install-jukebox.sh +++ b/installation/install-jukebox.sh @@ -83,7 +83,7 @@ checkPrerequisite ### RUN INSTALLATION cd "${HOME_PATH}" INSTALLATION_LOGFILE="${HOME_PATH}/INSTALL-${INSTALL_ID}.log" -if [ "$DOCKER_RUNNING" == "true" ]; then +if [ "$CI_RUNNING" == "true" ]; then exec 3>&1 2>&1 else exec 3>&1 1>>"${INSTALLATION_LOGFILE}" 2>&1 || { echo "Cannot create log file. Panic."; exit 1; } diff --git a/installation/routines/customize_options.sh b/installation/routines/customize_options.sh index 759863d76..054389817 100644 --- a/installation/routines/customize_options.sh +++ b/installation/routines/customize_options.sh @@ -212,14 +212,14 @@ ${DISABLE_ONBOARD_AUDIO_BACKUP} if things go pear-shaped.) _option_webapp_devel_build() { # Let's detect if we are on the official release branch - if [[ "$GIT_BRANCH" != "${GIT_BRANCH_RELEASE}" || "$GIT_USER" != "$GIT_UPSTREAM_USER" ]]; then + if [[ "$GIT_BRANCH" != "${GIT_BRANCH_RELEASE}" || "$GIT_USER" != "$GIT_UPSTREAM_USER" || "$CI_RUNNING" == "true" ]]; then ENABLE_INSTALL_NODE=true # Unless ENABLE_WEBAPP_PROD_DOWNLOAD is forced to true by user override, do not download a potentially stale build - if [[ "$ENABLE_WEBAPP_PROD_DOWNLOAD" = "release-only" ]]; then + if [[ "$ENABLE_WEBAPP_PROD_DOWNLOAD" == "release-only" ]]; then ENABLE_WEBAPP_PROD_DOWNLOAD=false fi - if [[ "$ENABLE_WEBAPP_PROD_DOWNLOAD" = false ]]; then + if [[ "$ENABLE_WEBAPP_PROD_DOWNLOAD" == false ]]; then echo -e "Your are installing from a non-release branch. This means, you will need to build the web app locally. For that you'll need Node.