Skip to content

Commit

Permalink
Add build-debian-pkg script.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeanwallace committed May 16, 2023
1 parent 7f0840f commit 3d27316
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions dev-scripts/build-debian-pkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

# Build uStreamer Debian package.
#
# Usage:
# build-debian-pkg [target architectures]
#
# target architecture: A comma-separated list of architectures that Docker
# accepts for its --platform argument. If omitted, defaults to
# "linux/arm/v7,linux/amd64". The only supported targets are linux/arm/v7 and
# linux/amd64.
#
# Examples
# build-debian-pkg "linux/arm/v7"
# build-debian-pkg "linux/arm/v7,linux/amd64"

# Exit on first failure.
set -e

# Echo commands before executing them, by default to stderr.
set -x

# Exit on unset variable.
set -u

readonly BUILD_TARGETS="${1:-linux/arm/v7,linux/amd64}"

PKG_VERSION="$(date '+%Y%m%d%H%M%S')"
readonly PKG_VERSION

# Use plain Docker build progress output when we're running in CI.
DOCKER_PROGRESS='auto'
if [[ -n "${CI:-}" ]]; then
DOCKER_PROGRESS='plain'
fi
readonly DOCKER_PROGRESS

DOCKER_BUILDKIT=1 docker buildx build \
--file Dockerfile \
--platform "${BUILD_TARGETS}" \
--build-arg PKG_VERSION="${PKG_VERSION}" \
--target=artifact \
--progress="${DOCKER_PROGRESS}" \
--output "type=local,dest=$(pwd)/build/" \
.

0 comments on commit 3d27316

Please sign in to comment.