xaizek / fragile (License: AGPLv3+) (since 2018-12-07)
Simple lightweight CI, attempting to be somewhat Unix-like in its philosophy.
<root> / other / rc.fragile (add9b8c6dea1ed117044abe78707e0521091a4ca) (1,429B) (mode 100755) [raw]
#!/bin/bash
# fragile CI build daemon
# chkconfig: 345 20 80
# description: fragile CI daemon

### BEGIN INIT INFO
# Provides:          fragile
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: fragile CI daemon.
# Description:       fragile CI daemon.
### END INIT INFO

USER=fragile
DAEMON="php /var/fragile/daemon.php"
DAEMONOPTS=

NAME=fragile
DESC="fragile CI build daemon"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

case "$1" in
start)
    printf "%-50s" "Starting $NAME..."
    PID=`su -l "$USER" -c "$DAEMON $DAEMONOPTS > /dev/null 2>&1 & echo \\\$!"`
    if [ -z "$PID" ]; then
        echo "Fail"
    else
        echo "$PID" > $PIDFILE
        echo "Ok"
    fi
;;
status)
    printf "%-50s" "Checking $NAME..."
    if [ -f $PIDFILE ]; then
        PID=`cat $PIDFILE`
        if [ -z "`ps axf | grep ${PID} | grep -v grep`" ]; then
            echo "Process dead but pidfile exists"
        else
            echo "Running"
        fi
    else
        echo "Service not running"
    fi
;;
stop)
    printf "%-50s" "Stopping $NAME"
    PID=`cat $PIDFILE`
    if [ -f $PIDFILE ]; then
        kill $PID
        echo "Ok"
        rm -f $PIDFILE
    else
        echo "pidfile not found"
    fi
;;

restart)
  	$0 stop
  	$0 start
;;

*)
    echo "Usage: $0 {status|start|stop|restart}"
    exit 1
esac
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/fragile

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/fragile

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master