parent
231beb5c3f
commit
33b7c33ab4
@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
|
||||
. ./scorsh_functions
|
||||
|
||||
|
||||
### create spool directory
|
||||
mkdir "${SCORSH_APP}/spool"
|
||||
check_fatal "[ -$? -eq 0 ]" $0 "create_spool_folder"
|
||||
|
||||
|
||||
### configure the remote to be used with scorsh
|
||||
cd ${REMOTE_REPO}
|
||||
SPOOL_DIR="${SCORSH_APP}/spool"
|
||||
git config -f scorsh scorsh.spooldir $(realpath "${SPOOL_DIR}")
|
||||
ret=$(git config -f scorsh scorsh.spooldir)
|
||||
check_fatal "[ \"${ret}\" = \"${SPOOL_DIR}\" ]" $0 "config_remote_repo"
|
||||
cd - > /dev/null
|
||||
###
|
||||
|
||||
|
||||
### copy the post-receive hook in REMOTE_REPO/hooks
|
||||
cp ${SCORSH_REPO}/hooks/post-receive ${REMOTE_REPO}/hooks/
|
||||
check_fatal "[ $? -eq 0 ]" $0 "copy_post-receive_hook"
|
||||
|
||||
|
||||
### copy the scorshd program under SCORSH_APP
|
||||
cp ${SCORSH_REPO}/scorshd ${SCORSH_APP}
|
||||
check_fatal "[ $? -eq 0 ]" $0 "copy_scorshd"
|
||||
|
||||
### copy the files under "examples" into SCORSH_APP
|
||||
cp -a ${SCORSH_REPO}/examples/* ${SCORSH_APP}
|
||||
check_fatal "[ $? -eq 0 ]" $0 "copy_scorsh_config"
|
||||
|
||||
|
||||
|
||||
|
||||
##check_fatal "[ 1 -eq 0 ]" $0 "aborting_on_purpose"
|
||||
|
||||
return_results
|
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
. ./scorsh_functions
|
||||
|
||||
## start the scorsh daemon
|
||||
cd ${SCORSH_APP}
|
||||
./scorshd -c scorsh_example.cfg &
|
||||
echo "$!" > scorsh.pid
|
||||
is_running=$(ps $(cat scorsh.pid) | grep -c scorshd )
|
||||
cd - >/dev/null
|
||||
check_fatal "[ \"${is_running}\" = \"1\" ]" $0 "start_scorshd"
|
||||
|
||||
##check_fatal "[ 1 -eq 0 ]" $0 "exit_on_purpose"
|
||||
|
||||
## check if workers were started
|
||||
cd ${SCORSH_APP}
|
||||
ret=$(grep -c "Workers started correctly" scorsh.log)
|
||||
cd - > /dev/null
|
||||
check_fatal "[ \"$ret\" = \"1\" ]" $0 "workers_started"
|
||||
|
||||
## check if spooler was started
|
||||
cd ${SCORSH_APP}
|
||||
ret=$(grep -c "Spooler started correctly" scorsh.log)
|
||||
cd - > /dev/null
|
||||
check_fatal "[ \"$ret\" = \"1\" ]" $0 "spooler_started"
|
||||
|
||||
return_results
|
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
. ./scorsh_functions
|
||||
|
||||
## is the daemon running?
|
||||
cd ${SCORSH_APP}
|
||||
is_running=$(ps $(cat scorsh.pid) | grep -c scorshd )
|
||||
cd - >/dev/null
|
||||
check "[ \"${is_running}\" = \"1\" ]" $0 "is_scorshd_running"
|
||||
|
||||
|
||||
## stop the scorsh daemon
|
||||
cd ${SCORSH_APP}
|
||||
kill -15 $(cat scorsh.pid)
|
||||
ret=$?
|
||||
rm scorsh.pid
|
||||
cd - >/dev/null
|
||||
check "[ $ret -eq 0 ]" $0 ""
|
||||
|
||||
return_results
|
Loading…
Reference in new issue