diff --git a/autogits.spec b/autogits.spec new file mode 100644 index 0000000..388e3e4 --- /dev/null +++ b/autogits.spec @@ -0,0 +1,64 @@ +# +# spec file for package autogits +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: autogits +Version: 0.0.1 +Release: 0 +Summary: GitWorkflow utilities +License: GPL-2.0-or-later +URL: https://src.opensuse.org/adamm/autogits/ +Source: https://src.opensuse.org/adamm/autogits/0.0.1.tar.gz +Source1: vendor.tar.zst +BuildRequires: golang-packaging +BuildRequires: systemd-rpm-macros +BuildRequires: zstd +%{?systemd_ordering} + +%description +Git Workflow tooling and utilities enabling automated handing of OBS projects +as git repositories + +%package -n gitea-events-rabbitmq-publisher +Summary: Publishes Gitea webhook data via RabbitMQ + +%description -n gitea-events-rabbitmq-publisher +Listens on an HTTP socket and publishes Gitea events on a RabbitMQ instance +with a topic + .src.$organization.$webhook_type.[$webhook_action_type] + +%prep +%autosetup -p1 + +%build +go build \ + -C gitea-events-rabbitmq-publisher \ + -mod=vendor \ + -buildmode=pie + +%install +install -D -m0755 gitea-events-rabbitmq-publisher/gitea-events-rabbitmq-publisher %{buildroot}%{_bindir} +install -D -m0755 systemd/gitea-events-rabbitmq-publisher.service %{buildroot}%{_unitdir} + +%files -n gitea-events-rabbitmq-publisher +%license COPYING +%doc gitea-events-rabbitmq-publisher/README.md +%{_bindir}/gitea-events-rabbitmq-publisher +%{_unitdir}/gitea-events-rabbitmq-publisher.service + +%changelog + diff --git a/systemd/gitea-events-rabbitmq-publisher.service b/systemd/gitea-events-rabbitmq-publisher.service new file mode 100644 index 0000000..efd53ec --- /dev/null +++ b/systemd/gitea-events-rabbitmq-publisher.service @@ -0,0 +1,15 @@ +[Unit] +Description=Gitea webhook to RabbitMQ message publisher + +[Service] +Type=exec +ExecStart=/usr/bin/gitea-events-rabbitmq-publisher +EnvironmentFile=-/etc/sysconfig/gitea-events-rabbitmq-publisher.env +DynamicUser=yes +NoNewPrivileges=yes +ProtectSystem=strict + +[Install] +After=network-online.target +WantedBy=multi-user.target +