From c20f4855f92006d116be7c3a5f2a693fcb8b8977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Cabrera?= Date: Fri, 23 Feb 2024 22:02:15 +0000 Subject: [PATCH] fix(ci): do the semrel thing --- .github/workflows/build.yaml | 20 ++++++++++++ .github/workflows/build.yml | 19 ------------ .github/workflows/push.yaml | 43 ++++++++++++++++++++++++++ .github/workflows/release.yml | 58 ++++++++--------------------------- .releaserc.json | 20 ++++++++++++ Dockerfile | 56 ++++++++++++++++----------------- README.md | 2 ++ package.json | 41 ------------------------- renovate.json | 1 + 9 files changed, 126 insertions(+), 134 deletions(-) create mode 100644 .github/workflows/build.yaml delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/push.yaml create mode 100644 .releaserc.json delete mode 100644 package.json diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..65390b9 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,20 @@ +name: Docker build +on: + push: + +jobs: + docker-build: + name: Docker build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Docker build + id: docker_build + uses: docker/build-push-action@v5 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 10edb20..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Build -on: - - push - - pull_request - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build - id: docker_build - uses: docker/build-push-action@v3 - with: - push: false diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml new file mode 100644 index 0000000..79aaf06 --- /dev/null +++ b/.github/workflows/push.yaml @@ -0,0 +1,43 @@ +name: Docker Push +on: + push: + tags: + - '*' + +jobs: + docker-push: + name: Docker push + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + labels: | + org.opencontainers.image.url=https://hub.docker.com/r/rubencabrera/odoo-base-image + images: rubencabrera/odoo-base-image + tags: | + type=ref,event=tag + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}}.{{patch}} + - name: Docker build and push + id: docker_push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 17e43c8..611a3c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,55 +1,23 @@ -name: Release +name: Semantic Release on: push: - branches: - - 12 + jobs: - release: - name: Release + semantic-release: + name: Semantic Release + permissions: + contents: write + issues: write + pull-requests: write runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 + persist-credentials: false - name: Semantic Release - id: semantic + id: semrel env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: cycjimmy/semantic-release-action@v2 - with: - extra_plugins: | - @semantic-release/commit-analyzer - @semantic-release/git - - name: Login to DockerHub - if: steps.semantic.outputs.new_release_published == 'true' - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Set up QEMU - if: steps.semantic.outputs.new_release_published == 'true' - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - if: steps.semantic.outputs.new_release_published == 'true' - uses: docker/setup-buildx-action@v2 - - name: Docker meta - id: meta - if: steps.semantic.outputs.new_release_published == 'true' - uses: crazy-max/ghaction-docker-meta@v4 - with: - labels: | - org.opencontainers.image.url=https://hub.docker.com/r/rubencabrera/odoo-base-image - images: rubencabrera/odoo-base-image - tags: | - type=ref,event=tag - type=semver,pattern={{version}} - - name: Docker build and push - if: steps.semantic.outputs.new_release_published == 'true' - id: docker_build - uses: docker/build-push-action@v3 - with: - push: ${{ github.event_name != 'pull_request' }} - tags: | - rubencabrera/odoo-base-image:${{ steps.semantic.outputs.new_release_version }} - labels: ${{ steps.meta.outputs.labels }} + GITHUB_TOKEN: ${{ secrets.SEMREL_GITHUB_TOKEN }} + uses: cycjimmy/semantic-release-action@v4 diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..5a095f8 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,20 @@ +{ + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "angular", + "releaseRules": [ + {"type": "docs", "scope": "README", "release": "patch"}, + {"type": "refactor", "release": "patch"}, + {"type": "style", "release": "patch"}, + {"type": "build", "release": "patch"} + ] + } + ], + "@semantic-release/release-notes-generator", + "@semantic-release/github" + ], + "repositoryUrl": "https://github.com/rubencabrera/odoo-base-images.git", + "tagFormat": "${version}" +} diff --git a/Dockerfile b/Dockerfile index ffff391..c309a68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ -# DOCKER image to run odoo 12 with Odoo Community Backports and OCA addons -FROM debian:9.13 +# DOCKER image to run odoo 14 with Odoo Community Backports and OCA addons +# Bullseye: +FROM debian:11.6 MAINTAINER Rubén Cabrera Martínez EXPOSE 8069 8071 8072 ENV LANG C.UTF-8 @@ -11,22 +12,17 @@ RUN apt-get update \ gnupg2 \ -y -RUN add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" -y; \ - wget --quiet -O - https://postgresql.org/media/keys/ACCC4CF8.asc | \ - apt-key add - - RUN apt-get update && apt-get install \ git \ - libssl1.0-dev \ + libssl-dev \ locales \ net-tools \ node-clean-css \ node-less \ - postgresql-client-9.6 \ + postgresql-client \ python3-apt \ python3-babel \ python3-cups \ - python3-dateutil \ python3-decorator \ python3-dev \ python3-docutils \ @@ -67,25 +63,27 @@ RUN apt-get update && apt-get install \ xfonts-utils \ -y -RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb -RUN dpkg -i wkhtmltox_0.12.5-1.stretch_amd64.deb +RUN wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.bullseye_amd64.deb +RUN dpkg -i wkhtmltox_0.12.6.1-2.bullseye_amd64.deb RUN pip3 install \ - backports.functools_lru_cache \ - bokeh \ - cssutils \ - dbfpy \ - html2text \ - libsass \ - odoorpc \ - ofxparse \ - openupgradelib \ - num2words \ - pandas \ - phonenumbers \ - psycogreen \ - twilio \ - unidecode \ - xlrd \ - zeep \ - zklib + backports.functools_lru_cache \ + bokeh \ + cssutils \ + dbfpy \ + html2text \ + libsass \ + odoorpc \ + ofxparse \ + openupgradelib \ + num2words \ + pandas \ + phonenumbers \ + polib \ + psycogreen \ + python-dateutil \ + twilio \ + unidecode \ + xlrd \ + zeep \ + zklib diff --git a/README.md b/README.md index 61cd416..2c9afad 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,6 @@ Base docker images for [odoo-docker with OCA repos][odoo-docker]. +There's no Odoo in this images, just the dependencies. + [odoo-docker]: https://github.com/rubencabrera/odoo-docker diff --git a/package.json b/package.json deleted file mode 100644 index 212eb68..0000000 --- a/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "odoo-base-images", - "description": "Odoo docker base images", - "scripts": { - "semantic-release": "semantic-release" - }, - "devDependencies": { - "semantic-release": "19.0.3", - "@semantic-release/commit-analyzer": "9.0.2", - "@semantic-release/git": "10.0.1" - }, - "release": { - "branches": ["12"], - "repositoryUrl": "https://github.com/rubencabrera/odoo-base-images.git", - "tagFormat": "${version}", - "plugins": [ - [ - "@semantic-release/commit-analyzer", - { - "preset": "angular", - "releaseRules": [ - {"type": "docs", "scope": "README", "release": "patch"}, - {"type": "refactor", "release": "patch"}, - {"type": "style", "release": "patch"}, - {"type": "build", "release": "patch"} - ] - } - ], - "@semantic-release/git" - ] - }, - "keywords": [ - "odoo" - ], - "author": "Rubén Cabrera Martínez", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/rubencabrera/odoo-base-images/issues" - }, - "homepage": "https://github.com/rubencabrera/odoo-base-images" -} diff --git a/renovate.json b/renovate.json index e030821..22de768 100644 --- a/renovate.json +++ b/renovate.json @@ -1,4 +1,5 @@ { + "baseBranches": ["12.x", "14.x", "16.x"], "regexManagers": [ { "datasourceTemplate": "docker",