diff --git a/README.rst b/README.rst index 4eefc67..cb30092 100644 --- a/README.rst +++ b/README.rst @@ -114,6 +114,8 @@ Dockerfile. If the flag is not defined, the step is skipped. - vim + spf13-vim, vim-openerp, jedi-vim, wakatime and the pylint_odoo/eslint syntastic configuration * - ``ZSH_INSTALL`` - zsh + oh-my-zsh with the ``odoo-shippable`` theme + * - ``CHROME_INSTALL`` + - Google Chrome and ffmpeg, required to run the JS tours the same way CI does. Honors ``CHROME_VERSION`` from ``variables.sh`` like vxci: a pinned version no longer in Google's apt pool is fetched from Chrome for Testing * - ``CHOWN_UID_GID`` - Aligns the odoo user UID/GID to 5410 to match OrchestSH images. Slow: it re-chowns the whole filesystem diff --git a/src/travis2docker/templates/Dockerfile_deployv b/src/travis2docker/templates/Dockerfile_deployv index 259e4fe..ef9873d 100644 --- a/src/travis2docker/templates/Dockerfile_deployv +++ b/src/travis2docker/templates/Dockerfile_deployv @@ -25,6 +25,7 @@ ENV {{ build_env_arg }}=TRUE RUN . /home/odoo/build.sh && \ set_odoo_ids && \ install_dev_tools && \ + install_chrome && \ service_postgres_without_sudo odoo odoo && \ install_pgcli_venv && \ custom_alias && \ diff --git a/src/travis2docker/templates/build.sh b/src/travis2docker/templates/build.sh index f7697b4..0310d98 100644 --- a/src/travis2docker/templates/build.sh +++ b/src/travis2docker/templates/build.sh @@ -162,6 +162,43 @@ EOF done } +install_chrome(){ + # Based on vxci tools_test.py (install_chrome_commands) and common.py (install_test_deps): + # https://git.vauxoo.com/devops/vxci/blob/master/vxci/tools_test.py + if [ -z ${CHROME_INSTALL+x} ]; + then + echo "CHROME_INSTALL is not defined. Skipping Chrome installation." + return 0; + fi + version="${CHROME_VERSION:-current}" + [ "$version" = "OS" ] && version="current" + pool_url="https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${version}_amd64.deb" + current_url="https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" + + if [ "$version" != "current" ] && wget -q --spider "$pool_url"; then + chrome_url="$pool_url" + else + chrome_url="$current_url" + fi + + wget "$chrome_url" -O /tmp/chrome.deb + dpkg -i /tmp/chrome.deb || apt install -y -f + dpkg -i /tmp/chrome.deb + rm /tmp/chrome.deb + + if [ "$version" != "current" ] && [ "$chrome_url" = "$current_url" ]; then + apt install -y unzip + cft_version="${version%-*}" + wget "https://storage.googleapis.com/chrome-for-testing-public/${cft_version}/linux64/chrome-linux64.zip" -O /tmp/chrome-cft.zip + rm -rf /opt/chrome-linux64 + unzip -q /tmp/chrome-cft.zip -d /opt + ln -sf /opt/chrome-linux64/chrome /usr/bin/google-chrome + rm /tmp/chrome-cft.zip + fi + # Generates screencast when tour fails + apt install -y ffmpeg +} + setup_coverage() { echo "export MODULES2TEST=$(cd ${MAIN_REPO_FULL_PATH} && find * -name "__manifest__.py" -printf "/%h,")" >> ${HOME}/.bashrc echo "export MODULES2INSTALL=$(cd ${MAIN_REPO_FULL_PATH} && find * -name "__manifest__.py" -printf "%h,")" >> ${HOME}/.bashrc