Skip to content
Permalink
Browse files

Various changes

Clean the release artifacts prior to building. This ensures that the
build artifacts properly reflect the source.

Do not double-compress distsets.

Provide a revision.txt file that contains the git commit as given by
`git rev-list -n 1 HEAD`.

Do not attempt to publish to a mirror if no mirror is set.

Signed-off-by:	Shawn Webb <shawn.webb@hardenedbsd.org>
  • Loading branch information
lattera committed Nov 9, 2019
1 parent 4efc448 commit 7aa3f2f3617db85727ac679ddc620f695dfc73bf
Showing with 37 additions and 5 deletions.
  1. +1 −0 bin/ci.sh
  2. +34 −3 lib/build.sh
  3. +2 −2 lib/publish.sh
@@ -63,6 +63,7 @@ main() {
assert_unlocked && \
lock_build && \
update_codebase && \
clean_build && \
build_hardenedbsd && \
build_release && \
stage_release && \
@@ -24,6 +24,20 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.

clean_build() {
(
set -ex

cd ${HBSD_SRC}/release
make \
TARGET=${HBSD_TARGET} \
TARGET_ARCH=${HBSD_TARGET_ARCH} \
clean
)

return 0
}

build_hardenedbsd() {
(
set -ex
@@ -81,7 +95,6 @@ stage_release() {
for file in $(find ${HBSD_OBJRELDIR} -maxdepth 1 \
-name '*.iso' \
-o -name '*.img' \
-o -name '*.txz' \
-o -name 'MANIFEST'); do
f=${file##*/}
mv ${file} ${HBSD_STAGEDIR}/${f}
@@ -95,6 +108,23 @@ stage_release() {
return ${res}
fi
done

# No need to compress the .txz files
for file in $(find ${HBSD_OBJRELDIR} -maxdepth 1 \
-name '*.txz'); do
f=${file##*/}
mv ${file} ${HBSD_STAGEDIR}/${f}
res=${?}
if [ ${res} -gt 0 ]; then
return ${res}
fi
done

(
cd ${HBSD_SRC}
git rev-list -n 1 HEAD > ${HBSD_STAGEDIR}/revision.txt
)

return 0
}

@@ -107,8 +137,9 @@ sign_release() {
-name '*.txz' \
-o -name '*.img' \
-o -name '*.iso' \
-o -name '*.xz' \
-o -name 'MANIFEST'); do
-o -name '*xz' \
-o -name 'MANIFEST' \
-o -name 'revision.txt'); do
f=${file##*/}
sha256 ${f} >> CHECKSUMS.SHA256
sha512 ${f} >> CHECKSUMS.SHA512
@@ -30,8 +30,8 @@ publish_release() {
}

kick_publisher_tires() {
# This function is for those mirrors that require push rather
# than pull. For now: nothing to see here; move along.
[ -z "${HBSD_MIRROR_MASTER}" ] && return 0

rsync -a ${HBSD_PUBDIR}/${HBSD_BUILDNUMBER}/ \
${HBSD_MIRROR_MASTER}:${HBSD_MIRROR_PUBDIR}/build-${HBSD_BUILDNUMBER}
return ${?}

0 comments on commit 7aa3f2f

Please sign in to comment.
You can’t perform that action at this time.