vitabaks / postgresql_cluster

PostgreSQL High-Availability Cluster (based on Patroni). Automating with Ansible.
https://postgresql-cluster.org
MIT License
1.69k stars 411 forks source link

Add a GitHub Action for Docker (make docker-build) #353

Closed ThomasSanson closed 1 year ago

ThomasSanson commented 1 year ago

Hello,

As we know, Docker is a key part of our infrastructure, and we need to ensure that changes to the repository do not inadvertently break the Docker build process. To this end, I propose that we add a GitHub Action that will automatically execute make docker-build whenever changes are pushed to the repository. This will help us catch potential issues early and ensure that our Docker environment remains stable and reliable.

This action can be set up in a new workflow file under the .github/workflows directory, and it would look something like this:

name: Docker Build Test

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Docker Build Test
      run: make reinitialization && make docker-build

This setup will run the make docker-build command on every push or pull request, ensuring that our Docker build is always functional.

Please let me know your thoughts on this. If there's consensus on the idea, I'd be happy to take the lead on implementing this feature.

Best,

vitabaks commented 1 year ago

Hello.

docker is not a key part of the infrastructure, it is an auxiliary tool designed to prepare the gitpod environment for development.

as far as I know, the build is performed when creating the MR or starting the gitpod environment.

vitabaks commented 1 year ago

As I understand it, the action you suggested is needed only for testing the assembly of the docker image.

ThomasSanson commented 1 year ago

Hello @vitabaks,

Thank you for your response and for clarifying the role of Docker in our infrastructure.

You're correct that the primary purpose of the GitHub Action I proposed is to test the assembly of the Docker image. My suggestion is based on the principle that even auxiliary tools like Docker, which we use to prepare the Gitpod environment for development, could benefit from automated testing.

While the build is indeed performed when creating the MR or starting the Gitpod environment, having a GitHub Action specifically for make docker-build could provide us with an extra layer of assurance. This action would alert us to any potential issues with the Docker image assembly process as soon as changes are pushed to the repository, helping us maintain the reliability and stability of our development environment.

I understand your point of view, and I respect it. I'd like to ask if you see any potential drawbacks or concerns with adding this GitHub Action. If so, I'd be interested in discussing them further. It's always beneficial for us to exchange perspectives as we continue to improve this project.

vitabaks commented 1 year ago

It makes sense, there are never too many tests. Let's add this build test.