diff options
-rwxr-xr-x | build.sh | 7 | ||||
-rwxr-xr-x | tools/build_snapshots.sh | 13 | ||||
-rw-r--r-- | tools/builder_common.sh | 10 | ||||
-rw-r--r-- | tools/builder_defaults.sh | 6 |
4 files changed, 14 insertions, 22 deletions
@@ -78,7 +78,8 @@ usage() { exit 1 } -export BUILDER_SCRIPTS=$(realpath $(dirname ${0})) +export BUILDER_ROOT=$(realpath $(dirname ${0})) +export BUILDER_TOOLS="${BUILDER_ROOT}/tools" unset _SKIP_REBUILD_PRESTAGE unset _USE_OLD_DATESTRING @@ -200,10 +201,10 @@ while test "$1" != ""; do done # Suck in local vars -. ${BUILDER_SCRIPTS}/builder_defaults.sh +. ${BUILDER_TOOLS}/builder_defaults.sh # Suck in script helper functions -. ${BUILDER_SCRIPTS}/builder_common.sh +. ${BUILDER_TOOLS}/builder_common.sh # Print var required with -V and exit if [ -n "${var_to_print}" ]; then diff --git a/tools/build_snapshots.sh b/tools/build_snapshots.sh index 7e1c1e1..c621c35 100755 --- a/tools/build_snapshots.sh +++ b/tools/build_snapshots.sh @@ -138,18 +138,14 @@ rotate_logfile() { } dobuilds() { - - cd $BUILDER_SCRIPTS # Build images - ./build.sh --flash-size '1g 2g 4g' "iso memstick memstickserial memstickadi fullupdate nanobsd nanobsd-vga" + (cd ${BUILDER_ROOT} && ./build.sh --flash-size '1g 2g 4g' "iso memstick memstickserial memstickadi fullupdate nanobsd nanobsd-vga") # Copy files copy_to_staging_iso_updates copy_to_staging_nanobsd '1g 2g 4g' } copy_to_staging_nanobsd() { - cd $BUILDER_SCRIPTS - for NANOTYPE in nanobsd nanobsd-vga; do for FILESIZE in ${1}; do FILENAMEFULL="${PRODUCT_NAME}-${PRODUCT_VERSION}-${FILESIZE}-${TARGET}-${NANOTYPE}-${DATESTRING}.img.gz" @@ -182,8 +178,6 @@ copy_to_staging_nanobsd() { } copy_to_staging_iso_updates() { - cd $BUILDER_SCRIPTS - # Copy ISOs md5 ${ISOPATH}.gz > ${ISOPATH}.md5 sha256 ${ISOPATH}.gz > ${ISOPATH}.sha256 @@ -211,7 +205,6 @@ copy_to_staging_iso_updates() { } scp_files() { - cd $BUILDER_SCRIPTS if [ -z "${RSYNC_COPY_ARGUMENTS:-}" ]; then RSYNC_COPY_ARGUMENTS="-ave ssh --timeout=60 --bwlimit=${RSYNCKBYTELIMIT}" #--bwlimit=50 fi @@ -287,17 +280,15 @@ scp_files() { } cleanup_builds() { - cd $BUILDER_SCRIPTS # Remove prior builds update_status ">>> Cleaning up after prior builds..." rm -rf $STAGINGAREA/* rm -f $UPDATESDIR/* # Keep updates dir slimmed down rm -rf $MAKEOBJDIRPREFIXFINAL/* - ./build.sh --clean-builder + (cd ${BUILDER_ROOT} && ./build.sh --clean-builder) } build_loop_operations() { - cd $BUILDER_SCRIPTS update_status ">>> Starting build loop operations" # --- Items we need to run for a complete build run --- # Cleanup prior builds diff --git a/tools/builder_common.sh b/tools/builder_common.sh index 3ea3142..53a283b 100644 --- a/tools/builder_common.sh +++ b/tools/builder_common.sh @@ -71,7 +71,7 @@ core_pkg_create() { [ -d "${CORE_PKG_TMP}" ] \ && rm -rf ${CORE_PKG_TMP} - local _templates_path=${BUILDER_SCRIPTS}/templates/core_pkg/${_template} + local _templates_path=${BUILDER_TOOLS}/templates/core_pkg/${_template} local _template_metadir=${_templates_path}/metadir local _metadir=${CORE_PKG_TMP}/${_template}_metadir @@ -881,7 +881,7 @@ ova_setup_ovf_file() { fi if [ ! -f ${OVFPATH}/${PRODUCT_NAME}.ovf ]; then - cp ${BUILDER_SCRIPTS}/conf/ovf/${PRODUCT_NAME}.ovf ${OVFPATH}/${PRODUCT_NAME}.ovf + cp ${BUILDER_TOOLS}/conf/ovf/${PRODUCT_NAME}.ovf ${OVFPATH}/${PRODUCT_NAME}.ovf file_search_replace PRODUCT_VERSION $PRODUCT_VERSION ${OVFPATH}/${PRODUCT_NAME}.ovf file_search_replace PRODUCT_URL $PRODUCT_URL ${OVFPATH}/${PRODUCT_NAME}.ovf fi @@ -1111,7 +1111,7 @@ clone_to_staging_area() { -e "s,%%PRODUCT_NAME%%,${PRODUCT_NAME},g" \ -e "s,%%FLAVOR%%,${_flavor},g" \ -e "s,%%VERSION%%,${_version},g" \ - ${BUILDER_SCRIPTS}/templates/core_pkg/base/exclude_files \ + ${BUILDER_TOOLS}/templates/core_pkg/base/exclude_files \ > ${_exclude_files} mkdir -p ${STAGE_CHROOT_DIR}/usr/local/share/${PRODUCT_NAME} >/dev/null 2>&1 @@ -1938,8 +1938,8 @@ poudriere_bulk() { if [ "${CUR_BRANCH}" != "${GIT_REPO_BRANCH_OR_TAG}" ] && git show "${GIT_REPO_BRANCH_OR_TAG}:builder_scripts/conf/pfPorts/make.conf" >/dev/null 2>&1; then git show "origin/${GIT_REPO_BRANCH_OR_TAG}:builder_scripts/conf/pfPorts/make.conf" > /usr/local/etc/poudriere.d/${POUDRIERE_PORTS_NAME}-make.conf - elif [ -f "${BUILDER_SCRIPTS}/conf/pfPorts/make.conf" ]; then - cp -f "${BUILDER_SCRIPTS}/conf/pfPorts/make.conf" /usr/local/etc/poudriere.d/${POUDRIERE_PORTS_NAME}-make.conf + elif [ -f "${BUILDER_TOOLS}/conf/pfPorts/make.conf" ]; then + cp -f "${BUILDER_TOOLS}/conf/pfPorts/make.conf" /usr/local/etc/poudriere.d/${POUDRIERE_PORTS_NAME}-make.conf fi for jail_arch in ${_archs}; do diff --git a/tools/builder_defaults.sh b/tools/builder_defaults.sh index a01b31d..12a8333 100644 --- a/tools/builder_defaults.sh +++ b/tools/builder_defaults.sh @@ -61,10 +61,10 @@ local _curdir=$(basename $(dirname ${0})) if [ "${_curdir}" = "tools" ]; then - export BUILDER_SCRIPTS=$(realpath ${_curdir}) + export BUILDER_TOOLS=$(realpath ${_curdir}) export BUILDER_ROOT=$(realpath "${_curdir}/..") else - export BUILDER_SCRIPTS=$(realpath "${_curdir}/tools") + export BUILDER_TOOLS=$(realpath "${_curdir}/tools") export BUILDER_ROOT=$(realpath "${_curdir}") fi @@ -127,7 +127,7 @@ export ZFS_TANK=${ZFS_TANK:-"tank"} export ZFS_ROOT=${ZFS_ROOT:-"/poudriere"} export POUDRIERE_PORTS_NAME=${POUDRIERE_PORTS_NAME:-${PRODUCT_NAME}_${GIT_REPO_BRANCH_OR_TAG}} -export POUDRIERE_BULK=${POUDRIERE_BULK:-${BUILDER_SCRIPTS}/conf/pfPorts/poudriere_bulk} +export POUDRIERE_BULK=${POUDRIERE_BULK:-${BUILDER_TOOLS}/conf/pfPorts/poudriere_bulk} export POUDRIERE_PORTS_GIT_URL=${POUDRIERE_PORTS_GIT_URL:-"git@git.pfmechanics.com:pfsense/freebsd-ports.git"} export POUDRIERE_PORTS_GIT_BRANCH=${POUDRIERE_PORTS_GIT_BRANCH:-"devel"} |