List of commits:
Subject Hash Author Date (UTC)
Fix rg_str_replace regarding ints; .spec small changes 7242f96f08983a70345e2665cfeb1ea592e3f3f7 Catalin(ux) M. BOIE 2021-10-26 06:17:39
builder: fixed immediate exit 27d21c9ef6bb10beaf1d4c8da29a90d649e68b60 Catalin(ux) M. BOIE 2021-10-24 14:41:29
We need .spec file before configure 840c7c3c0dd68c8ff6796b6494ca38afe8f4a5e6 Catalin(ux) M. BOIE 2021-10-24 14:28:59
rgfs: respect the requested size asked to be read f6f9e3f26e9c2bc98c38ded6a732cf53630d5688 Catalin(ux) M. BOIE 2021-10-24 09:25:51
builder: delay 5s if cannot contact the database b672b80542e80439243127aef2de4bda7d884e8a Catalin(ux) M. BOIE 2021-10-24 08:26:35
Cosmetic ea40e49373739590d9794d203ddd7e2b18464e29 Catalin(ux) M. BOIE 2021-10-23 15:35:34
Typo 7d156cc190c150239f16ea0b9807eb027f8cd79f Catalin(ux) M. BOIE 2021-10-22 17:41:34
worker: be more verbose 0f0e6216ad6f5923d08c10d7461d2259e92f69cd Catalin(ux) M. BOIE 2021-10-22 17:32:01
Add /etc/ssh files to spec 91c7c4f0bd30f01abe48e5c4f4c75857982a8f21 Catalin(ux) M. BOIE 2021-10-22 06:30:23
Removed Changelog file 8e42a6cb730000a104956bc7d265321d67d49bfe Catalin(ux) M. BOIE 2021-10-22 06:22:24
Do not store dependencies in a file but in a variable 13ba1da3a4a422e798393565e0a6941df660300a Catalin(ux) M. BOIE 2021-10-22 05:49:24
Forgot to create ssh dir for spec 1fd7185cdbf427451a7f4c5ada54e43febc5184f Catalin(ux) M. BOIE 2021-10-22 05:46:41
Still need to extract rpm info when switching users c4ddd883070d8fe48c876196dd3e4e08419745eb Catalin(ux) M. BOIE 2021-10-22 05:28:24
Add build_tools to the main script b0f721d9391a9cbe443a986f7d15cd8c052abd11 Catalin(ux) M. BOIE 2021-10-22 05:18:54
Again, first install the dependencies 919e46d2a71935451f576da32b61d2b6ecab126b Catalin(ux) M. BOIE 2021-10-22 05:02:50
Cosmetic cabc1c5cec8943d614b98b7f0ca8599cf5e2682c Catalin(ux) M. BOIE 2021-10-21 17:16:33
Install dependencies before trying to build the rpm 4df3dbf7e1f79b0c616d8dbeba8b1b30c9474f17 Catalin(ux) M. BOIE 2021-10-21 16:49:37
duilder fixes 2afa9250c1da72997092847df5a2a18cddb8ccb9 Catalin(ux) M. BOIE 2021-10-21 15:59:24
worker: move dependencies path 2e8902609a2d94e2eba5fb8ccda85de90ae23fb5 Catalin(ux) M. BOIE 2021-10-21 15:22:25
Lots of changes, too hard to split them; sorry about it 77c26d9ce82d452ebdc1b609d71c5e931768805c Catalin(ux) M. BOIE 2021-10-21 06:05:51
Commit 7242f96f08983a70345e2665cfeb1ea592e3f3f7 - Fix rg_str_replace regarding ints; .spec small changes
Author: Catalin(ux) M. BOIE
Author date (UTC): 2021-10-26 06:17
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2021-10-26 06:17
Parent(s): 27d21c9ef6bb10beaf1d4c8da29a90d649e68b60
Signer:
Signing key:
Signing status: N
Tree: 8c3b42a136676598074d1ca887a23b3afa162a9e
File Lines added Lines deleted
inc/util.inc.php 3 0
rocketgit.spec 1 1
scripts/worker.php 28 19
File inc/util.inc.php changed (mode: 100644) (index 198e2fc..4aa510a)
... ... function rg_str_replace($keys, $values, $a, $level)
2851 2851 if (is_string($a)) if (is_string($a))
2852 2852 return str_replace($keys, $values, $a); return str_replace($keys, $values, $a);
2853 2853
2854 if (!is_array($a))
2855 return $a;
2856
2854 2857 if (is_array($a)) { if (is_array($a)) {
2855 2858 foreach ($a as $k => $v) foreach ($a as $k => $v)
2856 2859 $a[$k] = rg_str_replace($keys, $values, $v, $level + 1); $a[$k] = rg_str_replace($keys, $values, $v, $level + 1);
File rocketgit.spec changed (mode: 100644) (index 1ab789c..05c8cb4)
... ... rm -rf ${RPM_BUILD_ROOT}
105 105 %files %files
106 106 %defattr (-,root,root,0755) %defattr (-,root,root,0755)
107 107 %dir /usr/share/rocketgit %dir /usr/share/rocketgit
108 %doc README LICENSE Changelog TODO selinux/rocketgit.* samples/*
108 %doc README LICENSE TODO samples
109 109 %attr(0700,rocketgit,rocketgit) %dir /etc/rocketgit %attr(0700,rocketgit,rocketgit) %dir /etc/rocketgit
110 110 /etc/rocketgit/config.php.sample /etc/rocketgit/config.php.sample
111 111 /etc/httpd/conf.d/rocketgit.conf.sample /etc/httpd/conf.d/rocketgit.conf.sample
File scripts/worker.php changed (mode: 100644) (index f1da158..5f0db32)
... ... function start_worker_build_tools($job, &$reason, &$reason2)
370 370 . 'export job_id=' . escapeshellarg($job['id']) . "\n" . 'export job_id=' . escapeshellarg($job['id']) . "\n"
371 371 . 'export repo_username=' . escapeshellarg(isset($job['repo_username']) ? $job['repo_username'] : '') . "\n" . 'export repo_username=' . escapeshellarg(isset($job['repo_username']) ? $job['repo_username'] : '') . "\n"
372 372 . 'export job_uid=' . (isset($job['uid']) ? $job['uid'] : '') . "\n" . 'export job_uid=' . (isset($job['uid']) ? $job['uid'] : '') . "\n"
373 . 'export job_url=' . (isset($job['url']) ? $job['url'] : '') . "\n"
374 . 'export job_head=' . (isset($job['head']) ? $job['head'] : '') . "\n"
373 375 . 'export env=' . escapeshellarg($job['env']) . "\n" . 'export env=' . escapeshellarg($job['env']) . "\n"
374 376 . 'export env_distro=' . escapeshellarg($job['env_distro']) . "\n" . 'export env_distro=' . escapeshellarg($job['env_distro']) . "\n"
375 377 . 'export env_major=' . escapeshellarg($job['env_major']) . "\n" . 'export env_major=' . escapeshellarg($job['env_major']) . "\n"
 
... ... function start_worker_build_tools($job, &$reason, &$reason2)
558 560 . ' xecho "rg_extract_rpm_info: dir=${dir} [`date`]"' . "\n" . ' xecho "rg_extract_rpm_info: dir=${dir} [`date`]"' . "\n"
559 561 . ' spec_file=`find "${dir}" -type f -iname \'*.spec\' | head -n1`' . "\n" . ' spec_file=`find "${dir}" -type f -iname \'*.spec\' | head -n1`' . "\n"
560 562 . ' if [ "${spec_file}" = "" ]; then' . "\n" . ' if [ "${spec_file}" = "" ]; then' . "\n"
561 . ' xecho " Cannot find any .spec file in ${dir}!" > ~/rg_op.err' . "\n"
563 . ' xecho " Cannot find any .spec file in ${dir}!"' . "\n"
564 . ' ls -l "${dir}"' . "\n"
562 565 . ' return' . "\n" . ' return' . "\n"
563 566 . ' fi' . "\n" . ' fi' . "\n"
564 567 . "\n" . "\n"
 
... ... function start_worker($job)
1288 1291
1289 1292 // Creating build.sh file // Creating build.sh file
1290 1293 // TODO: document how a user can add labels in configure or make // TODO: document how a user can add labels in configure or make
1291 $s = '#!/bin/bash' . "\n";
1294 $s = '#!/bin/bash' . "\n\n";
1292 1295 $s .= 'export RG_LABELS=/mnt/status/RG_LABELS' . "\n\n"; $s .= 'export RG_LABELS=/mnt/status/RG_LABELS' . "\n\n";
1293 $s .= "\n";
1294 1296
1295 1297 // build.sh: secrets // build.sh: secrets
1296 1298 if (isset($job['secrets']) && !empty($job['secrets'])) { if (isset($job['secrets']) && !empty($job['secrets'])) {
 
... ... function start_worker($job)
1306 1308
1307 1309 $s .= 'cd /mnt/target' . "\n\n"; $s .= 'cd /mnt/target' . "\n\n";
1308 1310
1309 if (isset($job['url'])) {
1310 $s .= 'git branch -f rgw ' . escapeshellarg($job['head']) . " &>/mnt/status/git.branch.log\n\n";
1311 $s .= 'git checkout rgw' . " &>/mnt/status/git.checkout.log\n\n";
1312 }
1311 // To be able to run 'configure' without './'
1312 $s .= 'export PATH="${PATH}:."' . "\n\n";
1313 1313
1314 1314 if (!isset($job['cmds'])) if (!isset($job['cmds']))
1315 1315 $job['cmds'] = array(); $job['cmds'] = array();
 
... ... function start_worker($job)
1335 1335 . ' >>/mnt/status/RG_LABELS' . "\n"; . ' >>/mnt/status/RG_LABELS' . "\n";
1336 1336
1337 1337 $s .= 'date +%s > ' . $prefix . '.start' . "\n" $s .= 'date +%s > ' . $prefix . '.start' . "\n"
1338 . '# i: ' . json_encode($i) . "\n"
1339 1338 . 'echo "Executing [' . $i['cmd'] . ']"' . "\n" . 'echo "Executing [' . $i['cmd'] . ']"' . "\n"
1340 1339 . '(' . $i['cmd'] . ') &>' . $prefix . '.log' . "\n" . '(' . $i['cmd'] . ') &>' . $prefix . '.log' . "\n"
1341 1340 . 'E=${?}' . "\n" . 'E=${?}' . "\n"
 
... ... function start_worker($job)
1405 1404 // TODO: we should not wait for net forever // TODO: we should not wait for net forever
1406 1405 $r = @file_put_contents($job['main'] . '/root/rg.sh', $r = @file_put_contents($job['main'] . '/root/rg.sh',
1407 1406 '#!/bin/bash' . "\n" '#!/bin/bash' . "\n"
1407 . "\n"
1408 1408 . 'echo "This is the rg.sh script..."' . "\n" . 'echo "This is the rg.sh script..."' . "\n"
1409 1409 . "\n" . "\n"
1410 1410 . 'source /mnt/build_tools.sh' . "\n" . 'source /mnt/build_tools.sh' . "\n"
 
... ... function start_worker($job)
1461 1461 . 'fi' . "\n" . 'fi' . "\n"
1462 1462 . "\n" . "\n"
1463 1463 . 'while [ "${ERR}" = "" ]; do' . "\n" . 'while [ "${ERR}" = "" ]; do' . "\n"
1464 . ' echo; echo "`date`: Running build.sh script"' . "\n"
1465 . ' date +%s > /mnt/status/build.sh.start' . "\n" // TODO: not read and not exposed?
1466 . ' su - build -c "bash /mnt/build.sh" &>/mnt/status/build.log' . "\n"
1467 . ' E=${?}' . "\n"
1468 . ' date +%s > /mnt/status/build.sh.stop' . "\n" // TODO: not read and not exposed?
1469 . ' if [ "${E}" != "0" ]; then' . "\n"
1470 . ' echo "`date`: DEBUG: build.sh exited with code ${E}"' . "\n"
1471 . ' ERR="build.sh returned ${E}"' . "\n"
1472 . ' break' . "\n"
1464 . ' if [ "${job_url}" != "" ]; then' . "\n"
1465 . ' echo; echo "`date`: Checkout"' . "\n"
1466 . ' su - build -c "cd /mnt/target && git branch -f rgw ${job_head} && git checkout rgw"' . "\n"
1467 . ' if [ "${?}" != "0" ]; then' . "\n"
1468 . ' ERR="cannot checkout"' . "\n"
1469 . ' break' . "\n"
1470 . ' fi' . "\n"
1473 1471 . ' fi' . "\n" . ' fi' . "\n"
1474 1472 . "\n" . "\n"
1475 . ' # Now we may have the .spec file, we can try to extract info' . "\n"
1476 . ' rg_extract_rpm_info /mnt/target || break' . "\n"
1473 . ' # Extract .spec file info' . "\n"
1474 . ' rg_extract_rpm_info /mnt/target' . "\n"
1477 1475 . ' if [ "${spec_deps}" != "" ]; then' . "\n" . ' if [ "${spec_deps}" != "" ]; then' . "\n"
1478 1476 . ' echo; echo "`date`: Installing dependencies [${spec_deps}]"' . "\n" . ' echo; echo "`date`: Installing dependencies [${spec_deps}]"' . "\n"
1479 1477 . ' export DEBIAN_FRONTEND=noninteractive' . "\n" . ' export DEBIAN_FRONTEND=noninteractive' . "\n"
 
... ... function start_worker($job)
1485 1483 . ' fi' . "\n" . ' fi' . "\n"
1486 1484 . ' fi' . "\n" . ' fi' . "\n"
1487 1485 . "\n" . "\n"
1486 . ' echo; echo "`date`: Running build.sh script"' . "\n"
1487 . ' date +%s > /mnt/status/build.sh.start' . "\n" // TODO: not read and not exposed?
1488 . ' su - build -c "bash /mnt/build.sh" &>/mnt/status/build.log' . "\n"
1489 . ' E=${?}' . "\n"
1490 . ' date +%s > /mnt/status/build.sh.stop' . "\n" // TODO: not read and not exposed?
1491 . ' if [ "${E}" != "0" ]; then' . "\n"
1492 . ' echo "`date`: DEBUG: build.sh exited with code ${E}"' . "\n"
1493 . ' ERR="build.sh returned ${E}"' . "\n"
1494 . ' break' . "\n"
1495 . ' fi' . "\n"
1496 . "\n"
1488 1497 . ' echo; echo "`date`: Running build_rpms.sh script"' . "\n" . ' echo; echo "`date`: Running build_rpms.sh script"' . "\n"
1489 1498 . ' date +%s > /mnt/T_RPMS_START' . "\n" . ' date +%s > /mnt/T_RPMS_START' . "\n"
1490 1499 . ' su - build -c "bash /mnt/build_rpms.sh" &>/mnt/status/build_rpms.log' . "\n" . ' su - build -c "bash /mnt/build_rpms.sh" &>/mnt/status/build_rpms.log' . "\n"
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://rocketgit.com/user/catalinux/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/rocketgit

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/rocketgit

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