Menu

[r8824]: / projects / cli / tools / end2end-build.sh  Maximize  Restore  History

Download this file

103 lines (83 with data), 1.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
#!/bin/sh
#
# Copy this somewhere else and edit to your heart's content.
#
# Space added in places to avoid potential merge conflicts.
#
# Values you shouldn't change.
clean=true
# Define beforehand to work around shell bugs.
tmpdir=/dev/null
# Values you can and should change.
branch=trunk
cvsup_host=cvsup1.freebsd.org
default_archs="amd64 i386"
setup() {
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export SHELL=/bin/sh
tmpdir=$(mktemp -d e2e-bld.XXXXXXXX)
chmod 0755 $tmpdir
pull $tmpdir
cd $tmpdir
}
cleanup() {
sudo rm -Rf $tmpdir
}
pull() {
svn co https://freenas.svn.sourceforge.net/svnroot/freenas/$branch $1
}
post_images() {
(cd obj.$arch
for img in *.iso *.xz; do
sudo sh -c "sha256 $img > $img.sha256.txt"
scp -o BatchMode=yes $img* \
yaberauneya,freenas@frs.sourceforge.net:/home/frs/project/f/fr/freenas/FreeNAS-8-nightly
done)
}
while getopts 'A:b:c:t:' optch; do
case "$optch" in
A)
case "$OPTARG" in
amd64|i386)
;;
*)
echo "${0##*/}: ERROR: unknown architecture: $OPTARG"
;;
esac
archs="$archs $OPTARG"
;;
b)
branch=$OPTARG
;;
c)
cvsup_host=$OPTARG
;;
C)
clean=false
;;
*)
echo "${0##*/}: ERROR: unhandled/unknown option: $optch"
exit 1
;;
esac
done
: ${archs=$default_archs}
set -e
setup
set +e
for arch in $archs; do
# Build
BUILD="env FREEBSD_CVSUP_HOST=$cvsup_host sh build/do_build.sh"
# Build twice so the resulting image is smaller than the fat image
# required for producing ports.
# XXX: this should really be done in the nanobsd files to only have to
# do this once, but it requires installing world twice.
if sudo sh -c "export FREENAS_ARCH=$arch; $BUILD -- -fi && $BUILD"; then
post_images
else
clean=false
fi
done
if $clean; then
cleanup
fi
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.