mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-06-19 05:10:02 +02:00
scripts/build_deb.sh: refactor common code to build.sh
This commit is contained in:
parent
e547ac7062
commit
767508c4f0
3 changed files with 39 additions and 13 deletions
2
Makefile
2
Makefile
|
|
@ -24,7 +24,7 @@ package_deb: build
|
|||
export PACKAGE_VERSION="0.3.1" \
|
||||
export PACKAGE_PREFIX=$(PREFIX:/%=%) \
|
||||
export PACKAGE_PROGRAM="build/$(PROGRAM_NAME)" \
|
||||
&& ./scripts/build_deb.sh
|
||||
&& ./scripts/build.sh deb
|
||||
|
||||
clean:
|
||||
$(GO) clean
|
||||
|
|
|
|||
37
scripts/build.sh
Executable file
37
scripts/build.sh
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
#!/bin/bash
|
||||
|
||||
############################
|
||||
# Exported variables. #
|
||||
############################
|
||||
|
||||
export BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
# Info
|
||||
export PACKAGE_DESCRIPTION="HAproxy healthcheck program for EOSIO API."
|
||||
|
||||
# Directories.
|
||||
export PACKAGE_BINDIR=${PACKAGE_PREFIX}/bin
|
||||
export PACKAGE_ETCDIR=etc/${PACKAGE_NAME}
|
||||
export PACKAGE_SYSUNITDIR=etc/systemd/system
|
||||
export PACKAGE_RSYSLOGDIR=etc/rsyslog.d
|
||||
export PACKAGE_LOGROTATEDIR=etc/logrotate.d
|
||||
export PACKAGE_LOGDIR=/var/log
|
||||
export PACKAGE_LOGFILE=${PACKAGE_LOGDIR}/${PACKAGE_NAME}.log
|
||||
export PACKAGE_SHAREDIR=${PACKAGE_PREFIX}/share/${PACKAGE_NAME}
|
||||
export PACKAGE_TMPDIR="pack"
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "$0 <pkg_type>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PKG_TYPE=$1
|
||||
PKG_SCRIPT="${BASE_DIR}/build_${PKG_TYPE}.sh"
|
||||
|
||||
# Check and call script
|
||||
if [ ! -x $PKG_SCRIPT ]; then
|
||||
echo "$PKG_SCRIPT not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$PKG_SCRIPT
|
||||
|
|
@ -1,17 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
PACKAGE_BINDIR=${PACKAGE_PREFIX}/bin
|
||||
PACKAGE_ETCDIR=etc/${PACKAGE_NAME}
|
||||
PACKAGE_SYSUNITDIR=etc/systemd/system
|
||||
PACKAGE_RSYSLOGDIR=etc/rsyslog.d
|
||||
PACKAGE_LOGROTATEDIR=etc/logrotate.d
|
||||
PACKAGE_LOGDIR=/var/log
|
||||
PACKAGE_LOGFILE=${PACKAGE_LOGDIR}/${PACKAGE_NAME}.log
|
||||
PACKAGE_SHAREDIR=${PACKAGE_PREFIX}/share/${PACKAGE_NAME}
|
||||
PACKAGE_DESCRIPTION="HAproxy healthcheck program for EOSIO API."
|
||||
PACKAGE_TMPDIR="pack"
|
||||
PACKAGE_TMPDIR="${PACKAGE_TMPDIR}/debian"
|
||||
|
||||
if [[ -f /etc/upstream-release/lsb-release ]]; then
|
||||
source /etc/upstream-release/lsb-release
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue