Browse Source

Separate out the config variables

Still provide sensible (debug) defaults. "Sensible" is defined as per my
environment.

Signed-off-by:	Shawn Webb <shawn.webb@hardenedbsd.org>
pull/4/head
Shawn Webb 11 months ago
parent
commit
039c300133
Signed by: shawn.webb <shawn.webb@hardenedbsd.org> GPG Key ID: FF2E67A277F8E1FA
2 changed files with 77 additions and 19 deletions
  1. +30
    -19
      bin/ci.sh
  2. +47
    -0
      lib/config.sh

+ 30
- 19
bin/ci.sh View File

@@ -24,27 +24,38 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.

. ./lib/build.sh
. ./lib/log.sh
. ./lib/publish.sh
. ./lib/util.sh
get_topdir() {
local self

self=${1}

echo $(realpath $(dirname ${self}))
return ${?}
}

TOPDIR=$(get_topdir ${0})

. ${TOPDIR}/../lib/build.sh
. ${TOPDIR}/../lib/config.sh
. ${TOPDIR}/../lib/log.sh
. ${TOPDIR}/../lib/publish.sh
. ${TOPDIR}/../lib/util.sh

main() {
HBSD_INDEX_FILE=/build/index
HBSD_KERNEL=HARDENEDBSD
HBSD_LOCKFILE=/tmp/13-current.amd64.lock
HBSD_NJOBS=4
HBSD_OBJRELDIR=/usr/obj/scratch/src/hbsd-13/amd64.amd64/release
HBSD_PUBDIR=/build/pub
HBSD_SRC=/scratch/src/hbsd-13
HBSD_STAGEDIR=/build/stage
HBSD_TARGET=amd64
HBSD_TARGET_ARCH=amd64
HBSD_NOCLEAN="-DNO_CLEAN"
HBSD_LOGDIR=/build/logs/13-current.amd64
local self

self=${0}
shift

config_set_defaults

HBSD_BUILDNUMBER=$(build_number)
HBSD_BUILD_LOG=${HBSD_LOGDIR}/${HBSD_BUILDNUMBER}.log
while getopts 'c:' o; do
case "${o}" in
c)
source "${OPTARG}"
;;
esac
done

(
assert_unlocked && \
@@ -57,7 +68,7 @@ main() {
publish_release && \
kick_publisher_tires && \
unlock_build
) | build_log
) | build_log 2>&1
return ${?}
}



+ 47
- 0
lib/config.sh View File

@@ -0,0 +1,47 @@
#!/bin/sh
#-
# Copyright (c) 2019 HardenedBSD
# Author: Shawn Webb <shawn.webb@hardenedbsd.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.

config_set_defaults() {
HBSD_GPG_KEY=""
#HBSD_GPG_KEY="BB53388D3BD9892815CB9E30819B11A26FFD188D"
HBSD_INDEX_FILE=/build/index
HBSD_KERNEL=HARDENEDBSD
HBSD_LOCKFILE=/tmp/13-current.amd64.lock
HBSD_NJOBS=4
HBSD_OBJRELDIR=/usr/obj/scratch/src/hbsd-13/amd64.amd64/release
HBSD_PUBDIR=/build/pub
HBSD_SRC=/scratch/src/hbsd-13
HBSD_STAGEDIR=/build/stage
HBSD_TARGET=amd64
HBSD_TARGET_ARCH=amd64
HBSD_NOCLEAN="-DNO_CLEAN"
HBSD_LOGDIR=/build/logs/13-current.amd64

HBSD_BUILDNUMBER=$(build_number)
HBSD_BUILD_LOG=${HBSD_LOGDIR}/${HBSD_BUILDNUMBER}.log

return 0
}

Loading…
Cancel
Save