mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-22 20:41:40 +02:00
Add Release action for cc-backend
This commit is contained in:
17
build/package/cc-backend.config
Normal file
17
build/package/cc-backend.config
Normal file
@@ -0,0 +1,17 @@
|
||||
CC_USER=clustercockpit
|
||||
|
||||
CC_GROUP=clustercockpit
|
||||
|
||||
CC_HOME=/tmp
|
||||
|
||||
LOG_DIR=/var/log
|
||||
|
||||
DATA_DIR=/var/run/cc-backend
|
||||
|
||||
MAX_OPEN_FILES=10000
|
||||
|
||||
CONF_DIR=/etc/cc-backend
|
||||
|
||||
CONF_FILE=/etc/cc-backend/cc-backend.json
|
||||
|
||||
RESTART_ON_UPGRADE=true
|
12
build/package/cc-backend.deb.control
Normal file
12
build/package/cc-backend.deb.control
Normal file
@@ -0,0 +1,12 @@
|
||||
Package: cc-backend
|
||||
Version: {VERSION}
|
||||
Installed-Size: {INSTALLED_SIZE}
|
||||
Architecture: {ARCH}
|
||||
Maintainer: thomas.gruber@fau.de
|
||||
Depends: libc6 (>= 2.2.1)
|
||||
Build-Depends: debhelper-compat (= 13), git, golang-go, npm, yarn
|
||||
Description: ClusterCockpit backend and web frontend
|
||||
Homepage: https://github.com/ClusterCockpit/cc-backend
|
||||
Source: cc-backend
|
||||
Rules-Requires-Root: no
|
||||
|
18
build/package/cc-backend.service
Normal file
18
build/package/cc-backend.service
Normal file
@@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=ClusterCockpit backend and web frontend (cc-backend)
|
||||
Documentation=https://github.com/ClusterCockpit/cc-backend
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/default/cc-backend
|
||||
Type=simple
|
||||
User=clustercockpit
|
||||
Group=clustercockpit
|
||||
Restart=on-failure
|
||||
TimeoutStopSec=100
|
||||
LimitNOFILE=infinity
|
||||
ExecStart=/usr/bin/cc-backend --config ${CONF_FILE}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
70
build/package/cc-backend.spec
Normal file
70
build/package/cc-backend.spec
Normal file
@@ -0,0 +1,70 @@
|
||||
Name: cc-backend
|
||||
Version: %{VERS}
|
||||
Release: 1%{?dist}
|
||||
Summary: ClusterCockpit backend and web frontend
|
||||
|
||||
License: MIT
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
#BuildRequires: go-toolset
|
||||
#BuildRequires: systemd-rpm-macros
|
||||
#BuildRequires: npm
|
||||
|
||||
Provides: %{name} = %{version}
|
||||
|
||||
%description
|
||||
ClusterCockpit backend and web frontend
|
||||
|
||||
%global debug_package %{nil}
|
||||
|
||||
%prep
|
||||
%autosetup
|
||||
|
||||
|
||||
%build
|
||||
#CURRENT_TIME=$(date +%Y-%m-%d:T%H:%M:\%S)
|
||||
#LD_FLAGS="-s -X main.buildTime=${CURRENT_TIME} -X main.version=%{VERS}"
|
||||
mkdir ./var
|
||||
touch ./var/job.db
|
||||
cd web/frontend && yarn install && yarn build && cd -
|
||||
go build -ldflags="-s -X main.version=%{VERS}" ./cmd/cc-backend
|
||||
|
||||
|
||||
%install
|
||||
# Install cc-backend
|
||||
#make PREFIX=%{buildroot} install
|
||||
install -Dpm 755 cc-backend %{buildroot}/%{_bindir}/%{name}
|
||||
install -Dpm 0600 configs/config.json %{buildroot}%{_sysconfdir}/%{name}/%{name}.json
|
||||
# Integrate into system
|
||||
install -Dpm 0644 build/package/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
|
||||
install -Dpm 0600 build/package/%{name}.config %{buildroot}%{_sysconfdir}/default/%{name}
|
||||
install -Dpm 0644 build/package/%{name}.sysusers %{buildroot}%{_sysusersdir}/%{name}.conf
|
||||
|
||||
|
||||
%check
|
||||
# go test should be here... :)
|
||||
|
||||
%pre
|
||||
%sysusers_create_package scripts/%{name}.sysusers
|
||||
|
||||
%post
|
||||
%systemd_post %{name}.service
|
||||
|
||||
%preun
|
||||
%systemd_preun %{name}.service
|
||||
|
||||
%files
|
||||
# Binary
|
||||
%attr(-,clustercockpit,clustercockpit) %{_bindir}/%{name}
|
||||
# Config
|
||||
%dir %{_sysconfdir}/%{name}
|
||||
%attr(0600,clustercockpit,clustercockpit) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.json
|
||||
# Systemd
|
||||
%{_unitdir}/%{name}.service
|
||||
%{_sysconfdir}/default/%{name}
|
||||
%{_sysusersdir}/%{name}.conf
|
||||
|
||||
%changelog
|
||||
* Mon Mar 07 2022 Thomas Gruber - 0.1
|
||||
- Initial metric store implementation
|
||||
|
2
build/package/cc-backend.sysusers
Normal file
2
build/package/cc-backend.sysusers
Normal file
@@ -0,0 +1,2 @@
|
||||
#Type Name ID GECOS Home directory Shell
|
||||
u clustercockpit - "User for ClusterCockpit" /run/cc-backend /sbin/nologin
|
Reference in New Issue
Block a user