Skip to content

Commit

Permalink
fix: pip installation + image current test (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrenaville authored Sep 26, 2024
1 parent 055fd0e commit c013895
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 47 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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'
Expand All @@ -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 }}
1 change: 0 additions & 1 deletion 12.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion 13.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion 14.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion 15.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion 16.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion 17.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
32 changes: 1 addition & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions example/migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ migration:
operations:
pre:
- "sh -c 'psql -c \"CREATE EXTENSION pg_trgm;\"'"
post:
- anthem songs.install.base::main
addons:
upgrade:
- sale
Expand Down
3 changes: 2 additions & 1 deletion install/setup-pip.sh
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit c013895

Please sign in to comment.