Skip to content

Commit

Permalink
linux build andmanager update
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeTWC1984 committed Apr 6, 2024
1 parent 9441a4a commit 384998b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 20 deletions.
6 changes: 6 additions & 0 deletions bin/manager
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ while (( "$#" )); do
--port ) shift; port=$1 ;;
--key ) shift; key=$1 ;;
--storage ) shift; storage=$1 ;;
--sqlite ) shift; sqlite=$1 ;;
--help ) usage ;;
-*) echo "invalid parameter: $1"; usage ;;
esac
Expand All @@ -25,6 +26,11 @@ if [[ $port ]]; then
echo "Custom port set: $port"
fi

if [[ $sqlite ]]; then
export CRONICLE_sqlite="$(realpath $sqlite)"
echo "Using custom sqlite db as storage: $sqlite"
fi

if [[ $storage ]]; then
if [[ -f $storage ]]; then
export CRONICLE_storage_config="$(realpath $storage)"
Expand Down
39 changes: 21 additions & 18 deletions bundle
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ fi

# ---------------------------------------------------------------------

echo "------------------------------------------------------"
echo " Installing cronicle bundle into $(readlink -f $dist)"
echo "------------------------------------------------------"
echo ""
echo -e "\033[1;4mInstalling cronicle bundle into $(readlink -f $dist)\033[0m"
echo ""

# debug settings
minify="--minify=true"
Expand Down Expand Up @@ -441,9 +441,8 @@ if [ "$restart" = 1 ]; then
fi

echo ""
echo "---------------------------------------------------------------------------------------------------------------------------------------"
echo -e "\033[1;4mBundle is ready: $(readlink -f $dist)\033[0m"
echo ""
echo "Bundle is ready: $(readlink -f $dist)"

if [ "$lmdb" = 1 ]; then
echo " - Lmdb package was installed in $dist"
Expand All @@ -455,36 +454,40 @@ if [ "$restart" = 1 ]; then
exit 0
fi

if [ ! "$dev" = 1 ]; then
cat << EOF
Before you begin:
- Configure you storage engine setting in conf/config.json || conf/storage.json || CRONICLE_storage_config=/path/to/custom/storage.json
- Set you Secret key in conf/config.json || conf/secret_key file || CRONICLE_secret_key_file || CRONICLE_secret_key env variables
To setup cronicle storage (on the first run):
node $dist/bin/storage-cli.js setup
node $dist/bin/storage-cli.js setup
Start as manager in foreground:
node $dist/bin/cronicle.js --echo --foreground --manager --color
node $dist/bin/cronicle.js --echo --foreground --manager --color
Or use $dist/bin/manager script to setup storage + start cronicle in single manager mode
Use $dist/bin/manager entrypoint to complete both steps (use for dev or docker):
$dist/bin/manager [--port 3012] [--storage /path/to/storage.json] [--key secretKey] [--sqlite /path/to/sqlite.db] [--color]
To reinstall/upgrade run: ./bundle.sh $dist -f
Please back up $(readlink -f $dist) first for prod deployments
Or use control.sh tool:
$dist/bin/control.sh [setup|status|start|stop]
Use force flag (-f) to reinstall/upgrade (after git pull or npm package update):
./bundle.sh $dist -f
To setup as systemd service (! make sure node version for sudo user is 16 or higher):
cd $(readlink -f $dist)
npm i pixl-boot
sudo node node_modules/pixl-boot/cli.js install
### systemctl status croniclex
cd $(readlink -f $dist)
npm i pixl-boot
sudo node node_modules/pixl-boot/cli.js install
### systemctl status croniclex
To remove service:
sudo node node_modules/pixl-boot/cli.js uninstall
---------------------------------------------------------------------------------------------------------------------------------------
sudo node node_modules/pixl-boot/cli.js uninstall
EOF

fi

# OPTIONAL UNIT TEST
if [ "$test" = 1 ]; then
writehead " Bundling unit test files"
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 384998b

Please sign in to comment.