|
10 | 10 | - Makefile
|
11 | 11 | - plugins.mk
|
12 | 12 | - rabbitmq-components.mk
|
| 13 | + - .github/workflows/oci.yaml |
13 | 14 | env:
|
14 | 15 | GENERIC_UNIX_ARCHIVE: ${{ github.workspace }}/PACKAGES/rabbitmq-server-generic-unix-${{ github.sha }}.tar.xz
|
15 | 16 | RABBITMQ_VERSION: ${{ github.sha }}
|
16 | 17 | VERSION: ${{ github.sha }}
|
17 | 18 | jobs:
|
| 19 | + |
| 20 | + # This job will build one docker image per supported Erlang major version. |
| 21 | + # Each image will have two tags (one containing the Git commit SHA, one containing the branch name). |
| 22 | + # |
| 23 | + # For example, for Git commit SHA '1111aaa' and branch name 'main' and maximum supported Erlang major version '25', |
| 24 | + # the following 3 images and 6 tags will be pushed to Dockerhub: |
| 25 | + # |
| 26 | + # * 1111aaa-otp-max (image OTP 25) |
| 27 | + # * main-otp-max (image OTP 25) |
| 28 | + # * 1111aaa-otp-max-1 (image OTP 24) |
| 29 | + # * main-otp-max-1 (image OTP 24) |
| 30 | + # * 1111aaa-otp-max-2 (image OTP 23) |
| 31 | + # * main-otp-max-2 (image OTP 23) |
| 32 | + |
18 | 33 | build-publish-dev:
|
19 | 34 | runs-on: ubuntu-latest
|
| 35 | + strategy: |
| 36 | + matrix: |
| 37 | + # Build image for every supported Erlang major version. |
| 38 | + # Source of truth for released versions: https://www.rabbitmq.com/which-erlang.html |
| 39 | + # For Elixir: https://github.com/rabbitmq/rabbitmq-server/blob/master/deps/rabbitmq_cli/mix.exs#L14 |
| 40 | + # As of June 2021: |
| 41 | + otp: ['24.0.2', '23.2.1'] |
| 42 | + include: |
| 43 | + - otp: '24.0.2' |
| 44 | + otp_sha256: 4abca2cda7fc962ad65575e5ed834dd69c745e7e637f92cfd49f384a281d0f18 |
| 45 | + elixir: '1.12.1' |
| 46 | + image_tag_suffix: '-otp-max' |
| 47 | + - otp: '23.2.1' |
| 48 | + otp_sha256: e7034e2cfe50d7570ac8f70ea7ba69ea013f10863043e25132f0a5d3d0d8d3a7 |
| 49 | + elixir: '1.11.4' |
| 50 | + image_tag_suffix: '-otp-max-1' |
| 51 | + env: |
| 52 | + IMAGE_TAG_1: ${{ github.sha }}${{ matrix.image_tag_suffix }} |
20 | 53 | steps:
|
21 | 54 | - name: Checkout
|
22 | 55 | uses: actions/checkout@v2
|
23 | 56 |
|
24 |
| - # RabbitMQ master supports Erlang 24 (correct at June 2021) |
25 |
| - # Source of truth for released versions: https://www.rabbitmq.com/which-erlang.html |
26 |
| - # |
27 |
| - # For Elixir: https://github.com/rabbitmq/rabbitmq-server/blob/master/deps/rabbitmq_cli/mix.exs#L14 |
28 |
| - - name: Set up max supported Erlang & Elixir |
| 57 | + - name: Set up Erlang & Elixir |
29 | 58 | uses: erlef/setup-beam@v1.7
|
30 | 59 | with:
|
31 |
| - otp-version: '24.0.2' |
32 |
| - elixir-version: '1.12.1' |
| 60 | + otp-version: ${{ matrix.otp }} |
| 61 | + elixir-version: ${{ matrix.elixir }} |
33 | 62 |
|
34 | 63 | - name: Build generic unix package
|
35 | 64 | run: |
|
36 | 65 | make package-generic-unix PROJECT_VERSION=${GITHUB_SHA}
|
37 | 66 |
|
38 | 67 | - name: Build container image
|
39 | 68 | working-directory: packaging/docker-image
|
40 |
| - run: >- |
41 |
| - make dist |
42 |
| - IMAGE_TAG=${GITHUB_REF##*/} |
43 |
| - SKIP_PGP_VERIFY=true |
44 |
| - OTP_VERSION=24.0.2 |
45 |
| - OTP_SHA256=4abca2cda7fc962ad65575e5ed834dd69c745e7e637f92cfd49f384a281d0f18 |
| 69 | + env: |
| 70 | + OTP_VERSION: ${{ matrix.otp }} |
| 71 | + OTP_SHA256: ${{ matrix.otp_sha256 }} |
| 72 | + run: | |
| 73 | + make dist SKIP_PGP_VERIFY=true |
46 | 74 |
|
47 | 75 | - name: Login to DockerHub
|
48 | 76 | working-directory: packaging/docker-image
|
|
51 | 79 | --username '${{ secrets.DOCKERHUB_USERNAME }}' \
|
52 | 80 | --password '${{ secrets.DOCKERHUB_PASSWORD }}'
|
53 | 81 |
|
| 82 | + # Push the same image with two different tags: |
| 83 | + # 1. <git_commit_sha>-otp-max[-1|-2] |
| 84 | + # 2. <branch_name>-otp-max[-1|-2] |
54 | 85 | - name: Push container image to DockerHub
|
55 | 86 | working-directory: packaging/docker-image
|
| 87 | + env: |
| 88 | + IMAGE_TAG_SUFFIX: ${{ matrix.image_tag_suffix }} |
56 | 89 | run: |
|
57 |
| - make push |
| 90 | + make push IMAGE_TAG_2=${GITHUB_REF##*/}${IMAGE_TAG_SUFFIX} |
0 commit comments