From 117cec76949a77737aa4a0712bd9bfdb7ad66751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Duch=C3=AAne?= Date: Mon, 28 Oct 2024 11:18:01 +0100 Subject: [PATCH] Backport GHA --- .github/workflows/docker-publish-base.yml | 26 ++- .github/workflows/docker-publish.yml | 59 ++++-- .github/workflows/release.yml | 240 ++++++++++++---------- 3 files changed, 179 insertions(+), 146 deletions(-) diff --git a/.github/workflows/docker-publish-base.yml b/.github/workflows/docker-publish-base.yml index e44b698..f495155 100644 --- a/.github/workflows/docker-publish-base.yml +++ b/.github/workflows/docker-publish-base.yml @@ -1,22 +1,26 @@ name: Update base image + on: workflow_dispatch: schedule: - cron: '0 2 * * *' # Daily at 02:00 +env: + IMAGE_NAME: delib/iadelib + jobs: base: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 steps: - name: Build and publish base image to harbor - uses: IMIO/buildout.pm/actions/harbor@master + uses: IMIO/gha/build-push-notify@v3.9.3 with: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - HARBOR_URL: ${{ secrets.HARBOR_URL }} - DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} - DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} - tags: | - imiobe/iadelib:base - "${{ secrets.HARBOR_URL }}/delib/iadelib:base" - dockerfile: ./docker/Dockerfile-base \ No newline at end of file + IMAGE_NAME: ${{ env.IMAGE_NAME }} + IMAGE_TAGS: | + ${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:base + REGISTRY_URL: ${{ secrets.HARBOR_URL }} + REGISTRY_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + CONTEXT: '.' + DOCKERFILE: './docker/Dockerfile-base' diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 9c1d1ed..c038ac9 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,32 +1,47 @@ name: Update images + on: workflow_dispatch: push: branches: [ master ] + +concurrency: + group: ${{ github.workflow }} + +env: + IMAGE_NAME: delib/iadelib + jobs: - docker: - runs-on: ubuntu-latest + docker-latest: + runs-on: gha-runners-delib-py3 steps: - - name: Build latest - uses: IMIO/buildout.pm/actions/harbor@master + - name: Build and publish communes image to harbor + uses: IMIO/gha/build-push-notify@v3.9.3 with: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - HARBOR_URL: ${{ secrets.HARBOR_URL }} - DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} - DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} - tags: | - imiobe/iadelib:latest - "${{ secrets.HARBOR_URL }}/delib/iadelib:latest" - dockerfile: ./docker/Dockerfile-latest + IMAGE_NAME: ${{ env.IMAGE_NAME }} + IMAGE_TAGS: | + ${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:latest + REGISTRY_URL: ${{ secrets.HARBOR_URL }} + REGISTRY_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + CONTEXT: '.' + DOCKERFILE: './docker/Dockerfile-latest' + BUILD_ARGS: 'PROFILE=communes.cfg' + + docker-dev: + runs-on: gha-runners-delib-py3 + steps: - name: Build and publish dev image - uses: IMIO/buildout.pm/actions/harbor@master + uses: IMIO/gha/build-push-notify@v3.9.3 with: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - HARBOR_URL: ${{ secrets.HARBOR_URL }} - DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} - DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} - tags: imiobe/iadelib:dev - dockerfile: ./docker/Dockerfile-dev - profile: communes-dev + IMAGE_NAME: ${{ env.IMAGE_NAME }} + IMAGE_TAGS: | + ${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:dev + REGISTRY_URL: ${{ secrets.HARBOR_URL }} + REGISTRY_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + CONTEXT: '.' + DOCKERFILE: './docker/Dockerfile-dev' + BUILD_ARGS: 'PROFILE=communes-dev.cfg' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ebb450e..18c8b42 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,167 +1,181 @@ name: Release on: - create: - tag: + workflow_dispatch: + push: + tags: + - '**' + +concurrency: + group: ${{ github.workflow }} + +env: + IMAGE_NAME: delib/iadelib jobs: communes: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 steps: - name: Build and publish communes image to harbor - uses: IMIO/buildout.pm/actions/harbor@master + uses: IMIO/gha/build-push-notify@v3.9.3 with: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - HARBOR_URL: ${{ secrets.HARBOR_URL }} - DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} - DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} - tags: | - "imiobe/iadelib:${{ github.ref_name }}" - "imiobe/iadelib:communes-${{ github.ref_name }}" - "${{ secrets.HARBOR_URL }}/delib/iadelib:${{ github.ref_name }}" - "${{ secrets.HARBOR_URL }}/delib/iadelib:communes-${{ github.ref_name }}" + IMAGE_NAME: ${{ env.IMAGE_NAME }} + IMAGE_TAGS: | + ${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} + ${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:communes-${{ github.ref_name }} + REGISTRY_URL: ${{ secrets.HARBOR_URL }} + REGISTRY_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + CONTEXT: '.' + DOCKERFILE: './docker/Dockerfile-latest' + BUILD_ARGS: 'PROFILE=communes.cfg' bep: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 steps: - name: Build and publish bep image to harbor - uses: IMIO/buildout.pm/actions/harbor@master + uses: IMIO/gha/build-push-notify@v3.9.3 with: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - HARBOR_URL: ${{ secrets.HARBOR_URL }} - DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} - DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} - profile: bep - tags: | - "imiobe/iadelib:bep-${{ github.ref_name }}" - "${{ secrets.HARBOR_URL }}/delib/iadelib:bep-${{ github.ref_name }}" + IMAGE_NAME: ${{ env.IMAGE_NAME }} + IMAGE_TAGS: | + ${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:bep-${{ github.ref_name }} + REGISTRY_URL: ${{ secrets.HARBOR_URL }} + REGISTRY_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + CONTEXT: '.' + DOCKERFILE: './docker/Dockerfile-latest' + BUILD_ARGS: 'PROFILE=bep.cfg' charleroi: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 steps: - name: Build and publish charleroi image to harbor - uses: IMIO/buildout.pm/actions/harbor@master + uses: IMIO/gha/build-push-notify@v3.9.3 with: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - HARBOR_URL: ${{ secrets.HARBOR_URL }} - DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} - DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} - profile: charleroi - tags: | - "imiobe/iadelib:charleroi-${{ github.ref_name }}" - "${{ secrets.HARBOR_URL }}/delib/iadelib:charleroi-${{ github.ref_name }}" + IMAGE_NAME: ${{ env.IMAGE_NAME }} + IMAGE_TAGS: | + ${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:charleroi-${{ github.ref_name }} + REGISTRY_URL: ${{ secrets.HARBOR_URL }} + REGISTRY_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + CONTEXT: '.' + DOCKERFILE: './docker/Dockerfile-latest' + BUILD_ARGS: 'PROFILE=charleroi.cfg' hainaut-prov: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 steps: - name: Build and publish hainaut-prov image to harbor - uses: IMIO/buildout.pm/actions/harbor@master + uses: IMIO/gha/build-push-notify@v3.9.3 with: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - HARBOR_URL: ${{ secrets.HARBOR_URL }} - DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} - DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} - profile: hainaut-prov - tags: | - "imiobe/iadelib:hainaut-prov-${{ github.ref_name }}" - "${{ secrets.HARBOR_URL }}/delib/iadelib:hainaut-prov-${{ github.ref_name }}" + IMAGE_NAME: ${{ env.IMAGE_NAME }} + IMAGE_TAGS: | + ${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:hainaut-prov-${{ github.ref_name }} + REGISTRY_URL: ${{ secrets.HARBOR_URL }} + REGISTRY_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + CONTEXT: '.' + DOCKERFILE: './docker/Dockerfile-latest' + BUILD_ARGS: 'PROFILE=hainaut-prov.cfg' lalouviere: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 steps: - name: Build and publish lalouviere image to harbor - uses: IMIO/buildout.pm/actions/harbor@master + uses: IMIO/gha/build-push-notify@v3.9.3 with: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - HARBOR_URL: ${{ secrets.HARBOR_URL }} - DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} - DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} - profile: lalouviere - tags: | - "imiobe/iadelib:lalouviere-${{ github.ref_name }}" - "${{ secrets.HARBOR_URL }}/delib/iadelib:lalouviere-${{ github.ref_name }}" + IMAGE_NAME: ${{ env.IMAGE_NAME }} + IMAGE_TAGS: | + ${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:lalouviere-${{ github.ref_name }} + REGISTRY_URL: ${{ secrets.HARBOR_URL }} + REGISTRY_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + CONTEXT: '.' + DOCKERFILE: './docker/Dockerfile-latest' + BUILD_ARGS: 'PROFILE=lalouviere.cfg' lalouviere-cpas: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 steps: - name: Build and publish lalouviere-cpas image to harbor - uses: IMIO/buildout.pm/actions/harbor@master + uses: IMIO/gha/build-push-notify@v3.9.3 with: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - HARBOR_URL: ${{ secrets.HARBOR_URL }} - DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} - DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} - profile: lalouviere-cpas - tags: | - "imiobe/iadelib:lalouviere-cpas-${{ github.ref_name }}" - "${{ secrets.HARBOR_URL }}/delib/iadelib:lalouviere-cpas-${{ github.ref_name }}" + IMAGE_NAME: ${{ env.IMAGE_NAME }} + IMAGE_TAGS: | + ${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:lalouviere-cpas-${{ github.ref_name }} + REGISTRY_URL: ${{ secrets.HARBOR_URL }} + REGISTRY_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + CONTEXT: '.' + DOCKERFILE: './docker/Dockerfile-latest' + BUILD_ARGS: 'PROFILE=lalouviere-cpas.cfg' liege: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 steps: - name: Build and publish liege image to harbor - uses: IMIO/buildout.pm/actions/harbor@master + uses: IMIO/gha/build-push-notify@v3.9.3 with: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - HARBOR_URL: ${{ secrets.HARBOR_URL }} - DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} - DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} - profile: liege - tags: | - "imiobe/iadelib:liege-${{ github.ref_name }}" - "${{ secrets.HARBOR_URL }}/delib/iadelib:liege-${{ github.ref_name }}" + IMAGE_NAME: ${{ env.IMAGE_NAME }} + IMAGE_TAGS: | + ${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:liege-${{ github.ref_name }} + REGISTRY_URL: ${{ secrets.HARBOR_URL }} + REGISTRY_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + DOCKERFILE: './docker/Dockerfile-latest' + BUILD_ARGS: 'PROFILE=liege.cfg' mons: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 steps: - name: Build and publish mons image to harbor - uses: IMIO/buildout.pm/actions/harbor@master + uses: IMIO/gha/build-push-notify@v3.9.3 with: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - HARBOR_URL: ${{ secrets.HARBOR_URL }} - DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} - DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} - profile: mons - tags: | - "imiobe/iadelib:mons-${{ github.ref_name }}" - "${{ secrets.HARBOR_URL }}/delib/iadelib:mons-${{ github.ref_name }}" + IMAGE_NAME: ${{ env.IMAGE_NAME }} + IMAGE_TAGS: | + ${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:mons-${{ github.ref_name }} + REGISTRY_URL: ${{ secrets.HARBOR_URL }} + REGISTRY_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + DOCKERFILE: './docker/Dockerfile-latest' + BUILD_ARGS: 'PROFILE=mons.cfg' namur: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 steps: - name: Build and publish namur image to harbor - uses: IMIO/buildout.pm/actions/harbor@master + uses: IMIO/gha/build-push-notify@v3.9.3 with: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - HARBOR_URL: ${{ secrets.HARBOR_URL }} - DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} - DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} - profile: namur - tags: | - "imiobe/iadelib:namur-${{ github.ref_name }}" - "${{ secrets.HARBOR_URL }}/delib/iadelib:namur-${{ github.ref_name }}" + IMAGE_NAME: ${{ env.IMAGE_NAME }} + IMAGE_TAGS: | + ${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:namur-${{ github.ref_name }} + REGISTRY_URL: ${{ secrets.HARBOR_URL }} + REGISTRY_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + DOCKERFILE: './docker/Dockerfile-latest' + BUILD_ARGS: 'PROFILE=namur.cfg' seraing: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 steps: - name: Build and publish seraing image to harbor - uses: IMIO/buildout.pm/actions/harbor@master + uses: IMIO/gha/build-push-notify@v3.9.3 with: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - HARBOR_URL: ${{ secrets.HARBOR_URL }} - DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} - DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} - profile: seraing - tags: | - "imiobe/iadelib:seraing-${{ github.ref_name }}" - "${{ secrets.HARBOR_URL }}/delib/iadelib:seraing-${{ github.ref_name }}" + IMAGE_NAME: ${{ env.IMAGE_NAME }} + IMAGE_TAGS: | + ${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:seraing-${{ github.ref_name }} + REGISTRY_URL: ${{ secrets.HARBOR_URL }} + REGISTRY_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }} + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + DOCKERFILE: './docker/Dockerfile-latest' + BUILD_ARGS: 'PROFILE=seraing.cfg'