Skip to content

Commit

Permalink
Update package automation script
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHargrave committed Sep 8, 2017
1 parent a614bcf commit 9ffb28a
Showing 1 changed file with 29 additions and 18 deletions.
47 changes: 29 additions & 18 deletions packaging/dist_pk.fish
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,52 @@

require logging

set scr_dir (dirname (status -f))
set scr_dir (realpath (dirname (status -f)))
set scm 'git://github.com/blt4linux/blt4l.git'

set -q git_name; or set git_name master

info packaging!

function chr_bld -a chroot_name
info building $chroot_name

set chroot_home $HOME
set pkbase $chroot_home/blt4l/
set pkdir /var/chroots/$chroot_name/$pkbase/packaging

function chdo -S

set chroot_data $scr_dir/chroot_data/$chroot_name/
set pkbase $chroot_data/blt
set pkbin $chroot_data/bin

test -d $chroot_data; or mkdir -p $chroot_data
test -d $pkbin; or mkdir -p $pkbin

info "chroot data in $chroot_data"
info "repo base in $pkbase"
info "repo bin in $pkbin"

function chgit -S
info "($chroot_name) $argv"
schroot --directory $pkbase -c $chroot_name -- $argv
end

# Remove repo
if [ -d /var/chroots/$chroot_name/$pkbase ]
chdo rm -rf $pkbase/.git
chdo rm -r $pkbase
if [ -d $pkbase ]
rm -rf $pkbase/.git
rm -r $pkbase
end

# Remove build dir
if [ -d $pkdir/package_build ]
rm -r $pkdir/package_build
if [ -d $pkbin ]
rm -r $pkbin
end

info checking out blt4l
begin
if schroot --directory $chroot_home -c $chroot_name -- git clone --recursive $scm $pkbase
if chdo git checkout (chdo git tag | sort -V | tail -1)
if schroot --directory $chroot_data -c $chroot_name -- git clone --recursive $scm $pkbase
if chgit git checkout $git_name
# Run build
if schroot --directory $pkbase/packaging -c $chroot_name ./package.sh
if schroot --directory $pkbase/packaging -c $chroot_name -- env BUILD_DIR="$pkbin" ./package.sh
# Move artifacts out of chroot
mv $pkdir/*.tar.xz $scr_dir/ ^/dev/null
mv $pkbin/*.tar.xz $scr_dir/ ^/dev/null
else
error build in $chroot_name failed
end
Expand All @@ -63,10 +73,11 @@ end

cd $scr_dir

chr_bld ubuntu_trusty
# chr_bld ubuntu_precise # steamrt
chr_bld ubuntu_precise # steamrt
chr_bld fc26

set -x CMAKE_CXX_COMPILER (which g++4.8)
set -x CMAKE_C_COMPILER (which gcc-4.8)

./package.sh
cp ./package_build/*.xz .

0 comments on commit 9ffb28a

Please sign in to comment.