Skip to content

Commit 7aa3f2f

Browse files
committed
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>
1 parent 4efc448 commit 7aa3f2f

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed

Diff for: bin/ci.sh

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ main() {
6363
assert_unlocked && \
6464
lock_build && \
6565
update_codebase && \
66+
clean_build && \
6667
build_hardenedbsd && \
6768
build_release && \
6869
stage_release && \

Diff for: lib/build.sh

+34-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@
2424
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2525
# SUCH DAMAGE.
2626

27+
clean_build() {
28+
(
29+
set -ex
30+
31+
cd ${HBSD_SRC}/release
32+
make \
33+
TARGET=${HBSD_TARGET} \
34+
TARGET_ARCH=${HBSD_TARGET_ARCH} \
35+
clean
36+
)
37+
38+
return 0
39+
}
40+
2741
build_hardenedbsd() {
2842
(
2943
set -ex
@@ -81,7 +95,6 @@ stage_release() {
8195
for file in $(find ${HBSD_OBJRELDIR} -maxdepth 1 \
8296
-name '*.iso' \
8397
-o -name '*.img' \
84-
-o -name '*.txz' \
8598
-o -name 'MANIFEST'); do
8699
f=${file##*/}
87100
mv ${file} ${HBSD_STAGEDIR}/${f}
@@ -95,6 +108,23 @@ stage_release() {
95108
return ${res}
96109
fi
97110
done
111+
112+
# No need to compress the .txz files
113+
for file in $(find ${HBSD_OBJRELDIR} -maxdepth 1 \
114+
-name '*.txz'); do
115+
f=${file##*/}
116+
mv ${file} ${HBSD_STAGEDIR}/${f}
117+
res=${?}
118+
if [ ${res} -gt 0 ]; then
119+
return ${res}
120+
fi
121+
done
122+
123+
(
124+
cd ${HBSD_SRC}
125+
git rev-list -n 1 HEAD > ${HBSD_STAGEDIR}/revision.txt
126+
)
127+
98128
return 0
99129
}
100130

@@ -107,8 +137,9 @@ sign_release() {
107137
-name '*.txz' \
108138
-o -name '*.img' \
109139
-o -name '*.iso' \
110-
-o -name '*.xz' \
111-
-o -name 'MANIFEST'); do
140+
-o -name '*xz' \
141+
-o -name 'MANIFEST' \
142+
-o -name 'revision.txt'); do
112143
f=${file##*/}
113144
sha256 ${f} >> CHECKSUMS.SHA256
114145
sha512 ${f} >> CHECKSUMS.SHA512

Diff for: lib/publish.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ publish_release() {
3030
}
3131

3232
kick_publisher_tires() {
33-
# This function is for those mirrors that require push rather
34-
# than pull. For now: nothing to see here; move along.
33+
[ -z "${HBSD_MIRROR_MASTER}" ] && return 0
34+
3535
rsync -a ${HBSD_PUBDIR}/${HBSD_BUILDNUMBER}/ \
3636
${HBSD_MIRROR_MASTER}:${HBSD_MIRROR_PUBDIR}/build-${HBSD_BUILDNUMBER}
3737
return ${?}

0 commit comments

Comments
 (0)