Skip to content

Commit

Permalink
Various changes
Browse files Browse the repository at this point in the history
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 7aa3f2f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
1 change: 1 addition & 0 deletions bin/ci.sh
Expand Up @@ -63,6 +63,7 @@ main() {
assert_unlocked && \
lock_build && \
update_codebase && \
clean_build && \
build_hardenedbsd && \
build_release && \
stage_release && \
Expand Down
37 changes: 34 additions & 3 deletions lib/build.sh
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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
}

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/publish.sh
Expand Up @@ -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 ${?}
Expand Down

0 comments on commit 7aa3f2f

Please sign in to comment.