Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/travis2docker/templates/Dockerfile_deployv
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
37 changes: 37 additions & 0 deletions src/travis2docker/templates/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading