Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to a newer version of git #535

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
19 changes: 18 additions & 1 deletion 11.0.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ FROM python:3.5-stretch AS base

EXPOSE 8069 8072

ARG GEOIP_UPDATER_VERSION=4.1.5
ARG GIT_VERSION=2.37.6
# skip libssl-dev as it's already installed by other packages and should not be removed after git install
ARG GIT_BUILD_DEPENDENCIES="make dh-autoreconf libexpat1-dev libz-dev"
ARG GIT_RUNTIME_DEPENDENCIES="libcurl4-gnutls-dev"
ARG GEOIP_UPDATER_VERSION=4.10.0
ARG MQT=https://github.com/OCA/maintainer-quality-tools.git
ARG WKHTMLTOPDF_VERSION=0.12.5
ARG WKHTMLTOPDF_CHECKSUM='1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb'
Expand Down Expand Up @@ -52,6 +56,8 @@ RUN apt-get -qq update \
zlibc \
apt-transport-https \
ca-certificates \
$GIT_BUILD_DEPENDENCIES \
$GIT_RUNTIME_DEPENDENCIES \
&& echo 'deb https://apt-archive.postgresql.org/pub/repos/apt stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \
&& curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3 /dev/stdin \
Expand All @@ -66,6 +72,17 @@ RUN apt-get -qq update \
&& curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& curl --silent -L --output "git-${GIT_VERSION}.tar.gz" "https://mirrors.edge.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz" \
&& tar xf "git-${GIT_VERSION}.tar.gz" \
&& rm "git-${GIT_VERSION}.tar.gz" \
&& cd git-${GIT_VERSION} \
&& make configure \
&& ./configure --prefix=/usr \
&& make all \
&& make install \
&& cd .. \
&& rm -Rf "git-${GIT_VERSION}" \
&& apt-get remove -y $GIT_BUILD_DEPENDENCIES \
&& rm -Rf /var/lib/apt/lists/* /tmp/*

# Special case to get latest Less and PhantomJS
Expand Down
19 changes: 18 additions & 1 deletion 12.0.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ FROM python:3.5-stretch AS base

EXPOSE 8069 8072

ARG GEOIP_UPDATER_VERSION=4.1.5
ARG GIT_VERSION=2.37.6
# skip libssl-dev as it's already installed by other packages and should not be removed after git install
ARG GIT_BUILD_DEPENDENCIES="make dh-autoreconf libexpat1-dev libz-dev"
ARG GIT_RUNTIME_DEPENDENCIES="libcurl4-gnutls-dev"
ARG GEOIP_UPDATER_VERSION=4.10.0
ARG MQT=https://github.com/OCA/maintainer-quality-tools.git
ARG WKHTMLTOPDF_VERSION=0.12.5
ARG WKHTMLTOPDF_CHECKSUM='1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb'
Expand Down Expand Up @@ -52,6 +56,8 @@ RUN apt-get -qq update \
zlibc \
apt-transport-https \
ca-certificates \
$GIT_BUILD_DEPENDENCIES \
$GIT_RUNTIME_DEPENDENCIES \
&& echo 'deb https://apt-archive.postgresql.org/pub/repos/apt stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \
&& curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3 /dev/stdin \
Expand All @@ -66,6 +72,17 @@ RUN apt-get -qq update \
&& curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& curl --silent -L --output "git-${GIT_VERSION}.tar.gz" "https://mirrors.edge.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz" \
&& tar xf "git-${GIT_VERSION}.tar.gz" \
&& rm "git-${GIT_VERSION}.tar.gz" \
&& cd git-${GIT_VERSION} \
&& make configure \
&& ./configure --prefix=/usr \
&& make all \
&& make install \
&& cd .. \
&& rm -Rf "git-${GIT_VERSION}" \
&& apt-get remove -y $GIT_BUILD_DEPENDENCIES \
&& rm -Rf /var/lib/apt/lists/* /tmp/*

# Special case to get latest Less
Expand Down
21 changes: 18 additions & 3 deletions 13.0.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ FROM python:3.6-slim-buster AS base

EXPOSE 8069 8072

ARG GEOIP_UPDATER_VERSION=4.1.5
ARG GIT_VERSION=2.37.6
# skip libssl-dev as it's already installed by other packages and should not be removed after git install
ARG GIT_BUILD_DEPENDENCIES="make dh-autoreconf libexpat1-dev libz-dev"
ARG GIT_RUNTIME_DEPENDENCIES="libcurl4-gnutls-dev"
ARG GEOIP_UPDATER_VERSION=4.10.0
ARG MQT=https://github.com/OCA/maintainer-quality-tools.git
ARG WKHTMLTOPDF_VERSION=0.12.5
ARG WKHTMLTOPDF_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd'
Expand Down Expand Up @@ -47,7 +51,6 @@ RUN apt-get -qq update \
ffmpeg \
fonts-liberation2 \
gettext \
git \
gnupg2 \
locales-all \
nano \
Expand All @@ -56,13 +59,25 @@ RUN apt-get -qq update \
telnet \
vim \
zlibc \
$GIT_BUILD_DEPENDENCIES \
$GIT_RUNTIME_DEPENDENCIES \
&& echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \
&& curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& apt-get update \
&& apt-get install -yqq --no-install-recommends \
&& curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& curl --silent -L --output "git-${GIT_VERSION}.tar.gz" "https://mirrors.edge.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz" \
&& tar xf "git-${GIT_VERSION}.tar.gz" \
&& rm "git-${GIT_VERSION}.tar.gz" \
&& cd git-${GIT_VERSION} \
&& make configure \
&& ./configure --prefix=/usr \
&& make all \
&& make install \
&& cd .. \
&& rm -Rf "git-${GIT_VERSION}" \
&& apt-get remove -y $GIT_BUILD_DEPENDENCIES \
&& apt-get autopurge -yqq \
&& rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \
&& sync
Expand Down
20 changes: 18 additions & 2 deletions 14.0.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ FROM python:3.8-slim-buster AS base

EXPOSE 8069 8072

ARG GEOIP_UPDATER_VERSION=4.3.0
ARG GIT_VERSION=2.37.6
# skip libssl-dev as it's already installed by other packages and should not be removed after git install
ARG GIT_BUILD_DEPENDENCIES="make dh-autoreconf libexpat1-dev libz-dev"
ARG GIT_RUNTIME_DEPENDENCIES="libcurl4-gnutls-dev"
ARG GEOIP_UPDATER_VERSION=4.10.0
ARG WKHTMLTOPDF_VERSION=0.12.5
ARG WKHTMLTOPDF_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd'
ENV DB_FILTER=.* \
Expand Down Expand Up @@ -44,7 +48,6 @@ RUN apt-get -qq update \
ffmpeg \
fonts-liberation2 \
gettext \
git \
gnupg2 \
locales-all \
nano \
Expand All @@ -53,12 +56,25 @@ RUN apt-get -qq update \
telnet \
vim \
zlibc \
$GIT_BUILD_DEPENDENCIES \
$GIT_RUNTIME_DEPENDENCIES \
&& echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \
&& curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& apt-get update \
&& curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& curl --silent -L --output "git-${GIT_VERSION}.tar.gz" "https://mirrors.edge.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz" \
&& tar xf "git-${GIT_VERSION}.tar.gz" \
&& rm "git-${GIT_VERSION}.tar.gz" \
&& cd git-${GIT_VERSION} \
&& make configure \
&& ./configure --prefix=/usr \
&& make all \
&& make install \
&& cd .. \
&& rm -Rf "git-${GIT_VERSION}" \
&& apt-get remove -y $GIT_BUILD_DEPENDENCIES \
&& apt-get autopurge -yqq \
&& rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \
&& sync
Expand Down
20 changes: 18 additions & 2 deletions 15.0.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ FROM python:3.8-slim-bullseye AS base

EXPOSE 8069 8072

