mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 00:32:24 +00:00
New autobuild process
This commit is contained in:
parent
2e436a2d9e
commit
442f377b7e
5 changed files with 50 additions and 30 deletions
23
src/tools/autobuild/build-oberon.sh
Normal file
23
src/tools/autobuild/build-oberon.sh
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
# Build Oberon
|
||||||
|
#
|
||||||
|
# Args
|
||||||
|
#
|
||||||
|
# $1 - whether to use sudo
|
||||||
|
# $2 - build directory
|
||||||
|
# $3 - CC
|
||||||
|
|
||||||
|
if test "$1" = "sudo"; then sudo=sudo; else sudo=""; fi
|
||||||
|
|
||||||
|
echo Testing: \$1="$1", \$2="$2", \$3="$3", \$sudo="$sudo"
|
||||||
|
exit
|
||||||
|
|
||||||
|
set -x
|
||||||
|
cd $2
|
||||||
|
|
||||||
|
$sudo git reset --hard # Clear the staging area
|
||||||
|
$sudo git clean -dfx # Remove all untracked files
|
||||||
|
$sudo git pull # Update the local repository
|
||||||
|
$sudo git checkout -f $1 # Switch to requested branch
|
||||||
|
|
||||||
|
export CC=$3
|
||||||
|
$sudo make full
|
||||||
39
src/tools/make/buildall.pl → src/tools/autobuild/buildall.pl
Executable file → Normal file
39
src/tools/make/buildall.pl → src/tools/autobuild/buildall.pl
Executable file → Normal file
|
|
@ -10,26 +10,20 @@ my $branch = "master";
|
||||||
if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]}
|
if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]}
|
||||||
|
|
||||||
my %machines = (
|
my %machines = (
|
||||||
"pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc", "make full"],
|
"pi" => ['22', 'pi@pie', 'sh build-oberon.sh sudo projects/oberon/vishap/voc gcc'],
|
||||||
"darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"],
|
"darwin" => ['22', 'dave@dcb', 'sh build-oberon.sh sudo projects/oberon/vishap/voc clang'],
|
||||||
"cygwin" => ['-p5932 dave@wax', "", "oberon/cygwin/voc", "export CC=gcc && make full;"
|
"cygwin32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/cygwin/voc gcc'],
|
||||||
. "cd ~;"
|
"cygwin64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/cygwin/voc gcc\''],
|
||||||
. "sh start64.sh \\\"cd oberon/cygwin/voc &&"
|
"mingw32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc'],
|
||||||
. "src/tools/make/getbranch.sh $branch &&"
|
"mingw64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc\''],
|
||||||
. "export CC=gcc && make full;\\\""],
|
"android" => ['8022', 'root@and', 'sh build-oberon.sh n vishap/voc gcc'],
|
||||||
"mingw" => ['-p5932 dave@wax', "", "oberon/mingw/voc", "export CC=i686-w64-mingw32-gcc && make full;"
|
"lub64" => ['22', 'dave@vim', 'sh build-oberon.sh sudo oberon/voc gcc'],
|
||||||
. "cd ~;"
|
"lub32" => ['22', 'dave@vim-lub32', 'sh build-oberon.sh sudo oberon/voc gcc'],
|
||||||
. "sh start64.sh \\\"cd oberon/mingw/voc &&"
|
"fed64" => ['22', 'dave@vim-fed64', 'sh build-oberon.sh sudo oberon/voc gcc'],
|
||||||
. "src/tools/make/getbranch.sh $branch &&"
|
"osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc'],
|
||||||
. "export CC=x86_64-w64-mingw32-gcc && make full;\\\""],
|
"ob32" => ['22', 'root@nas-ob32', 'sh build-oberon.sh n vishap/voc gcc'],
|
||||||
"android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"],
|
"ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc'],
|
||||||
"lub64" => ['dave@vim', "sudo", "oberon/voc", "make full"],
|
"fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc']
|
||||||
"lub32" => ['dave@vim-lub32', "sudo", "oberon/voc", "make full"],
|
|
||||||
"fed64" => ['dave@vim-fed64', "sudo", "oberon/voc", "make full"],
|
|
||||||
"osu64" => ['dave@vim-osu64', "sudo", "oberon/voc", "make full"],
|
|
||||||
"ob32" => ['root@nas-ob32', "", "vishap/voc", "make full"],
|
|
||||||
"ce64" => ['-p5922 obe@www', "sudo", "vishap/voc", "make full"],
|
|
||||||
"fb64" => ['root@oberon', "", "vishap/voc", "make full"]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -61,8 +55,9 @@ sub logged {
|
||||||
unlink glob "log/*";
|
unlink glob "log/*";
|
||||||
|
|
||||||
for my $machine (sort keys %machines) {
|
for my $machine (sort keys %machines) {
|
||||||
my ($login, $sudo, $dir, $mkcmd) = @{$machines{$machine}};
|
my ($port, $login, $cmd) = @{$machines{$machine}};
|
||||||
my $cmd = "ssh $login \"cd $dir && git pull && git checkout -f && src/tools/make/getbranch.sh $branch && $sudo $mkcmd\" ";
|
my $cmd = "scp -P $port build-oberon.sh $login:build-oberon.sh &&"
|
||||||
|
. "ssh -p $port $login \"$cmd\"";
|
||||||
logged($cmd, $machine);
|
logged($cmd, $machine);
|
||||||
}
|
}
|
||||||
|
|
||||||
4
src/tools/make/postpush.pl → src/tools/autobuild/postpush.pl
Executable file → Normal file
4
src/tools/make/postpush.pl → src/tools/autobuild/postpush.pl
Executable file → Normal file
|
|
@ -41,9 +41,7 @@ if ($buildneeded) {
|
||||||
writelog "Started buildall, pid = $child."; # parent process
|
writelog "Started buildall, pid = $child."; # parent process
|
||||||
} else {
|
} else {
|
||||||
close(STDIN); close(STDOUT); close(STDERR); # child process
|
close(STDIN); close(STDOUT); close(STDERR); # child process
|
||||||
system 'echo Syncing voc>postpush.log';
|
exec 'perl buildall.pl ' . $branch . ' >/tmp/buildall.log';
|
||||||
system '(cd voc; git reset --hard; git clean -dfx; git pull; git checkout -f ' . $branch . '; git pull; git checkout -f) >>postpush.log';
|
|
||||||
exec 'perl voc/src/tools/make/buildall.pl ' . $branch . ' >/tmp/buildall.log';
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
9
src/tools/autobuild/update-webserver.sh
Normal file
9
src/tools/autobuild/update-webserver.sh
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
# Push buildall and postpush to postpush server
|
||||||
|
|
||||||
|
set -x
|
||||||
|
for f in postpush.pl buildall.pl; do
|
||||||
|
scp -P 5922 $f root@www:/var/lib/nethserver/ibay/githubhook/$f
|
||||||
|
ssh -p 5922 root@www "chmod +x /var/lib/nethserver/ibay/githubhook/$f"
|
||||||
|
done;
|
||||||
|
ssh -p 5922 root@www "ls -lap /var/lib/nethserver/ibay/githubhook"
|
||||||
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
set -x
|
|
||||||
git reset --hard # Clear the staging area
|
|
||||||
git clean -dfx # Remove all untracked files
|
|
||||||
git pull # Update the local repository
|
|
||||||
git checkout -f $1 # Switch to requested branch
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue