Browse Source

abstruce update for systemd

Signed-off-by: pipelinebuilder_pel7ppc64lebuilder0 <pipelinebuilder@powerel.org>
master
pipelinebuilder_pel7ppc64lebuilder0 3 years ago
parent
commit
e728086282
  1. 64
      SPECS/abstruse.spec

64
SPECS/abstruse.spec

@ -2,6 +2,13 @@ Name: abstruse @@ -2,6 +2,13 @@ Name: abstruse
Version: 2.0.0
Release: 1%{?dist}
Source0: https://github.com/bleenco/abstruse/archive/refs/tags/v%{version}.tar.gz
Source1: abstruse-server.service
Source2: abstruse-server.env
Source3: abstruse-worker.service
Source4: abstruse-worker.env
Source5: abstruse-worker@.service
Patch0: abstruse-protoc-import.patch
Patch1: abstruse-postgres-ssl.patch
Summary: Abstruse is a free and open-source CI/CD platform that tests your models and code.
Group: System/Pipeline
License: MIT
@ -13,11 +20,24 @@ BuildRequires: golang @@ -13,11 +20,24 @@ BuildRequires: golang
%description


%package server
Summary: Abstruse Server
%description server


%package worker
Summary: Abstruse Worker
%description worker


%prep
%setup -q -c %{name}-%{version}
mkdir -p src/github.com/bleenco/
tar xvf %{SOURCE0}
mv abstruse-%{version} src/github.com/bleenco/abstruse/
#cd src/github.com/bleenco/abstruse/
%patch0 -p0
%patch1 -p0


%build
@ -37,22 +57,56 @@ yarnpkg add ng @@ -37,22 +57,56 @@ yarnpkg add ng
yarnpkg install
yarnpkg build
popd
#protoc -I${GOPATH}/src/github.com/bleenco/abstruse/ -I. ./pb/api.proto --go_out=plugins=grpc:./pb/
#protoc ./pb/api.proto --proto_path=`pwd`:${GOPATH}/src/github.com/bleenco/abstruse/:. --go_out=plugins=grpc:./pb/
protoc ./ --proto_path=`pwd`/pb/ --go_out=plugins=grpc:./pb/
$GOPATH/bin/wire ./server/cmd/... ./worker/cmd/...
$GOPATH/bin/statik -dest ./server -p ui -src ./web/abstruse/dist
$GOPATH/bin/wire ./server/cmd/... ./worker/cmd/...
protoc ./pb/api.proto --go_out=plugins=grpc:./pb/
go build -v -gcflags=all="-N -l" -ldflags "-X ${ABSTRUSE_VERSION_PATH}.GitCommit=${GIT_COMMIT} -X ${ABSTRUSE_VERSION_PATH}.UIVersion=%{version} -X ${ABSTRUSE_VERSION_PATH}.BuildDate=${BUILD_DATE} -extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -o build/abstruse-server ./cmd/abstruse-server
go build -v -gcflags=all="-N -l" -ldflags "-X ${ABSTRUSE_VERSION_PATH}.GitCommit=${GIT_COMMIT} -X ${ABSTRUSE_VERSION_PATH}.UIVersion=%{version} -X ${ABSTRUSE_VERSION_PATH}.BuildDate=${BUILD_DATE} -extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -o build/abstruse-worker ./cmd/abstruse-worker


%install
mkdir -p %{buildroot}%{_bindir}
cp src/github.com/bleenco/abstruse/build/abstruse-server %{buildroot}%{_bindir}
cp src/github.com/bleenco/abstruse/build/abstruse-worker %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_unitdir}
cp %{SOURCE1} %{buildroot}%{_unitdir}/
cp %{SOURCE3} %{buildroot}%{_unitdir}/
cp %{SOURCE5} %{buildroot}%{_unitdir}/
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
cp %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}/server
cp %{SOURCE4} %{buildroot}%{_sysconfdir}/%{name}/worker


%post server
%systemd_post abstruse-server.service
%preun server
%systemd_preun abstruse-server.service
%postun server
%systemd_postun abstruse-server.service


%post worker
%systemd_post abstruse-worker.service
%postun worker
%systemd_postun abstruse-worker.service
%preun worker
%systemd_preun abstruse-worker.service


%files


%files server
%config(noreplace) %{_sysconfdir}/%{name}/server
%{_bindir}/abstruse-server
%{_bindir}/abstruse-worker
%{_unitdir}/abstruse-server.service


%files worker
%config(noreplace) %{_sysconfdir}/%{name}/worker
%{_bindir}/abstruse-worker
%{_unitdir}/abstruse-worker.service
%{_unitdir}/abstruse-worker@.service


%changelog

Loading…
Cancel
Save