Skip to content

Commit

Permalink
Work around missing bazel features for rabbitmq docker build
Browse files Browse the repository at this point in the history
Until
bazelbuild/bazel#17128 (comment)
is implemented, there is no clean way to override an erlang
package. So at least let's try doing our best, and just check
afterwards that it actually worked.
  • Loading branch information
binarin committed Apr 19, 2023
1 parent ad5adf7 commit 7a900a9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/rabbitmq-oci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,20 @@ jobs:
working-directory: rabbitmq-server
run: |
sed -i"_orig" -E '/APP_VERSION/ s/3\.[0-9]+\.[0-9]+/${{ steps.load-rabbitmq-info.outputs.RABBITMQ_SHA }}/' rabbitmq.bzl
RULES_ERLANG_VERSION=$(bazel query --output=build //external:rules_erlang | sed -r -n 's/^.*tag = "(.*)".*$/\1/p')
bazelisk build :package-generic-unix \
--config=rbe-${{ matrix.otp_major }} \
--override_repository rules_erlang~3.9.9~erlang_package~osiris=${{ github.workspace }}/osiris
--override_repository rules_erlang~$RULES_ERLANG_VERSION~erlang_package~osiris=${{ github.workspace }}/osiris
# rules_erlang version detection is not bullet-proof, so let's check that override did indeed work
set -o pipefail
if ! tar --list -f ./bazel-bin/package-generic-unix.tar.xz | grep -F "plugins/osiris-${{ github.event.pull_request.head.sha || github.sha }}/ebin/osiris.app" ; then
echo "Failed to override osiris repo"
echo "Inferred repo name: rules_erlang~$RULES_ERLANG_VERSION~erlang_package~osiris"
echo "Repo name as seen after build:"
ls bazel-bin/external/ | grep osiris
exit 1
fi
- name: Resolve generic unix package path
run: |
Expand Down

0 comments on commit 7a900a9

Please sign in to comment.