Browse Source

build debian package

tags/version-1.0
Vladimir Smagin 3 months ago
parent
commit
592ea1cadc
4 changed files with 52 additions and 0 deletions
  1. 1
    0
      .gitignore
  2. 23
    0
      build.sh
  3. 10
    0
      debian/DEBIAN/control
  4. 18
    0
      debian/etc/systemd/system/gogocron.service

+ 1
- 0
.gitignore View File

@@ -1 +1,2 @@
1 1
 gogocron
2
+*.deb

+ 23
- 0
build.sh View File

@@ -0,0 +1,23 @@
1
+#!/bin/bash
2
+
3
+VERSION="1.0"
4
+
5
+# build gogocron
6
+go build
7
+
8
+# prepage control file
9
+
10
+sed -i "s/Version.*/Version: ${VERSION}/" ./debian/DEBIAN/control
11
+
12
+# copy files to deb package structure
13
+mkdir -p ./debian/etc/gogocron
14
+mkdir -p ./debian/usr/bin
15
+mkdir -p ./debian/usr/share/gogocron/samples/
16
+mkdir -p ./debian/DEBIAN
17
+
18
+cp gogocron ./debian/usr/bin/
19
+cp configs/*.yml ./debian/usr/share/gogocron/samples/
20
+
21
+# build deb package
22
+dpkg-deb --build debian gogocron-${VERSION}.deb
23
+

+ 10
- 0
debian/DEBIAN/control View File

@@ -0,0 +1,10 @@
1
+Package: gogocron
2
+Version: 1.0
3
+Section: base
4
+Priority: optional
5
+Architecture: all
6
+Depends: coreutils (>= 5.0-5)
7
+Maintainer: Vladimir Smagin <21h@blindage.org>
8
+Description: Linux cron daemon with 1 second minimal interval
9
+ This package provides gogocron daemon, that can run tasks with 1s
10
+ minimal interval and execution timeout.

+ 18
- 0
debian/etc/systemd/system/gogocron.service View File

@@ -0,0 +1,18 @@
1
+[Unit]
2
+Description=gogocron daemon
3
+
4
+[Service]
5
+Type=simple
6
+User=root
7
+Group=root
8
+Environment='LC_ALL=en_US.UTF8'
9
+
10
+WorkingDirectory=/etc/gogocron
11
+ExecStart=/usr/bin/gogocron
12
+
13
+# Add pause to limit respawns rate
14
+RestartSec=10
15
+Restart=always
16
+
17
+[Install]
18
+WantedBy=multi-user.target

Loading…
Cancel
Save