ARG GEOIP_UPDATER_VERSION=4.3.0
ARG GIT_VERSION=2.37.6
# skip libssl-dev as it's already installed by other packages and should not be removed after git install
ARG GIT_BUILD_DEPENDENCIES="make dh-autoreconf libexpat1-dev libz-dev"
ARG GIT_RUNTIME_DEPENDENCIES="libcurl4-gnutls-dev"
ARG GEOIP_UPDATER_VERSION=4.10.0
ARG WKHTMLTOPDF_VERSION=0.12.5
ARG WKHTMLTOPDF_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd'
ENV DB_FILTER=.* \
Expand Down Expand Up @@ -44,20 +48,32 @@ RUN apt-get -qq update \
ffmpeg \
fonts-liberation2 \
gettext \
git \
gnupg2 \
locales-all \
nano \
npm \
openssh-client \
telnet \
vim \
$GIT_BUILD_DEPENDENCIES \
$GIT_RUNTIME_DEPENDENCIES \
&& echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \
&& curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& apt-get update \
&& curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& curl --silent -L --output "git-${GIT_VERSION}.tar.gz" "https://mirrors.edge.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz" \
&& tar xf "git-${GIT_VERSION}.tar.gz" \
&& rm "git-${GIT_VERSION}.tar.gz" \
&& cd git-${GIT_VERSION} \
&& make configure \
&& ./configure --prefix=/usr \
&& make all \
&& make install \
&& cd .. \
&& rm -Rf "git-${GIT_VERSION}" \
&& apt-get remove -y $GIT_BUILD_DEPENDENCIES \
&& apt-get autopurge -yqq \
&& rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \
&& sync
Expand Down
20 changes: 18 additions & 2 deletions 16.0.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ FROM python:3.8-slim-bullseye AS base

EXPOSE 8069 8072

ARG GEOIP_UPDATER_VERSION=4.3.0
ARG GIT_VERSION=2.37.6
# skip libssl-dev as it's already installed by other packages and should not be removed after git install
ARG GIT_BUILD_DEPENDENCIES="make dh-autoreconf libexpat1-dev libz-dev"
ARG GIT_RUNTIME_DEPENDENCIES="libcurl4-gnutls-dev"
ARG GEOIP_UPDATER_VERSION=4.10.0
ARG WKHTMLTOPDF_VERSION=0.12.5
ARG WKHTMLTOPDF_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd'
ENV DB_FILTER=.* \
Expand Down Expand Up @@ -44,20 +48,32 @@ RUN apt-get -qq update \
ffmpeg \
fonts-liberation2 \
gettext \
git \
gnupg2 \
locales-all \
nano \
npm \
openssh-client \
telnet \
vim \
$GIT_BUILD_DEPENDENCIES \
$GIT_RUNTIME_DEPENDENCIES \
&& echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \
&& curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& apt-get update \
&& curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \
&& curl --silent -L --output "git-${GIT_VERSION}.tar.gz" "https://mirrors.edge.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz" \
&& tar xf "git-${GIT_VERSION}.tar.gz" \
&& rm "git-${GIT_VERSION}.tar.gz" \
&& cd git-${GIT_VERSION} \
&& make configure \
&& ./configure --prefix=/usr \
&& make all \
&& make install \
&& cd .. \
&& rm -Rf "git-${GIT_VERSION}" \
&& apt-get remove -y $GIT_BUILD_DEPENDENCIES \
&& apt-get autopurge -yqq \
&& rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \
&& sync
Expand Down
36 changes: 35 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from itertools import product
from os import environ
from os.path import dirname, join
from subprocess import Popen
from subprocess import Popen, check_output

logging.basicConfig(level=logging.DEBUG)

Expand Down Expand Up @@ -728,6 +728,40 @@ def test_aggregate_permissions(self):
("autoaggregate",),
)

def test_git_version(self):
smallest_dir = join(SCAFFOLDINGS_DIR, "smallest")
# make sure image is built before getting expected git version from image layers (history)
for sub_env in matrix():
self.compose_test(smallest_dir, sub_env, ("id",))

# detect expected git version from image layers
if "COMPOSE_PROJECT_NAME" in os.environ:
image_name = f'{os.environ["COMPOSE_PROJECT_NAME"]}_odoo:latest'
else:
image_name = "smallest_odoo:latest"
image_layers = check_output(["docker", "image", "history", image_name]).split(
b"\n"
)
git_version_layer = [
layer for layer in image_layers if b"ARG GIT_VERSION=" in layer
][0]
git_version = [
c for c in git_version_layer.split(b" ") if c.startswith(b"GIT_VERSION=")
][0].split(b"=")[1]
expected_git_version = f"git version {git_version.decode('utf-8')}"

# verify that the git used inside the container matches the expected version
for sub_env in matrix():
self.compose_test(
smallest_dir,
sub_env,
(
"bash",
"-c",
f'set -x; test "$(git --version)" == "{expected_git_version}"',
),
)


if __name__ == "__main__":
unittest.main()