This repository has been archived on 2020-01-17. You can view files and clone it, but cannot push or open issues or pull requests.
vn-repo/vn-deploy

35 lines
552 B
Plaintext
Raw Normal View History

2018-04-19 10:35:41 +00:00
#!/bin/bash
set -e
hosts=$1
if [ -z "$hosts" ]
then
echo "Usage: $(basename $0) host1 [host2]..."
exit 1
fi
packages=""
2018-04-19 11:05:34 +00:00
while read -r line
2018-04-19 10:35:41 +00:00
do
2018-04-19 11:05:34 +00:00
packageName=$(echo $line | cut -d"_" -f1)
2018-04-19 10:35:41 +00:00
packages="$packages $packageName"
2018-04-19 11:05:34 +00:00
done < "$PWD/debian/files"
2018-04-19 10:35:41 +00:00
if [ -z "$packages" ]
then
2018-04-19 11:05:34 +00:00
echo "No packages found to install."
2018-04-19 10:35:41 +00:00
exit 1
fi
# FIXME: Packages are not upgraded when config files are changed
echo "Upgrading servers."
for host in $hosts
do
echo " * Upgrading $host"
ssh root@$host "update-repo vn && apt-get install $packages"
done