diff --git a/builder b/builder index 6e1be07..eb12762 100755 --- a/builder +++ b/builder @@ -9,7 +9,7 @@ source environment version=$1 package=python3 -package_name=package +package_name=$package echo "$(date) setting global vars..." libc6_version=$( dpkg -s libc6 | grep Version | cut -d':' -f2 | cut -d' ' -f2 | cut -d'-' -f1) @@ -77,8 +77,22 @@ echo "$(date) building deb package..." dpkg-deb --build $deb_package rm -r $src_dir/$dl_name-$version rm -r $build_dir/$deb_package -cp $build_dir/$deb_package.deb /root/ +datetime=$(/bin/date "+%Y-%m-%d-%H%M") + +for del in $(aptly repo search bashclub | grep $package_name | grep ${dpkg_arch}); do + aptly repo remove bashclub $package_name +done + +aptly repo add bashclub $build_dir/$deb_package.deb + +aptly snapshot create $datetime-bashclub from repo bashclub + +aptly publish drop $(lsb_release -cs) debian + +aptly publish snapshot -distribution="$(lsb_release -cs)" $datetime-bashclub debian + +/bin/systemctl restart aptly.service echo "Build succeeded! You can find the .deb package at: /root/$deb_package.deb" exit 0