build: fixes

This commit is contained in:
nachoparker 2017-12-02 21:04:30 +01:00
parent d40360c82e
commit a13446ec59
2 changed files with 10 additions and 13 deletions

View File

@ -22,6 +22,8 @@ IMGBASE="NextCloudPi_$( date "+%m-%d-%y" )_base.img"
export NO_CONFIG=1 # skip interactive configuration
## BUILD
download_resize_raspbian_img 1G "$IMGBASE" || exit 1
NO_HALT_STEP=1 ./installer.sh prepare.sh "$IP" "$IMGBASE" || exit 1
@ -32,11 +34,15 @@ NO_HALT_STEP=1 ./installer.sh prepare.sh "$IP" "$IMGBASE"
./installer.sh raspbian-cleanup.sh "$IP" "$( ls -1t *.img | head -1 )" || exit 1
# ./installer.sh build-devel.sh "$IP" "$( ls -1t *.img | head -1 )" || exit 1
## PACKING
IMGFILE=$( ls -1t *.img | head -1 )
IMGNAME=$( basename "$IMGFILE" _base_prepare_lamp_nc-nextcloud_nextcloudpi_nc-init_raspbian-cleanup.img )
[[ "$IMGNAME" != "" ]] || exit 1
pack_image "$IMGFILE" "$IMGNAME.img"
## TESTING
launch_qemu "$IMGNAME.img" &
@ -47,24 +53,14 @@ tests/tests.py "$IP" || exit 1
ssh_pi "$IP" sudo halt
## PACKING
pack_image "$IMGFILE" "$IMGNAME.img"
create_torrent "${IMGNAME}.tar.bz2"
## UPLOADING
create_torrent "${IMGNAME}.tar.bz2"
upload_ftp "$IMGNAME"
## GENERATE CHANGELOG
generate_changelog
## CLEANUP
mkdir -p partial && mv NextCloudPi*.bz2 partial
rm -f *.img
# License

View File

@ -241,7 +241,7 @@ function prepare_sshd()
function upload_ftp()
{
local IMGNAME="$1"
[[ -f "$IMGNAME" ]] || { echo "No image file found, abort"; return 1; }
[[ -f torrent/"$IMGNAME"/"$IMGNAME".tar.bz2 ]] || { echo "No image file found, abort"; return 1; }
[[ "$FTPPASS" == "" ]] && { echo "No FTPPASS variable found, abort"; return 1; }
cd torrent
@ -255,13 +255,14 @@ put $IMGNAME.torrent
bye
EOF
cd -
cd $IMGNAME
cd torrent/$IMGNAME
ftp -np ftp.ownyourbits.com <<EOF
user root@ownyourbits.com $FTPPASS
cd $IMGNAME
binary
put $IMGNAME.tar.bz2
put md5sum
bye
EOF
cd -