initial commit cronicle edge install and deploy
conf/ data/ should be comitted to master branchmaster
commit
ef1274b227
|
@ -0,0 +1,5 @@
|
|||
package.json
|
||||
bin/
|
||||
nodejs/
|
||||
logs/
|
||||
htdocs/
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
cdir=$(dirname "$(realpath "$BASH_SOURCE")")
|
||||
$cdir/bin/control.sh "$@"
|
|
@ -0,0 +1,3 @@
|
|||
SNAPSHOTS_LOG=/snapshots/log
|
||||
SNAPSHOTS_CONF=/snapshots/conf
|
||||
BACKUP_DIR=/snapshots/scripts
|
|
@ -0,0 +1,10 @@
|
|||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
WorkingDirectory=@CDIR@
|
||||
EnvironmentFile=@CDIR@/cronicle.env
|
||||
PIDFile=@CDIR@/logs/cronicled.pid
|
||||
ExecStart=@BINDIR@/control.sh start
|
||||
ExecStop=@BINDIR@/control.sh stop
|
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
CRONICLE_DIR=$(dirname "$(realpath "$BASH_SOURCE")")
|
||||
unset CRONICLE_UPGRADE
|
||||
if [[ $1 == "upgrade" ]]; then CRONICLE_UPGRADE=true; shift; fi
|
||||
pushd $CRONICLE_DIR
|
||||
if [[ ! -d bin ]] || [[ $CRONICLE_UPGRADE ]] ; then
|
||||
if [[ ! -d $CRONICLE_DIR/cronicle-edge ]]; then
|
||||
git clone https://github.com/cronicle-edge/cronicle-edge.git
|
||||
fi
|
||||
pushd cronicle-edge
|
||||
git pull origin main
|
||||
npm package update
|
||||
./bundle "$@" $CRONICLE_DIR -f
|
||||
popd
|
||||
if [[ ! -d "nodejs" ]]; then
|
||||
echo "installing nodejs for cronicle"
|
||||
bash bin/getnode.sh
|
||||
fi
|
||||
fi
|
||||
# install systemd service
|
||||
# if [[ ! -f /etc/systemd/system/cronicle.service ]]; then
|
||||
export CRONICLE_DIR=$CRONICLE_DIR
|
||||
sed 's|@BINDIR@|'"$CRONICLE_DIR"'/bin|g' cronicle.service.tpl | sed 's|@CDIR@|'"$CRONICLE_DIR"'|g' | sudo tee /etc/systemd/system/cronicle.service
|
||||
# ls -la /etc/systemd/system | grep cronicle
|
||||
# cat /etc/systemd/system/cronicle.service
|
||||
# fi
|
||||
if [[ ! -d data ]]; then
|
||||
bash control setup
|
||||
fi
|
||||
# ln -s $CRONICLE_DIR/conf/ $CRONICLE_DIR/dist
|
||||
# mkdir $CRONICLE_DIR/logs/
|
||||
# ln -s $CRONICLE_DIR/logs/ $CRONICLE_DIR/dist/
|
||||
# mkdir $CRONICLE_DIR/data/
|
||||
# ln -s $CRONICLE_DIR/data/ $CRONICLE_DIR/dist/
|
||||
popd
|
Loading…
Reference in New Issue