From c013895273657bfd65b19ec8b80cdf2bd811f73c Mon Sep 17 00:00:00 2001 From: Vincent Renaville Date: Thu, 26 Sep 2024 08:58:25 +0200 Subject: [PATCH] fix: pip installation + image current test (#296) --- .github/workflows/build.yaml | 12 +++++------- 12.0/Dockerfile | 1 - 13.0/Dockerfile | 1 - 14.0/Dockerfile | 1 - 15.0/Dockerfile | 1 - 16.0/Dockerfile | 1 - 17.0/Dockerfile | 1 - Makefile | 32 +------------------------------- example/migration.yml | 2 -- install/setup-pip.sh | 3 ++- 10 files changed, 8 insertions(+), 47 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3e674303..02e31173 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -37,6 +37,8 @@ jobs: - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v2 + with: + driver: docker - name: Docker meta id: docker_meta @@ -50,7 +52,7 @@ jobs: type=raw,value={{branch}}-{{date 'YYYYMMDD'}} type=ref,event=tag type=ref,event=pr - type=schedule,pattern=nightly + type=schedule,pattern={{branch}}-nightly type=raw,value={{branch}} - name: Setup build dir @@ -63,13 +65,11 @@ jobs: context: ./build push: false load: true - tags: ${{ steps.docker_meta.outputs.tags }} + tags: ci-5xx-latest:${{ matrix.odoo_serie }} labels: ${{ steps.docker_meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - name: Test - run: export BASE_IMAGE=${{ matrix.odoo_serie }}:latest; make VERSION=${{ matrix.odoo_serie }} test + run: make VERSION=${{ matrix.odoo_serie }} test - name: Login to GitHub Container Registry if: github.event_name == 'push' || github.event_name == 'schedule' @@ -88,8 +88,6 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - name: Image digest run: echo ${{ steps.docker_push.outputs.digest }} diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 6931c685..7474962a 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -1,5 +1,4 @@ FROM python:3.9-slim-bookworm -MAINTAINER Camptocamp ARG UID=999 # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo diff --git a/13.0/Dockerfile b/13.0/Dockerfile index be9f6e20..f9363162 100644 --- a/13.0/Dockerfile +++ b/13.0/Dockerfile @@ -1,5 +1,4 @@ FROM python:3.9-slim-bookworm -MAINTAINER Camptocamp ARG UID=999 # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo diff --git a/14.0/Dockerfile b/14.0/Dockerfile index 9061fe81..1707a556 100644 --- a/14.0/Dockerfile +++ b/14.0/Dockerfile @@ -1,5 +1,4 @@ FROM python:3.9-slim-bookworm -MAINTAINER Camptocamp ARG UID=999 # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo diff --git a/15.0/Dockerfile b/15.0/Dockerfile index 2b1ebde4..ab485f0d 100644 --- a/15.0/Dockerfile +++ b/15.0/Dockerfile @@ -1,5 +1,4 @@ FROM python:3.12-slim-bookworm -MAINTAINER Camptocamp ARG UID=999 # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo diff --git a/16.0/Dockerfile b/16.0/Dockerfile index c47d3878..6d2c80a7 100644 --- a/16.0/Dockerfile +++ b/16.0/Dockerfile @@ -1,5 +1,4 @@ FROM python:3.12-slim-bookworm -MAINTAINER Camptocamp ARG UID=999 # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo diff --git a/17.0/Dockerfile b/17.0/Dockerfile index c0b2d7aa..b8474a09 100644 --- a/17.0/Dockerfile +++ b/17.0/Dockerfile @@ -1,5 +1,4 @@ FROM python:3.12-slim-bookworm -MAINTAINER Camptocamp ARG UID=999 # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo diff --git a/Makefile b/Makefile index 6c8125ad..900d694f 100644 --- a/Makefile +++ b/Makefile @@ -2,14 +2,7 @@ ifndef VERSION $(error VERSION is not set) endif -ifeq ($(TARGET), GHCR) - NAME=ghcr.io/camptocamp/docker-odoo-project -else - NAME=camptocamp/odoo-project -endif - -IMAGE=$(NAME):$(VERSION) -IMAGE_LATEST=$(IMAGE)-latest +IMAGE_LATEST=ci-5xx-latest:${VERSION} BUILD_TAG=$(IMAGE_LATEST) export @@ -20,29 +13,6 @@ all: build setup: bash setup.sh -.PHONY: build -build: - bash build.sh - -.PHONY: tag -tag: - docker tag $(BUILD_TAG) $(IMAGE)-$(TAG) - - -.PHONY: push -push: - docker push $(IMAGE)-$(TAG) - - -.PHONY: tag_latest_main -tag_latest_main: - docker tag $(BUILD_TAG) $(NAME):latest - - -.PHONY: push_latest_main -push_latest_main: - docker push $(NAME):latest - .PHONY: test test: diff --git a/example/migration.yml b/example/migration.yml index 1a5239c4..d7f7d7c8 100644 --- a/example/migration.yml +++ b/example/migration.yml @@ -6,8 +6,6 @@ migration: operations: pre: - "sh -c 'psql -c \"CREATE EXTENSION pg_trgm;\"'" - post: - - anthem songs.install.base::main addons: upgrade: - sale diff --git a/install/setup-pip.sh b/install/setup-pip.sh index 32ab40fc..8aecebd4 100755 --- a/install/setup-pip.sh +++ b/install/setup-pip.sh @@ -1,6 +1,7 @@ #!/bin/bash set -eo pipefail - +# Install pip with ensuire pip +python -m ensurepip cat << EOF > /etc/pip.conf [global] # counter-intuitively, false means that we enable 'no-cache-dir'