mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-06-19 05:10:02 +02:00
Initial commit
This commit is contained in:
commit
33c8439604
9 changed files with 270 additions and 0 deletions
2
scripts/.gitignore
vendored
Normal file
2
scripts/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
pack/
|
||||
*.deb
|
||||
41
scripts/build_deb.sh
Executable file
41
scripts/build_deb.sh
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
PACKAGE_DESCRIPTION="HAproxy healthcheck program for EOS API."
|
||||
PACKAGE_TMPDIR="pack"
|
||||
|
||||
# Default to 1 if no release is set.
|
||||
if [[ -z $RELEASE ]]; then
|
||||
RELEASE="1"
|
||||
fi
|
||||
|
||||
PACKAGE_FULLNAME="${PACKAGE_NAME}_${PACKAGE_VERSION}-${RELEASE}_amd64"
|
||||
|
||||
rm -fr ${BASE_DIR}/${PACKAGE_TMPDIR}
|
||||
|
||||
# Create debian files.
|
||||
mkdir -p ${BASE_DIR}/${PACKAGE_TMPDIR}/DEBIAN
|
||||
echo "Package: ${PACKAGE_NAME}
|
||||
Version: ${PACKAGE_VERSION}-${RELEASE}
|
||||
Section: introspection
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Homepage: https://github.com/eosswedenorg/eos-api-healthcheck
|
||||
Maintainer: Henrik Hautakoski <henrik@eossweden.org>
|
||||
Description: ${PACKAGE_DESCRIPTION}" &> ${BASE_DIR}/${PACKAGE_TMPDIR}/DEBIAN/control
|
||||
|
||||
cat ${BASE_DIR}/${PACKAGE_TMPDIR}/DEBIAN/control
|
||||
|
||||
# Create service file
|
||||
mkdir -p ${BASE_DIR}/${PACKAGE_TMPDIR}/etc/systemd/system
|
||||
cat ${BASE_DIR}/template.service \
|
||||
| sed "s~{{ DESCRIPTION }}~${PACKAGE_DESCRIPTION}~" \
|
||||
| sed "s~{{ PROGRAM }}~/${PACKAGE_PREFIX}/bin/${PACKAGE_NAME}~" \
|
||||
> ${BASE_DIR}/${PACKAGE_TMPDIR}/etc/systemd/system/${PACKAGE_NAME}.service
|
||||
|
||||
# Copy program
|
||||
mkdir -p ${BASE_DIR}/${PACKAGE_TMPDIR}/${PACKAGE_PREFIX}/bin
|
||||
cp ${BASE_DIR}/../${PACKAGE_PROGRAM} ${BASE_DIR}/${PACKAGE_TMPDIR}/${PACKAGE_PREFIX}/bin/${PACKAGE_NAME}
|
||||
|
||||
fakeroot dpkg-deb --build ${BASE_DIR}/${PACKAGE_TMPDIR} ${BASE_DIR}/${PACKAGE_FULLNAME}.deb
|
||||
20
scripts/template.service
Normal file
20
scripts/template.service
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
[Unit]
|
||||
Description={{ DESCRIPTION }}
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
# Another Type: forking
|
||||
#User=nanodano
|
||||
#WorkingDirectory=/home/nanodano
|
||||
ExecStart={{ PROGRAM }}
|
||||
Restart=on-failure
|
||||
# Other restart options: always, on-abort, etc
|
||||
|
||||
# The install section is needed to use
|
||||
# `systemctl enable` to start on boot
|
||||
# For a user service that you want to enable
|
||||
# and start automatically, use `default.target`
|
||||
# For system level services, use `multi-user.target`
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue