Skip to content
Snippets Groups Projects
Commit e805bff7 authored by Dmitry Puzyrkov's avatar Dmitry Puzyrkov
Browse files

[*] buildcript redused for new buildserver enviroment.

parent 4badea0e
No related branches found
No related tags found
No related merge requests found
File moved
File moved
pack.sh 0 → 100755
#!/bin/bash
set -e
if [ ${0:0:1} = "/" ]; then
HERE=`dirname $0`
else
CMD=`pwd`/$0
HERE=`dirname ${CMD}`
fi
BUILD_ARCH="${1:-x86_64-linux-gnu}"
BUILD_TYPE="${2:-release}"
PACKAGE_TYPE="${3:-deb}"
BUILD_DIR=${PWD}/build_${BUILD_ARCH}_${BUILD_TYPE}
echo "Pack [${BUILD_TYPE}] binaries for [$BUILD_ARCH] architecture from [${BUILD_DIR}] in {$PACKAGE_TYPE} package."
cd ${BUILD_DIR}
#do cpack, it should care all other things and generate a deb file
cpack .
#!/bin/bash -e
. /usr/share/debconf/confmodule
case "$1" in
reconfigure|configure)
db_input critical cellframe-node/auto_online || true
db_go || true
db_input critical cellframe-node/debug_mode || true
db_go || true
db_input critical cellframe-node/server_enabled || true
db_go || true
db_input critical cellframe-node/server_addr || true
db_go || true
db_input critical cellframe-node/server_port || true
db_go || true
db_input critical cellframe-node/notify_srv_addr || true
db_go || true
db_input critical cellframe-node/notify_srv_port || true
db_go || true
db_input critical cellframe-node/subzero_enabled || true
db_go || true
db_get cellframe-node/subzero_enabled
if [ "$RET" = "true" ]; then
db_input critical cellframe-node/subzero_node_type || true
db_go || true
fi
db_input critical cellframe-node/kelvpn_minkowski_enabled || true
db_go || true
db_get cellframe-node/kelvpn_minkowski_enabled
if [ "$RET" = "true" ]; then
db_input critical cellframe-node/kelvpn_minkowski_node_type || true
db_go || true
fi
db_input critical cellframe-node/backbone_enabled || true
db_go || true
db_get cellframe-node/backbone_enabled
if [ "$RET" = "true" ]; then
db_input critical cellframe-node/backbone_node_type || true
db_go || true
fi
db_input critical cellframe-node/enable_python_plugins || true
db_go || true
db_get cellframe-node/enable_python_plugins
if [ "$RET" = "true" ]; then
db_input critical cellframe-node/python_plugins_path || true
db_go || true
fi
;;
*)
echo "config called with unknown argument \`$1'" >&2
exit 1
;;
esac
#!/bin/bash -e
. /usr/share/debconf/confmodule
DAP_CHAINS_NAME="cellframe"
DAP_APP_NAME="${DAP_CHAINS_NAME}-node"
DAP_PREFIX="/opt/${DAP_APP_NAME}"
DAP_CFG_TPL="${DAP_PREFIX}/share/configs/${DAP_APP_NAME}.cfg.tpl"
# Store write config to new if present smth
DAP_CFG="${DAP_PREFIX}/etc/${DAP_APP_NAME}.cfg"
[ -e "/etc/profile.d/${DAP_APP_NAME}.sh" ] || ln -sf ${DAP_PREFIX}/share/profile.d/${DAP_APP_NAME}.sh /etc/profile.d/${DAP_APP_NAME}.sh
# Init node config
if [ -e "${DAP_CFG}" ]; then
DAP_CFG="${DAP_PREFIX}/etc/${DAP_APP_NAME}.cfg.dpkg-new"
else
DAP_CFG="${DAP_PREFIX}/etc/${DAP_APP_NAME}.cfg"
fi
cat ${DAP_CFG_TPL} > ${DAP_CFG} || true
sed -i "s/{PREFIX}/\/opt\/${DAP_APP_NAME}/g" ${DAP_CFG} || true
db_get cellframe-node/debug_mode || true
sed -i "s/{DEBUG_MODE}/${RET}/g" ${DAP_CFG} || true
db_get cellframe-node/auto_online || true
sed -i "s/{AUTO_ONLINE}/${RET}/g" ${DAP_CFG} || true
db_get cellframe-node/server_enabled || true
sed -i "s/{SERVER_ENABLED}/${RET}/g" ${DAP_CFG} || true
db_get cellframe-node/server_port || true
sed -i "s/{SERVER_PORT}/${RET}/g" ${DAP_CFG} || true
db_get cellframe-node/server_addr || true
sed -i "s/{SERVER_ADDR}/${RET}/g" ${DAP_CFG} || true
db_get cellframe-node/notify_srv_addr || true
sed -i "s/{NOTIFY_SRV_ADDR}/${RET}/g" ${DAP_CFG} || true
db_get cellframe-node/notify_srv_port || true
sed -i "s/{NOTIFY_SRV_PORT}/${RET}/g" ${DAP_CFG} || true
# Init subzero
NET_NAME="subzero"
db_get cellframe-node/subzero_enabled || true
if [ "${RET}" = "true" ]; then
DAP_CFG_NET="${DAP_PREFIX}/etc/network/${NET_NAME}.cfg"
DAP_CFG_NET_TPL="${DAP_PREFIX}/share/configs/network/${NET_NAME}.cfg.tpl"
DAP_NET_CFG=""
if [ -e "$DAP_CFG_NET" ]; then
DAP_NET_CFG="${DAP_PREFIX}/etc/network/${NET_NAME}.cfg.dpkg-new"
else
DAP_NET_CFG="${DAP_PREFIX}/etc/network/${NET_NAME}.cfg"
fi
cat ${DAP_CFG_NET_TPL} > ${DAP_NET_CFG} || true
db_get cellframe-node/subzero_node_type || true
NODE_TYPE=${RET}
sed -i "s/{NODE_TYPE}/${NODE_TYPE}/g" ${DAP_NET_CFG} || true
echo "[*] Enabled subzero"
fi
# Init mileena
NET_NAME="mileena"
db_get cellframe-node/mileena_enabled || true
if [ "$RET" = "true" ]; then
DAP_CFG_NET="${DAP_PREFIX}/etc/network/${NET_NAME}.cfg"
DAP_CFG_NET_TPL="${DAP_PREFIX}/share/configs/network/${NET_NAME}.cfg.tpl"
DAP_NET_CFG=""
if [ -e "${DAP_CFG_NET}" ]; then
DAP_NET_CFG="${DAP_PREFIX}/etc/network/${NET_NAME}.cfg.dpkg-new"
else
DAP_NET_CFG="${DAP_PREFIX}/etc/network/${NET_NAME}.cfg"
fi
cat ${DAP_CFG_NET_TPL} > ${DAP_NET_CFG} || true
db_get cellframe-node/mileena_node_type || true
NODE_TYPE=${RET}
sed -i "s/{NODE_TYPE}/${NODE_TYPE}/g" ${DAP_NET_CFG} || true
echo "[*] Enabled mileena"
fi
# Init Minkowski
NET_NAME="kelvpn-minkowski"
db_get cellframe-node/kelvpn_minkowski_enabled || true
if [ "${RET}" = "true" ]; then
DAP_CFG_NET="${DAP_PREFIX}/etc/network/${NET_NAME}.cfg"
DAP_CFG_NET_TPL="${DAP_PREFIX}/share/configs/network/${NET_NAME}.cfg.tpl"
DAP_NET_CFG=""
if [ -e "$DAP_CFG_NET" ]; then
DAP_NET_CFG="${DAP_PREFIX}/etc/network/${NET_NAME}.cfg.dpkg-new"
else
DAP_NET_CFG="${DAP_PREFIX}/etc/network/${NET_NAME}.cfg"
fi
cat ${DAP_CFG_NET_TPL} > ${DAP_NET_CFG} || true
db_get cellframe-node/kelvpn_minkowski_node_type || true
NODE_TYPE=${RET}
sed -i "s/{NODE_TYPE}/${NODE_TYPE}/g" ${DAP_NET_CFG} || true
echo "[*] Enabled kelvpn-minkowski"
fi
# Init Backbone
NET_NAME="Backbone"
db_get cellframe-node/backbone_enabled || true
if [ "${RET}" = "true" ]; then
DAP_CFG_NET="${DAP_PREFIX}/etc/network/${NET_NAME}.cfg"
DAP_CFG_NET_TPL="${DAP_PREFIX}/share/configs/network/${NET_NAME}.cfg.tpl"
DAP_NET_CFG=""
if [ -e "${DAP_CFG_NET}" ]; then
DAP_NET_CFG="${DAP_PREFIX}/etc/network/${NET_NAME}.cfg.dpkg-new"
else
DAP_NET_CFG="${DAP_PREFIX}/etc/network/${NET_NAME}.cfg"
fi
cat ${DAP_CFG_NET_TPL} > ${DAP_NET_CFG} || true
db_get cellframe-node/backbone_node_type || true
NODE_TYPE=$RET
sed -i "s/{NODE_TYPE}/${NODE_TYPE}/g" ${DAP_NET_CFG} || true
echo "[*] Enabled Backbone"
fi
#Set up Python plugins
db_get cellframe-node/enable_python_plugins || true
if [ "${RET}" = "true" ]; then
sed -i 's/#\[plugins\]/\[plugins\]/g' ${DAP_CFG} || true
sed -i 's/#py_load=.*/py_load=true/g' ${DAP_CFG} || true
db_get cellframe-node/python_plugins_path || true
sed -i "s|#py_path=.*|py_path=${RET}|g" ${DAP_CFG} || true
echo "[*] Enabled Python plugins"
fi
if [ $(cat /etc/passwd | grep ${DAP_APP_NAME}) ] ; then
usermod ${DAP_APP_NAME} -s /bin/false > /dev/null || true # Let's change the default shell just in case
else
echo "[*] Add user ${DAP_APP_NAME}"
adduser --system --no-create-home --group --home /opt/${DAP_APP_NAME} ${DAP_APP_NAME} --shell /bin/false > /dev/null || true
fi
echo "[*] Check /etc/systemd/system/${DAP_APP_NAME}.service file..."
if [ -e /etc/systemd/system/${DAP_APP_NAME}.service ]; then
echo "[*] Restarting ${DAP_APP_NAME} to implement changes"
systemctl stop ${DAP_APP_NAME} >> /dev/null || true
echo "[*] Stopped ${DAP_APP_NAME}"
systemctl daemon-reload || true
systemctl start ${DAP_APP_NAME} || true
echo "[*] Started ${DAP_APP_NAME}"
else
echo "[!] Installing ${DAP_APP_NAME} as systemd service"
ln -sf $DAP_PREFIX/share/${DAP_APP_NAME}.service /etc/systemd/system/${DAP_APP_NAME}.service || true
systemctl enable ${DAP_PREFIX}/share/${DAP_APP_NAME}.service || true
echo "[*] Enabling logrotate"
ln -sf ${DAP_PREFIX}/share/logrotate/${DAP_APP_NAME} /etc/logrotate.d/${DAP_APP_NAME} || true
mkdir -p ${DAP_PREFIX}/var/{run,lib/wallet,lib/global_db,lib/plugins,log} || true
touch ${DAP_PREFIX}/var/run/${DAP_APP_NAME}.pid || true
for filename in $(find ${DAP_PREFIX} | grep -v bugreport); do
if [ -d ${filename} ]; then
chmod 0775 ${filename} 2>/dev/null || true
else
chmod 0664 ${filename} 2>/dev/null || true
fi
done
chmod 0666 ${DAP_CFG}
chmod 0666 ${DAP_CFG_TPL}
chmod 0774 ${DAP_PREFIX}/bin/* || true
#set python permissions
find ${DAP_PREFIX}/bin/python -type d -exec chmod 755 {} +
chmod 774 ${DAP_PREFIX}/bin/python/bin/*
chown -R ${DAP_APP_NAME}: ${DAP_PREFIX}
echo "[*] Starting ${DAP_APP_NAME} service"
systemctl start ${DAP_APP_NAME} || true
echo "[!] Done"
fi
#! /bin/bash -e
if [ "$1" == "purge" ] && [ -e /usr/share/debconf/confmodule ] ; then
. /usr/share/debconf/confmodule
db_purge
fi
GROUP_RM="cellframe-node"
systemctl stop cellframe-node || true
systemctl disable cellframe-node || true
#for username in `cat /etc/passwd | grep "/home" | cut -d ':' -f1`; do
# gpasswd -d $username $GROUP_RM || true
#done
#rm -r /opt/cellframe-node || true
#groupdel cellframe-node || true
#userdel cellframe-node || true
#!/usr/bin/make -f
override_dh_fixperms:
dh_fixperms -X/opt/cellframe-node
chmod 777 /opt/cellframe-node/bin/cellframe-node-cli
override_dh_auto_install:
dh_auto_install -- prefix=/opt/cellframe-node
%:
# dh $@ --with=systemd
dh $@
Template: cellframe-node/auto_online
Default: false
Choices: true, false
Type: select
Description: Auto online
Bring up links automatically and go to ONLINE network state
Template: cellframe-node/debug_mode
Default: false
Choices: true, false
Type: select
Description: Debug mode
Debug mode for logs
Template: cellframe-node/server_enabled
Default: false
Choices: true, false
Type: select
Description: Accept connections
Accept connections
Template: cellframe-node/server_port
Default: 8079
Type: string
Description: Server port
Server port to listen on, recommended 8079
Template: cellframe-node/server_addr
Default: 0.0.0.0
Type: string
Description: Server address
Server address to listen on
Template: cellframe-node/notify_srv_addr
Default: 127.0.0.1
Type: string
Description: Notify server address
Notify server address to listen on
Template: cellframe-node/notify_srv_port
Default: 8080
Type: string
Description: Notify server port
Notify server port to listen on
Template: cellframe-node/subzero_enabled
Default: true
Choices: true, false
Type: select
Description: SubZero: Enable network
Subzero Testnet: Enable network auto load on start
Template: cellframe-node/subzero_node_type
Type: select
Default: full
Choices: full, light, master, archive, root
Description: SubZero: Node role
Select node role:.
Light - Synchronize only local wallets
full - Sync all its cell
master - Allow to store values in chains and take comission, sync all shards that will need to be synced
archive - Sync all the network
root - Special predefined root nodes, usually produces zerochain and acts like archive as well
Template: cellframe-node/mileena_enabled
Default: true
Choices: true, false
Type: select
Description: Mileena: Enable network
Mileena Testnet: Enable network auto load on start
Template: cellframe-node/mileena_node_type
Type: select
Default: full
Choices: full, light, master, archive, root
Description: Mileena: Node role
Select node role:.
Light - Synchronize only local wallets
full - Sync all its cell
master - Allow to store values in chains and take comission, sync all shards that will need to be synced
archive - Sync all the network
root - Special predefined root nodes, usually produces zerochain and acts like archive as well
Template: cellframe-node/kelvpn_minkowski_enabled
Default: true
Choices: true, false
Type: select
Description: Kelvpn Minkowski: Enable network
Minkowski Testnet: Enable network auto load on start
Template: cellframe-node/kelvpn_minkowski_node_type
Type: select
Default: full
Choices: full, light, master, archive, root
Description: Kelvpn Minkowski: Node role
Select node role:.
Light - Synchronize only local wallets
full - Sync all its cell
master - Allow to store values in chains and take comission, sync all shards that will need to be synced
archive - Sync all the network
root - Special predefined root nodes, usually produces zerochain and acts like archive as well
Template: cellframe-node/backbone_enabled
Default: true
Choices: true, false
Type: select
Description: Backbone: Enable network
Backbone Mainnet: Enable network auto load on start
Template: cellframe-node/backbone_node_type
Type: select
Default: full
Choices: full, light, master, archive, root
Description: Backbone: Node role
Select node role:.
Light - Synchronize only local wallets
full - Sync all its cell
master - Allow to store values in chains and take comission, sync all shards that will need to be synced
archive - Sync all the network
root - Special predefined root nodes, usually produces zerochain and acts like archive as well
Template: cellframe-node/enable_python_plugins
Default: false
Choices: true, false
Type: select
Description: Python plugins: Enable Python plugins
Python plugins: Enable Python plugins
Template: cellframe-node/python_plugins_path
Default: /opt/cellframe-node/var/lib/plugins
Type: string
Description: Python plugins path
Path for Python plugins
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment