mirror of
https://github.com/YunoHost/cd_build.git
synced 2024-09-03 20:06:24 +02:00
Prepare the way for an automatic usage (#2)
* Prepare the way for an automatic usage * Remove tmp before each build
This commit is contained in:
parent
25382e135c
commit
e9605c97fe
1 changed files with 31 additions and 25 deletions
|
@ -4,15 +4,13 @@
|
||||||
# DIST stable|testing
|
# DIST stable|testing
|
||||||
# DEB_DIST jessie|stretch
|
# DEB_DIST jessie|stretch
|
||||||
|
|
||||||
DATE=$(date +%m%d%y%H%M)
|
DEFAULT_DEB_DIST="jessie"
|
||||||
DEBNUM='8.9'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Build Yunohost iso for amd64 or i386 arch
|
# Build Yunohost iso for amd64 or i386 arch
|
||||||
# Usage: build ARCH
|
# Usage: build ARCH
|
||||||
function build
|
function build
|
||||||
{
|
{
|
||||||
|
local ARCH="$1"
|
||||||
REPO_URL="http://repo.yunohost.org/debian/"
|
REPO_URL="http://repo.yunohost.org/debian/"
|
||||||
if [ "$DIST" = "testing" ] ; then
|
if [ "$DIST" = "testing" ] ; then
|
||||||
sed -i "s#$REPO_URL jessie stable#$REPO_URL $DEB_DIST stable testing#" profiles/*.preseed
|
sed -i "s#$REPO_URL jessie stable#$REPO_URL $DEB_DIST stable testing#" profiles/*.preseed
|
||||||
|
@ -21,41 +19,49 @@ function build
|
||||||
sed -i "s#$REPO_URL jessie stable testing#$REPO_URL $DEB_DIST stable#" profiles/*.preseed
|
sed -i "s#$REPO_URL jessie stable testing#$REPO_URL $DEB_DIST stable#" profiles/*.preseed
|
||||||
sed -i "s#$REPO_URL stretch stable testing#$REPO_URL $DEB_DIST stable#" profiles/*.preseed
|
sed -i "s#$REPO_URL stretch stable testing#$REPO_URL $DEB_DIST stable#" profiles/*.preseed
|
||||||
fi
|
fi
|
||||||
build-simple-cdd --dist $DEB_DIST --conf ./simple-cdd-$1.conf
|
build-simple-cdd --dist $DEB_DIST --conf ./simple-cdd-$ARCH.conf
|
||||||
$(pwd)/add-firmware-to images/debian-$DEBNUM-$1-CD-1.iso images/yunohost-$DEB_DIST-$DATE-$1-$DIST.iso $DEB_DIST
|
|
||||||
rm images/debian-$DEBNUM-$1-CD-1.iso
|
# Find the release version of debian
|
||||||
rm images/debian-$DEBNUM-$1-CD-1.list.gz
|
DEBNUM="$(grep "Version:" tmp/${DEB_DIST}_Release | awk '{print $2;}')"
|
||||||
|
|
||||||
|
# Find the release version of YunoHost
|
||||||
|
wget ${REPO_URL}dists/${DEB_DIST}/${DIST}/binary-i386/Packages.gz
|
||||||
|
gunzip Packages.gz
|
||||||
|
YNH_VERSION=$(grep "^Package: yunohost$" --after-context=1 Packages | grep "Version" | awk '{print $2;}')
|
||||||
|
rm Packages
|
||||||
|
|
||||||
|
rm -f images/yunohost-$DEB_DIST-$YNH_VERSION-$ARCH-$DIST.iso
|
||||||
|
$(pwd)/add-firmware-to images/debian-$DEBNUM-$ARCH-CD-1.iso images/yunohost-$DEB_DIST-$YNH_VERSION-$ARCH-$DIST.iso $DEB_DIST
|
||||||
|
rm images/debian-$DEBNUM-$ARCH-CD-1.iso
|
||||||
|
rm images/debian-$DEBNUM-$ARCH-CD-1.list.gz
|
||||||
}
|
}
|
||||||
|
|
||||||
# Sign the new iso
|
# Sign the new iso
|
||||||
# Usage: sign ARCH
|
# Usage: sign ARCH
|
||||||
function sign
|
function sign
|
||||||
{
|
{
|
||||||
NAME="images/yunohost-$DEB_DIST-$DATE-$1-$DIST.iso"
|
local ARCH="$1"
|
||||||
|
NAME="images/yunohost-$DEB_DIST-$YNH_VERSION-$ARCH-$DIST.iso"
|
||||||
gpg --output $NAME.sig --detach-sig $NAME
|
gpg --output $NAME.sig --detach-sig $NAME
|
||||||
sha256sum $NAME > images/SHA256SUM
|
sha256sum $NAME > $NAME.sum
|
||||||
}
|
}
|
||||||
|
|
||||||
function build_and_sign
|
function build_and_sign
|
||||||
{
|
{
|
||||||
build $1
|
rm -r $(pwd)/tmp
|
||||||
sign $1
|
|
||||||
|
local ARCH="$1"
|
||||||
|
build $ARCH
|
||||||
|
sign $ARCH
|
||||||
}
|
}
|
||||||
|
|
||||||
rm -r $(pwd)/tmp
|
DIST="${2:-stable}"
|
||||||
DIST=$2
|
DEB_DIST="${3:-$DEFAULT_DEB_DIST}"
|
||||||
if [[ "${2:-1}" = 1 ]]; then
|
|
||||||
DIST='stable'
|
|
||||||
fi
|
|
||||||
DEB_DIST=$3
|
|
||||||
if [[ "${3:-1}" = 1 ]]; then
|
|
||||||
DEB_DIST='jessie'
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${1:-1}" = 1 ]]
|
if [ -z "$1" ]
|
||||||
then
|
then
|
||||||
build_and_sign i386
|
build_and_sign i386
|
||||||
build_and_sign amd64
|
build_and_sign amd64
|
||||||
else
|
else
|
||||||
build_and_sign $1
|
build_and_sign $1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue