test-distro.sh 573 Bytes
Newer Older
Tomas Krizek's avatar
Tomas Krizek committed
1 2
#!/bin/bash -x

3 4
# ./test-distro.sh {devel|latest} {distro}
# Example usage: ./test-distro.sh devel debian9
Tomas Krizek's avatar
Tomas Krizek committed
5

6 7 8 9 10 11 12 13 14
distro=$2
repo=$1

# Select repos
echo -e 'repos:\n  - knot-resolver-latest' > repos.yaml  # latest is needed for knot
case "$repo" in
	devel)
		echo -e '  - knot-resolver-devel' >> repos.yaml
		;;
15 16 17
	testing)
		echo -e 'repos:\n  - knot-resolver-testing' > repos.yaml
		;;
18 19 20
	latest)
		;;
	*)
21
		echo "Unknown repo, choose devel|latest|testing"
22 23 24 25 26
		exit 1
		;;
esac

cd "$distro"
27
vagrant destroy -f &>/dev/null
Tomas Krizek's avatar
Tomas Krizek committed
28 29
vagrant up
ret=$?
30
vagrant destroy -f &>/dev/null
Tomas Krizek's avatar
Tomas Krizek committed
31 32
exit $ret