build: ease the release process workflow
This commit is contained in:
parent
7fe1e6aa16
commit
14bef4837f
|
@ -29,6 +29,7 @@ set -e
|
|||
|
||||
# important build settings
|
||||
export PRODUCT_NAME="OPNsense"
|
||||
export PRODUCT_VERSION=${PRODUCT_VERSION:-"`date '+%Y%m%d%H%M'`"}
|
||||
|
||||
# build directories
|
||||
export STAGEDIR="/usr/local/stage"
|
||||
|
@ -50,9 +51,9 @@ export TARGETARCH=${ARCH}
|
|||
export LABEL="OPNsense_Install"
|
||||
|
||||
# target files
|
||||
export ISOPATH="${IMAGESDIR}/${PRODUCT_NAME}-LiveCD-${ARCH}-`date '+%Y%m%d-%H%M'`.iso"
|
||||
export MEMSTICKPATH="${IMAGESDIR}/${PRODUCT_NAME}-memstick-${ARCH}-`date '+%Y%m%d-%H%M'`.img"
|
||||
export MEMSTICKSERIALPATH="${IMAGESDIR}/${PRODUCT_NAME}-memstick-serial-${ARCH}-`date '+%Y%m%d-%H%M'`.img"
|
||||
export ISOPATH="${IMAGESDIR}/${PRODUCT_NAME}-${PRODUCT_VERSION}-LiveCD-${ARCH}.iso"
|
||||
export MEMSTICKPATH="${IMAGESDIR}/${PRODUCT_NAME}-${PRODUCT_VERSION}-memstick-${ARCH}.img"
|
||||
export MEMSTICKSERIALPATH="${IMAGESDIR}/${PRODUCT_NAME}-${PRODUCT_VERSION}-memstick-serial-${ARCH}.img"
|
||||
|
||||
# print environment to showcase all of our variables
|
||||
env
|
||||
|
|
|
@ -49,6 +49,6 @@ cd ${STAGEDIR} && pkg repo .
|
|||
|
||||
echo -n ">>> Creating packages set... "
|
||||
|
||||
tar -cf ${SETSDIR}/packages-`date '+%Y%m%d'`-${ARCH}.tar .
|
||||
tar -cf ${SETSDIR}/packages-${PRODUCT_VERSION}-${ARCH}.tar .
|
||||
|
||||
echo "done"
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2015 Franco Fichtner <franco@opnsense.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
|
||||
set -e
|
||||
|
||||
if [ -n "${1}" ]; then
|
||||
# pull in a real release tag
|
||||
PRODUCT_VERSION=${1}
|
||||
fi
|
||||
|
||||
. ./common.sh
|
||||
|
||||
rm -f ${SETSDIR}/release-*-${ARCH}.tar
|
||||
|
||||
echo ">>> Creating packages for ${PRODUCT_VERSION}"
|
||||
|
||||
cd ${TOOLSDIR}/build && ./packages.sh
|
||||
|
||||
echo ">>> Creating images for ${PRODUCT_VERSION}"
|
||||
|
||||
cd ${TOOLSDIR}/build && ./clean.sh images
|
||||
cd ${TOOLSDIR}/build && ./memstick.sh
|
||||
cd ${TOOLSDIR}/build && ./iso.sh
|
||||
|
||||
setup_stage ${STAGEDIR}
|
||||
|
||||
echo ">>> Compressing images for ${PRODUCT_VERSION}"
|
||||
|
||||
mv ${IMAGESDIR}/${PRODUCT_NAME}-* ${STAGEDIR}
|
||||
bzip2 ${STAGEDIR}/${PRODUCT_NAME}-*
|
||||
mkdir -p ${STAGEDIR}/tmp
|
||||
|
||||
echo ">>> Checksumming images for ${PRODUCT_VERSION}"
|
||||
|
||||
cd ${STAGEDIR} && sha256 ${PRODUCT_NAME}-* > tmp/${PRODUCT_NAME}-${PRODUCT_VERSION}-checksums.sha256
|
||||
cd ${STAGEDIR} && md5 ${PRODUCT_NAME}-* > tmp/${PRODUCT_NAME}-${PRODUCT_VERSION}-checksums.md5
|
||||
|
||||
mv tmp/* .
|
||||
rm -rf tmp
|
||||
|
||||
echo ">>> Bundling images for ${PRODUCT_VERSION}"
|
||||
|
||||
tar -cf ${SETSDIR}/release-${PRODUCT_VERSION}-${ARCH}.tar .
|
Loading…
Reference in New Issue