cleanup
This commit is contained in:
1 parent
feb9d91a3d
commit
1f0daa0679
25 files changed
+174
-1035
No files matched your search
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
source /opt/rust-package-builder/scripts/lib.sh
|
||||
BUILDER_ROOT=${BUILDER_ROOT:-/opt/rust-package-builder}
|
||||
source "$BUILDER_ROOT/scripts/lib.sh"
|
||||
|
||||
: "${SHA:?SHA required}"
|
||||
: "${SRC:?SRC required}"
|
||||
@@ -22,7 +23,7 @@ trap cleanup_freebsd_release EXIT
|
||||
FREEBSD_BINARY="$OUT/rust-proxy-freebsd"
|
||||
if [[ ! -x "$FREEBSD_BINARY" ]]; then
|
||||
# Reuse the same FreeBSD cross-build as OPNsense if it succeeded first.
|
||||
/opt/rust-package-builder/scripts/build-opnsense.sh "$SRC" "$FREEBSD_BINARY" "$BINARY_NAME" "$WORK"
|
||||
"$BUILDER_ROOT/scripts/build-opnsense.sh" "$SRC" "$FREEBSD_BINARY" "$BINARY_NAME" "$WORK"
|
||||
fi
|
||||
|
||||
FREEBSD_PACKAGE_REVISION=$SOURCE_REVISION
|
||||
@@ -43,7 +44,7 @@ if (( FREEBSD_PACKAGE_REVISION == 0 )); then
|
||||
fi
|
||||
FREEBSD_PACKAGE_VERSION="${VERSION}_${FREEBSD_PACKAGE_REVISION}"
|
||||
FREEBSD_PACKAGE_FILE="$OUT/rustproxy-${FREEBSD_PACKAGE_VERSION}.pkg"
|
||||
/opt/rust-package-builder/scripts/package-freebsd.sh \
|
||||
"$BUILDER_ROOT/scripts/package-freebsd.sh" \
|
||||
"$SRC" "$FREEBSD_BINARY" "$FREEBSD_PACKAGE_FILE" "$FREEBSD_PACKAGE_VERSION"
|
||||
|
||||
mkdir -p "$RELEASE_DIR/apt" "$RELEASE_DIR/rpm/x86_64" "$RELEASE_DIR/opnsense" "$RELEASE_DIR/freebsd"
|
||||
@@ -70,7 +71,7 @@ fi
|
||||
FREEBSD_PACKAGE_DIR="$RELEASE_DIR/freebsd/$FREEBSD_ABI"
|
||||
mkdir -p "$FREEBSD_PACKAGE_DIR"
|
||||
cp -f "$FREEBSD_PACKAGE_FILE" "$FREEBSD_PACKAGE_DIR/"
|
||||
/opt/rust-package-builder/scripts/generate-opnsense-repo.py "$RELEASE_DIR/freebsd" --retention "$FREEBSD_NATIVE_RETENTION"
|
||||
"$BUILDER_ROOT/scripts/generate-opnsense-repo.py" "$RELEASE_DIR/freebsd" --retention "$FREEBSD_NATIVE_RETENTION" --repo-version 2
|
||||
NATIVE_URL="${OPNSENSE_REPOSITORY_URL%/}/freebsd"
|
||||
cat > "$RELEASE_DIR/freebsd/RustProxy-FreeBSD.conf" <<CONF
|
||||
RustProxyNative: {
|
||||
@@ -97,15 +98,18 @@ freebsd_abi=$FREEBSD_ABI
|
||||
freebsd_arch=$FREEBSD_ARCH
|
||||
package=$FREEBSD_ABI/$(basename "$FREEBSD_PACKAGE_FILE")
|
||||
INFO
|
||||
/opt/rust-package-builder/scripts/generate-freebsd-index.sh "$RELEASE_DIR/freebsd/index.html"
|
||||
"$BUILDER_ROOT/scripts/generate-freebsd-index.sh" "$RELEASE_DIR/freebsd/index.html"
|
||||
|
||||
[[ -s "$RELEASE_DIR/freebsd/index.html" ]]
|
||||
[[ -s "$RELEASE_DIR/freebsd/meta.conf" ]]
|
||||
[[ -s "$RELEASE_DIR/freebsd/packagesite.pkg" ]]
|
||||
[[ -s "$RELEASE_DIR/freebsd/data.pkg" ]]
|
||||
grep -Fqx "version: 2;" "$RELEASE_DIR/freebsd/meta.conf" || fatal "unexpected FreeBSD pkg repository format"
|
||||
[[ -s "$RELEASE_DIR/freebsd/rustproxy-latest.pkg" ]]
|
||||
bsdtar -tf "$RELEASE_DIR/freebsd/packagesite.pkg" | grep -Fx 'packagesite.yaml' >/dev/null || fatal 'invalid FreeBSD packagesite.pkg'
|
||||
bsdtar -xOf "$FREEBSD_PACKAGE_DIR/$(basename "$FREEBSD_PACKAGE_FILE")" +COMPACT_MANIFEST >/dev/null || fatal 'invalid FreeBSD package manifest'
|
||||
# Fail before switching the live repository if the public package is missing or empty.
|
||||
[[ -s "$FREEBSD_PACKAGE_DIR/$(basename "$FREEBSD_PACKAGE_FILE")" ]] || fatal 'missing FreeBSD native package artifact'
|
||||
|
||||
log 'publishing native FreeBSD repository branch'
|
||||
rm -f "$REPOSITORY/current.new"
|
||||
|
||||
Reference in new issue
Block a user