Initial
This commit is contained in:
30
deploy-package
Executable file
30
deploy-package
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
cd $(dirname $(realpath $0))/..
|
||||
|
||||
[[ ! -f apt.conf.sh ]] && echo "No apt.conf.sh in $(pwd) - aborting" && exit 1
|
||||
|
||||
. apt.conf.sh
|
||||
|
||||
[[ -z $REPO_NAME ]] && REPO_NAME='stable'
|
||||
|
||||
basepath=$DEBIAN_BASEPATH
|
||||
dpath=dists/$REPO_NAME/main/binary-amd64/
|
||||
|
||||
# in case this is unset - false just stays, since false != -z (???)
|
||||
[[ -z "$delete_old" ]] && delete_old=false
|
||||
|
||||
if ! $delete_old; then
|
||||
read -p "$(echo -e "\e[1;31mSollen alle alten Versionen gelöscht werden? [N,y]: \e[0m")" del_old
|
||||
[[ "$del_old" =~ y|Y ]] && delete_old=true
|
||||
fi
|
||||
|
||||
if $delete_old; then
|
||||
_delcmd="find $basepath -name '${PACKAGE_NAME}_*.deb' -delete"
|
||||
echo "sudo -uuser ssh $DEBHOST $_delcmd"
|
||||
sudo -uuser ssh $DEBHOST $_delcmd
|
||||
fi
|
||||
|
||||
sudo -uuser rsync -av $dpath $DEBHOST:$basepath/pool/main/
|
||||
find dists -name '*.deb' -delete
|
||||
sudo -uuser ssh $DEBHOST bash $basepath/update-apt-repo
|
||||
|
||||
Reference in New Issue
Block a user