mirror of
https://github.com/YunoHost/cd_build.git
synced 2024-09-03 20:06:24 +02:00
First version of auto_build
This script is design to be executed by a cron task.
This commit is contained in:
parent
3e84c8c3c6
commit
bc5f3f18a3
1 changed files with 37 additions and 0 deletions
37
auto_build.sh
Normal file
37
auto_build.sh
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Get the script directory
|
||||||
|
script_dir="$(dirname $(realpath $0))"
|
||||||
|
|
||||||
|
repo_url="http://repo.yunohost.org/debian/"
|
||||||
|
|
||||||
|
# Find the release version of YunoHost
|
||||||
|
get_ynh_release () {
|
||||||
|
wget --quiet ${repo_url}dists/${deb_dist}/${dist}/binary-i386/Packages.gz -O "$script_dir/Packages.gz"
|
||||||
|
gunzip "$script_dir/Packages.gz"
|
||||||
|
grep "^Package: yunohost$" --after-context=1 "$script_dir/Packages" | grep "Version" | awk '{print $2;}'
|
||||||
|
rm "$script_dir/Packages"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Compare the last available release with the previous one
|
||||||
|
compare_version () {
|
||||||
|
new_version="$1"
|
||||||
|
version_file="$script_dir/ynh_${deb_dist}_${dist}"
|
||||||
|
old_version=$(cat "$version_file" 2> /dev/null)
|
||||||
|
if [ "$new_version" != "$old_version" ]
|
||||||
|
then
|
||||||
|
echo "$new_version" > "$version_file"
|
||||||
|
echo ">>> Build a new iso for YunoHost $dist on $deb_dist i386" | tee -a "$script_dir/ynh_build.log"
|
||||||
|
"$script_dir/build-yunohost" i386 $dist $deb_dist 2>&1 | tee -a "$script_dir/ynh_build.log"
|
||||||
|
|
||||||
|
echo ">>> Build a new iso for YunoHost $dist on $deb_dist amd64" | tee -a "$script_dir/ynh_build.log"
|
||||||
|
"$script_dir/build-yunohost" amd64 $dist $deb_dist 2>&1 | tee -a "$script_dir/ynh_build.log"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
deb_dist=jessie
|
||||||
|
dist=stable
|
||||||
|
compare_version "$(get_ynh_release)"
|
||||||
|
|
||||||
|
dist=testing
|
||||||
|
compare_version "$(get_ynh_release)"
|
Loading…
Add table
Reference in a new issue