-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from adjust/github-action-build-deb-package
GitHub workflow: Building deb package on release
- Loading branch information
Showing
13 changed files
with
268 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
name: Build install package | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
LC_ALL: C.UTF-8 | ||
|
||
jobs: | ||
build-deb-gcc: | ||
name: Build (${{ matrix.os }}, ${{ matrix.cc }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: | ||
- ubuntu-20.04 | ||
# # Disable jammy | ||
# - ubuntu-22.04 | ||
cc: | ||
- gcc | ||
# # Disable Clang (enable required: matrix.include.cc: clang) | ||
# - clang | ||
include: | ||
- cc: gcc | ||
LDFLAGS: '' | ||
CFLAGS: '-O2' | ||
# # Disable Clang (enable required: matrix.cc.clang) | ||
# - cc: clang | ||
# # # Disable ASan, incompatible w/ Valgrind test | ||
# # # https://github.com/google/sanitizers/issues/856#issuecomment-924966052 | ||
# # LDFLAGS: '-fsanitize=address -fno-omit-frame-pointer' | ||
# # CFLAGS: '-Og -fsanitize=address -fno-omit-frame-pointer' | ||
# LDFLAGS: '' | ||
# CFLAGS: '-O2' | ||
env: | ||
CC: ${{ matrix.cc }} | ||
LDFLAGS: ${{ matrix.LDFLAGS }} | ||
CFLAGS: ${{ matrix.CFLAGS }} | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Fetch update package information | ||
run: sudo apt-get update --assume-yes | ||
|
||
- name: Install build-essential and tools | ||
run: sudo apt-get install --assume-yes build-essential debhelper dpkg-dev valgrind clang | ||
|
||
- name: Install package dependencies | ||
run: sudo apt-get install --assume-yes libconfig-dev libconfig++-dev libhiredis-dev libjson-c-dev libpq-dev librdkafka-dev | ||
|
||
- name: Run testsuite | ||
run: make test | ||
|
||
- name: Compile and build bianry | ||
run: make | ||
|
||
- name: Build package | ||
run: make package-deb | ||
|
||
- name: Upload package(s) | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Packages | ||
path: | | ||
schaufel_*.buildinfo | ||
schaufel_*.changes | ||
schaufel_*.deb | ||
- name: Release package(s) | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
schaufel_*.buildinfo | ||
schaufel_*.changes | ||
schaufel_*.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
v0.11 | ||
- support for callbacks via metadata (transactional producers) | ||
- full autoconf build system | ||
- full endian.h portability | ||
- full freebsd compatibility | ||
- deprecated hash_r gnuism | ||
- deprecated asprintf gnuism | ||
- various smaller bugfixes | ||
schaufel (0.11) unstable; urgency=low | ||
|
||
* support for callbacks via metadata (transactional producers) (Closes: #97) | ||
* full autoconf build system | ||
* full endian.h portability | ||
* full freebsd compatibility | ||
* deprecated hash_r gnuism (Closes: #108) | ||
* deprecated asprintf gnuism (Closes: #108) | ||
* various smaller bugfixes | ||
|
||
-- Robert Abraham <[email protected]> 31 Aug 2022 09:05:00 +0000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Source: schaufel | ||
Section: admin | ||
Priority: optional | ||
Maintainer: Robert Abraham <[email protected]> | ||
Build-Depends: debhelper (>= 12), | ||
dpkg-dev, | ||
libconfig-dev, | ||
libconfig++-dev, | ||
libhiredis-dev, | ||
libjson-c-dev, | ||
libpq-dev, | ||
librdkafka-dev | ||
Standards-Version: 0.11 | ||
|
||
Package: schaufel | ||
Version: 0.11 | ||
Architecture: any | ||
Multi-Arch: foreign | ||
Pre-Depends: dh-systemd (>= 12), | ||
dpkg | ||
Depends: libconfig9 (>= 1.5~), | ||
libhiredis0.14 (>= 0.14~), | ||
libjson-c4 (>= 0.13~), | ||
libpq5 (>= 12.~), | ||
librdkafka1 (>= 1.2~) | ||
Description: schaufel aims to be a swiss army knife for moving data. | ||
It can take data from list-like sources and insert them into list-like sinks. | ||
In other words, it can take data from a redis list and insert it into kafka or vice versa. | ||
Homepage: https://github.com/adjust/schaufel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
#DEBHELPER# | ||
|
||
PACKAGE_NAME="schaufel" | ||
PACKAGE_UID=997 | ||
PACKAGE_USER="schaufel" | ||
PACKAGE_GID=997 | ||
PACKAGE_GROUP="schaufel" | ||
CONF_DIR="/etc/${PACKAGE_NAME}" | ||
WORK_DIR="/var/lib/${PACKAGE_NAME}" | ||
LOG_DIR="/var/log/${PACKAGE_NAME}" | ||
|
||
## Create group if not exist | ||
if ! getent group | grep --quiet "^${PACKAGE_GROUP}:" ; then | ||
echo -n "Adding system group ${PACKAGE_GROUP} .." | ||
addgroup --quiet --system \ | ||
--gid ${PACKAGE_GID} \ | ||
${PACKAGE_GROUP} 2>/dev/null || true | ||
echo ".. done" | ||
fi | ||
|
||
## Create user if not exist | ||
if ! getent passwd | grep --quiet "^${PACKAGE_USER}:" ; then | ||
echo -n "Adding system user ${PACKAGE_USER} .." | ||
adduser --quiet --system \ | ||
--home /dev/null \ | ||
--shell /usr/sbin/nologin \ | ||
--no-create-home \ | ||
--uid ${PACKAGE_UID} \ | ||
--gecos "Shovel data around" \ | ||
--ingroup ${PACKAGE_GROUP} \ | ||
--disabled-password \ | ||
${PACKAGE_USER} 2>/dev/null || true | ||
echo ".. done" | ||
fi | ||
|
||
## Create other directories and files and adjsut permissions | ||
mkdir --parents --mode 0750 ${CONF_DIR} ${WORK_DIR} ${LOG_DIR} | ||
chown --recursive ${PACKAGE_USER}:${PACKAGE_GROUP} ${CONF_DIR} ${WORK_DIR} ${LOG_DIR} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/make -f | ||
# See debhelper(7) (uncomment to enable) | ||
# output every command that modifies files on the build system. | ||
export DH_VERBOSE = 1 | ||
|
||
|
||
# see FEATURE AREAS in dpkg-buildflags(1) | ||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all | ||
|
||
# see ENVIRONMENT in dpkg-buildflags(1) | ||
# package maintainers to append CFLAGS | ||
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic | ||
# package maintainers to append LDFLAGS | ||
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed | ||
|
||
%: | ||
dh $@ | ||
|
||
override_dh_install: | ||
dh_install --sourcedir=usr/local/bin | ||
|
||
override_dh_installdocs: | ||
dh_installdocs --sourcedir=usr/local/share/doc | ||
|
||
override_dh_installinit: | ||
dh_installinit --onlyscripts | ||
|
||
override_dh_installman: | ||
dh_installman --sourcedir=usr/local/share/man | ||
|
||
override_dh_installsystemd: | ||
dh_installsystemd --no-enable --no-restart-after-upgrade --no-restart-on-upgrade --no-start schaufel.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/etc/schaufel | ||
/var/lib/schaufel | ||
/var/log/schaufel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
schaufel/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
schaufel /usr/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/var/log/schaufel/*.log { | ||
su schaufel schaufel | ||
daily | ||
rotate 7 | ||
dateext | ||
copytruncate | ||
compress | ||
delaycompress | ||
missingok | ||
notifempty | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
man1/schaufel.1 | ||
man5/schaufel.conf.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[Unit] | ||
Description=Schaufel | ||
Documentation=https://github.com/adjust/schaufel | ||
Requires=network.target | ||
After=network.target | ||
|
||
[Service] | ||
## systemd.exec | ||
WorkingDirectory=/var/lib/schaufel | ||
User=schaufel | ||
Group=schaufel | ||
SyslogIdentifier=%p | ||
|
||
## systemd.service | ||
Type=simple | ||
ExecStart=/usr/bin/schaufel -l /var/log/schaufel/%p.log -C /etc/schaufel/%p.conf | ||
Restart=no | ||
SuccessExitStatus=0 | ||
TimeoutStopSec=1800 | ||
|
||
## systemd.kill | ||
KillSignal=SIGTERM | ||
SendSIGKILL=no | ||
|
||
[Install] | ||
WantedBy=multi-user.target |