Skip to content

Commit

Permalink
fix: Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukanoksuz committed Nov 20, 2023
1 parent 14e3ef9 commit d994a23
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ coverage
.next/
out/
dist/
build

# misc
.DS_Store
Expand Down
8 changes: 8 additions & 0 deletions build/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Package: liman-website
Version: %VERSION%
Section: utils
Architecture: amd64
Priority: optional
Maintainer: Doğukan Öksüz <me@dogukan.dev>
Description: Liman Website Service
Depends: nodejs
36 changes: 36 additions & 0 deletions build/debian/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

if [ ! -d "/liman/website" ]; then
mkdir -p /liman/website
fi

chmod -R 770 /liman/website
chown -R root:root /liman/website

if [ -f "/usr/lib/systemd/system/liman-website.service" ]; then
rm -rf /usr/lib/systemd/system/liman-website.service 2>/dev/null || true
systemctl disable liman-website.service 2>/dev/null || true
systemctl stop liman-website.service 2>/dev/null || true
systemctl daemon-reload 2>/dev/null || true
fi

echo """
[Unit]
Description=Liman Website Service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=liman
WorkingDirectory=/liman/website
ExecStart=/usr/bin/node server.js
[Install]
WantedBy=multi-user.target
""" > /usr/lib/systemd/system/liman-website.service

systemctl daemon-reload
systemctl enable liman-website.service
systemctl restart liman-website.service
62 changes: 62 additions & 0 deletions build/rhel/website.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Name: liman-website
Version: %VERSION%
Release: 0
License: MIT
Prefix: /liman/website
Summary: Liman Website Service
Group: Applications/System
BuildArch: x86_64
Depends: nodejs

%description
Liman Website Service

%pre

%prep

%build

%install
cp -rfa %{_app_dir} %{buildroot}

%post -p /bin/bash
chmod -R 770 /liman/website
chown -R root:root /liman/website

if [ -f "/usr/lib/systemd/system/liman-website.service" ]; then
rm -rf /usr/lib/systemd/system/liman-website.service 2>/dev/null || true
systemctl disable liman-website.service 2>/dev/null || true
systemctl stop liman-website.service 2>/dev/null || true
systemctl daemon-reload 2>/dev/null || true
fi

echo """
[Unit]
Description=Liman Website Service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=liman
WorkingDirectory=/liman/website
ExecStart=/usr/bin/node server.js

[Install]
WantedBy=multi-user.target
""" > /usr/lib/systemd/system/liman-website.service

systemctl daemon-reload
systemctl enable liman-website.service
systemctl restart liman-website.service

%clean

%files
%defattr(0770, root, root)
/liman/website/*
/liman/website/.env.example

%define _unpackaged_files_terminate_build 0

0 comments on commit d994a23

Please sign in to comment.