forked from adamm/autogits
Build binaries that depend on mocks. Build some binaries that where added since and add sub-package for them. Run go test where they exist.
241 lines
7.0 KiB
RPMSpec
241 lines
7.0 KiB
RPMSpec
#
|
|
# 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
|
|
Release: 0
|
|
Summary: GitWorkflow utilities
|
|
License: GPL-2.0-or-later
|
|
URL: https://src.opensuse.org/adamm/autogits
|
|
BuildRequires: git
|
|
BuildRequires: systemd-rpm-macros
|
|
BuildRequires: go
|
|
%{?systemd_ordering}
|
|
|
|
%description
|
|
Git Workflow tooling and utilities enabling automated handing of OBS projects
|
|
as git repositories
|
|
|
|
|
|
%package -n autogits-devel-importer
|
|
Summary: Imports devel projects from obs to git
|
|
|
|
%description -n autogits-devel-importer
|
|
Command-line tool to import devel projects from obs to git
|
|
|
|
|
|
%package -n autogits-doc
|
|
Summary: Common documentation files
|
|
|
|
%description -n autogits-doc
|
|
Common documentation files
|
|
|
|
|
|
%package -n autogits-hujson
|
|
Summary: HuJSON to JSON parser
|
|
|
|
%description -n autogits-hujson
|
|
HuJSON to JSON parser, using stdin -> stdout pipe
|
|
|
|
|
|
%package -n autogits-gitea-events-rabbitmq-publisher
|
|
Summary: Publishes Gitea webhook data via RabbitMQ
|
|
|
|
%description -n autogits-gitea-events-rabbitmq-publisher
|
|
Listens on an HTTP socket and publishes Gitea events on a RabbitMQ instance
|
|
with a topic
|
|
<scope>.src.$organization.$webhook_type.[$webhook_action_type]
|
|
|
|
|
|
%package -n autogits-gitea-status-proxy
|
|
Summary: gitea-status-proxy
|
|
|
|
%description -n autogits-gitea-status-proxy
|
|
|
|
|
|
%package -n autogits-group-review
|
|
Summary: Reviews of groups defined in ProjectGit
|
|
|
|
%description -n autogits-group-review
|
|
Is used to handle reviews associated with groups defined in the
|
|
ProjectGit.
|
|
|
|
|
|
%package -n autogits-obs-forward-bot
|
|
Summary: obs-forward-bot
|
|
|
|
%description -n autogits-obs-forward-bot
|
|
|
|
|
|
%package -n autogits-obs-staging-bot
|
|
Summary: Build a PR against a ProjectGit, if review is requested
|
|
|
|
%description -n autogits-obs-staging-bot
|
|
Build a PR against a ProjectGit, if review is requested.
|
|
|
|
|
|
%package -n autogits-obs-status-service
|
|
Summary: Reports build status of OBS service as an easily to produce SVG
|
|
|
|
%description -n autogits-obs-status-service
|
|
Reports build status of OBS service as an easily to produce SVG
|
|
|
|
|
|
%package -n autogits-workflow-direct
|
|
Summary: Keep ProjectGit in sync for a devel project
|
|
Requires: openssh-clients
|
|
Requires: git-core
|
|
|
|
%description -n autogits-workflow-direct
|
|
Keep ProjectGit in sync with packages in the organization of a devel project
|
|
|
|
|
|
%package -n autogits-workflow-pr
|
|
Summary: Keeps ProjectGit PR in-sync with a PackageGit PR
|
|
Requires: openssh-clients
|
|
Requires: git-core
|
|
|
|
%description -n autogits-workflow-pr
|
|
Keeps ProjectGit PR in-sync with a PackageGit PR
|
|
|
|
|
|
|
|
%prep
|
|
cp -r /home/abuild/rpmbuild/SOURCES/* ./
|
|
|
|
%build
|
|
go build \
|
|
-C devel-importer \
|
|
-buildmode=pie
|
|
go build \
|
|
-C hujson \
|
|
-buildmode=pie
|
|
go build \
|
|
-C gitea-events-rabbitmq-publisher \
|
|
-buildmode=pie
|
|
go build \
|
|
-C gitea_status_proxy \
|
|
-buildmode=pie
|
|
go build \
|
|
-C group-review \
|
|
-buildmode=pie
|
|
go build \
|
|
-C obs-forward-bot \
|
|
-buildmode=pie
|
|
go build \
|
|
-C obs-staging-bot \
|
|
-buildmode=pie
|
|
go build \
|
|
-C obs-status-service \
|
|
-buildmode=pie
|
|
go build \
|
|
-C workflow-direct \
|
|
-buildmode=pie
|
|
go build \
|
|
-C workflow-pr \
|
|
-buildmode=pie
|
|
|
|
%check
|
|
# TODO currently needs the source git history, maybe rewrite to create a git repo in the test?
|
|
#go test -C common
|
|
go test -C group-review
|
|
go test -C obs-staging-bot
|
|
go test -C obs-status-service
|
|
go test -C workflow-direct
|
|
# TODO build fails
|
|
#go test -C workflow-pr
|
|
|
|
%install
|
|
install -D -m0755 devel-importer/devel-importer %{buildroot}%{_bindir}/devel-importer
|
|
install -D -m0755 gitea-events-rabbitmq-publisher/gitea-events-rabbitmq-publisher %{buildroot}%{_bindir}/gitea-events-rabbitmq-publisher
|
|
install -D -m0644 systemd/gitea-events-rabbitmq-publisher.service %{buildroot}%{_unitdir}/gitea-events-rabbitmq-publisher.service
|
|
install -D -m0755 gitea_status_proxy/gitea_status_proxy %{buildroot}%{_bindir}/gitea_status_proxy
|
|
install -D -m0755 group-review/group-review %{buildroot}%{_bindir}/group-review
|
|
install -D -m0755 obs-forward-bot/obs-forward-bot %{buildroot}%{_bindir}/obs-forward-bot
|
|
install -D -m0755 obs-staging-bot/obs-staging-bot %{buildroot}%{_bindir}/obs-staging-bot
|
|
install -D -m0755 obs-status-service/obs-status-service %{buildroot}%{_bindir}/obs-status-service
|
|
install -D -m0755 workflow-direct/workflow-direct %{buildroot}%{_bindir}/workflow-direct
|
|
install -D -m0755 workflow-pr/workflow-pr %{buildroot}%{_bindir}/workflow-pr
|
|
install -D -m0755 hujson/hujson %{buildroot}%{_bindir}/hujson
|
|
|
|
%pre -n autogits-gitea-events-rabbitmq-publisher
|
|
%service_add_pre gitea-events-rabbitmq-publisher.service
|
|
|
|
%post -n autogits-gitea-events-rabbitmq-publisher
|
|
%service_add_post gitea-events-rabbitmq-publisher.service
|
|
|
|
%preun -n autogits-gitea-events-rabbitmq-publisher
|
|
%service_del_preun gitea-events-rabbitmq-publisher.service
|
|
|
|
%postun -n autogits-gitea-events-rabbitmq-publisher
|
|
%service_del_postun gitea-events-rabbitmq-publisher.service
|
|
|
|
%files -n autogits-devel-importer
|
|
%license COPYING
|
|
%doc devel-importer/README.md
|
|
%{_bindir}/devel-importer
|
|
|
|
%files -n autogits-hujson
|
|
%license COPYING
|
|
%{_bindir}/hujson
|
|
|
|
%files -n autogits-doc
|
|
%license COPYING
|
|
%doc doc/README.md
|
|
%doc doc/workflows.md
|
|
|
|
%files -n autogits-gitea-events-rabbitmq-publisher
|
|
%license COPYING
|
|
%doc gitea-events-rabbitmq-publisher/README.md
|
|
%{_bindir}/gitea-events-rabbitmq-publisher
|
|
%{_unitdir}/gitea-events-rabbitmq-publisher.service
|
|
|
|
%files -n autogits-gitea-status-proxy
|
|
%license COPYING
|
|
%{_bindir}/gitea_status_proxy
|
|
|
|
%files -n autogits-group-review
|
|
%license COPYING
|
|
%doc group-review/README.md
|
|
%{_bindir}/group-review
|
|
|
|
%files -n autogits-obs-forward-bot
|
|
%license COPYING
|
|
%{_bindir}/obs-forward-bot
|
|
|
|
%files -n autogits-obs-staging-bot
|
|
%license COPYING
|
|
%doc obs-staging-bot/README.md
|
|
%{_bindir}/obs-staging-bot
|
|
|
|
%files -n autogits-obs-status-service
|
|
%license COPYING
|
|
%doc obs-status-service/README.md
|
|
%{_bindir}/obs-status-service
|
|
|
|
%files -n autogits-workflow-direct
|
|
%license COPYING
|
|
%doc workflow-direct/README.md
|
|
%{_bindir}/workflow-direct
|
|
|
|
%files -n autogits-workflow-pr
|
|
%license COPYING
|
|
%doc workflow-pr/README.md
|
|
%{_bindir}/workflow-pr
|
|
|