xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
Commit 0ba944fa4f60754b31ec29a676e72a9b870698cc

Allow the use of multiple workers
Author: Catalin(ux) M. BOIE
Author date (UTC): 2016-10-03 16:13
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2016-10-03 16:13
Parent(s): 36653f824b0c2f7159a0cdbfa50e38aea714a0b5
Signing key:
Tree: cd0ae8b443bafc1d056edf93a763faeec84ab235
File Lines added Lines deleted
scripts/worker.php 12 6
scripts/worker.sh 3 1
File scripts/worker.php changed (mode: 100644) (index 60086e3..ca9fb59)
... ... require_once($INC . "/conn.inc.php");
22 22
23 23 rg_prof_start('MAIN'); rg_prof_start('MAIN');
24 24
25 // TODO: use different files for different workers!
26 rg_log_set_file($rg_log_dir . '/worker.log');
27 rg_log_set_sid("000000"); // to spread the logs
28
29 25 if (!isset($_SERVER['argv'][1])) if (!isset($_SERVER['argv'][1]))
26 $name = 'main';
27 else
28 $name = $_SERVER['argv'][1];
29
30 if (!isset($_SERVER['argv'][2]))
30 31 $conf_file = '/etc/rocketgit/worker.conf'; $conf_file = '/etc/rocketgit/worker.conf';
31 32 else else
32 $conf_file = $_SERVER['argv'][1];
33 rg_log('conf_file=' . $conf_file);
33 $conf_file = $_SERVER['argv'][2];
34
35 // TODO: use different files for different workers!
36 rg_log_set_file($rg_log_dir . '/worker-' . $name . '.log');
37 rg_log_set_sid("000000"); // to spread the logs
38
39 rg_log('name=' . $name . ' conf_file=' . $conf_file);
34 40
35 41 /* /*
36 42 * Load configuration file * Load configuration file
File scripts/worker.sh changed (mode: 100755) (index 067f20c..99b77c7)
7 7 # this is run in rocketgit_worker_t, so we cannot do it # this is run in rocketgit_worker_t, so we cannot do it
8 8 #check_context #check_context
9 9
10 exec 100<>/var/lib/rocketgit/locks/worker.sh.lock
10 name="${1}"
11
12 exec 100<>/var/lib/rocketgit/locks/worker-${name}.sh.lock
11 13
12 14 flock --exclusive --nonblock 100 flock --exclusive --nonblock 100
13 15 if [ "${?}" != "0" ]; then if [ "${?}" != "0" ]; then
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/rocketgit

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

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