aboutsummaryrefslogtreecommitdiffstats
path: root/push-images.sh
blob: f259c543a51161db42e58b289f7cd9dc99e8c66e (plain)
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
#!/bin/sh

dest="$HOME/repo/images-testing"

if test ! -d "$dest"; then
	echo "# destdir not found ($dest)"
	exit
fi

images=$(ls	${IMAGEFISH_DESTDIR-.}/*.raw	\
		${IMAGEFISH_DESTDIR-.}/*.qcow2	\
		2>/dev/null)
count=$(echo $images | wc -w)

if test "$count" = "0"; then
	echo "# no images found"
	exit
fi

echo
echo "### rsync $count uncompressed image(s)"
echo
rsync --verbose --progress --inplace	\
	$images $dest

echo
echo "### compress $count image(s)"
echo
rm -f ${IMAGEFISH_DESTDIR-.}/*.xz
xz --verbose --keep $images

echo
echo "### rsync compressed image(s)"
echo
rsync --verbose --progress --inplace	\
	${IMAGEFISH_DESTDIR-.}/*.xz	\
	$dest