Skip to content

Commit

Permalink
Adding VersionStream for rabbitmq-server-4.0 (#29042)
Browse files Browse the repository at this point in the history
Co-authored-by: octo-sts[bot] <[email protected]>
  • Loading branch information
octo-sts[bot] and octo-sts[bot] authored Sep 20, 2024
1 parent 2a87a07 commit 29468e0
Showing 1 changed file with 142 additions and 0 deletions.
142 changes: 142 additions & 0 deletions rabbitmq-server-4.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
package:
name: rabbitmq-server-4.0
version: 4.0.1
epoch: 0
description: Open source RabbitMQ. core server and tier 1 (built-in) plugins
copyright:
- license: MPL-2.0
dependencies:
provides:
- rabbitmq-server=${{package.full-version}}
runtime:
# rabbitmq-server is a wrapper shell script.
- busybox
- erlang-26

environment:
contents:
packages:
- autoconf
- automake
- build-base
- busybox
- ca-certificates-bundle
- elixir
# pinning to version 26 for now as erlang-27 is causing performance issues according to upstream. https://www.rabbitmq.com/docs/which-erlang#erlang-27-support
- erlang-26
- erlang-26-dev
- libxslt
- python3
- rsync
environment:
# suppresses this message: "the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell) or set the ELIXIR_ERL_OPTIONS="+fnu" environment variable"
ELIXIR_ERL_OPTIONS: "+fnu"

pipeline:
- uses: fetch
with:
expected-sha256: 0dbc3d4ad97ee59e560fef2b9ac76cd3b418c3a14321797aa9b7d2ca91c86547
uri: https://github.com/rabbitmq/rabbitmq-server/releases/download/v${{package.version}}/rabbitmq-server-${{package.version}}.tar.xz

- uses: autoconf/make

- runs: |
make install install-bin install-man \
DESTDIR="${{targets.contextdir}}" \
PREFIX=/usr \
RMQ_ROOTDIR="/usr/lib/rabbitmq" \
MANDIR=/usr/share/man \
PYTHON=python3
# Copy all necessary lib files etc.
install -p -m755 -D ./scripts/rabbitmq-server.ocf \
"${{targets.contextdir}}"/usr/lib/ocf/resource.d/rabbitmq/rabbitmq-server
mkdir -p "${{targets.contextdir}}"/usr/sbin
# Taken from the Alpine package, which borrowed from the Rabbitmq build steps.
sed -e 's|@SU_RABBITMQ_SH_C@|su rabbitmq -s /bin/sh -c|' \
< ./scripts/rabbitmq-script-wrapper \
> "${{targets.contextdir}}"/usr/sbin/rabbitmqctl
chmod 0755 "${{targets.contextdir}}"/usr/sbin/rabbitmqctl
for script in rabbitmq-server rabbitmq-plugins rabbitmq-upgrade; do
cp -a "${{targets.contextdir}}"/usr/sbin/rabbitmqctl \
"${{targets.contextdir}}"/usr/sbin/$script;
done
mkdir -p "${{targets.contextdir}}"/usr/share/doc/"${{package.name}}"
cp -a ./LICENSE* "${{targets.contextdir}}"/usr/share/doc/"${{package.name}}"/
cp -a ./deps/rabbit/docs/* "${{targets.contextdir}}"/usr/share/doc/"${{package.name}}"/
cp -a ./deps/rabbitmq_sharding/docs/* "${{targets.contextdir}}"/usr/share/doc/"${{package.name}}"/
mkdir -p ${{targets.contextdir}}/root
ln -sf /var/lib/rabbitmq/.erlang.cookie ${{targets.contextdir}}/root/.erlang.cookie
- uses: strip

subpackages:
- name: ${{package.name}}-doc
description: "rabbitmq documentation"
pipeline:
- uses: split/manpages
dependencies:
provides:
- rabbitmq-server-doc=${{package.full-version}}

- name: ${{package.name}}-bitnami-compat
description: Compat package for the Bitnami Rabbitmq Helm chart
pipeline:
- uses: bitnami/compat
with:
image: rabbitmq
version-path: 3.13/debian-12
- runs: |
mkdir -p ${{targets.contextdir}}/opt/bitnami/rabbitmq
ln -sf /usr/lib/rabbitmq/lib/rabbitmq_server-${{package.version}}/plugins ${{targets.contextdir}}/opt/bitnami/rabbitmq/
ln -sf /usr/lib/rabbitmq/lib/rabbitmq_server-${{package.version}}/escript ${{targets.contextdir}}/opt/bitnami/rabbitmq/
ln -sf /usr/lib/rabbitmq/lib/rabbitmq_server-${{package.version}}/sbin ${{targets.contextdir}}/opt/bitnami/rabbitmq/
# this is where the helm chart creates a PV
mkdir -p ${{targets.contextdir}}/opt/bitnami/rabbitmq/.rabbitmq
mkdir -p ${{targets.contextdir}}/opt/bitnami/rabbitmq/etc/rabbitmq
mkdir -p ${{targets.contextdir}}/opt/bitnami/rabbitmq/etc/rabbitmq.default
mkdir -p ${{targets.contextdir}}/opt/bitnami/rabbitmq/var/log/rabbitmq
mkdir -p ${{targets.contextdir}}/opt/bitnami/rabbitmq/var/lib/rabbitmq
mkdir -p ${{targets.contextdir}}/opt/bitnami/scripts/rabbitmq
mkdir -p ${{targets.contextdir}}/opt/bitnami/erlang/lib
ln -sf /usr/lib/erlang ${{targets.contextdir}}/opt/bitnami/erlang/lib/erlang
mkdir -p ${{targets.contextdir}}/opt/bitnami/erlang/bin
ln -sf /usr/lib/erlang/bin/* ${{targets.contextdir}}/opt/bitnami/erlang/bin/
# Use package path while unpacking
find . -iname "*.sh" -exec sed 's#/opt/bitnami#${{targets.contextdir}}/opt/bitnami#g' -i {} \;
${{targets.contextdir}}/opt/bitnami/scripts/rabbitmq/postunpack.sh || true
# Restore path
find ${{targets.contextdir}}/opt/bitnami -type f -exec sed 's#${{targets.contextdir}}##g' -i {} \;
mkdir -p ${{targets.contextdir}}/bitnami/rabbitmq
ln -sf /var/lib/rabbitmq/mnesia ${{targets.contextdir}}/bitnami/rabbitmq/
mkdir -p ${{targets.contextdir}}/var/log
ln -sf /opt/bitnami/rabbitmq/var/log/rabbitmq ${{targets.contextdir}}/var/log/rabbitmq
mkdir -p ${{targets.contextdir}}/var/lib
ln -sf /opt/bitnami/rabbitmq/.rabbitmq ${{targets.contextdir}}/var/lib/rabbitmq
mkdir -p ${{targets.contextdir}}/etc/
ln -sf /opt/bitnami/rabbitmq/etc/rabbitmq ${{targets.contextdir}}/etc/
dependencies:
provides:
- rabbitmq-server-bitnami-compat=${{package.full-version}}

update:
enabled: true
github:
identifier: rabbitmq/rabbitmq-server
strip-prefix: v
tag-filter-prefix: v4.0.

test:
pipeline:
# AUTOGENERATED
- runs: |
rabbitmq-plugins version

0 comments on commit 29468e0

Please sign in to comment.