-
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathdocker-package.sh
More file actions
executable file
·36 lines (28 loc) · 1.17 KB
/
docker-package.sh
File metadata and controls
executable file
·36 lines (28 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -euo pipefail
_current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
_root_dir="$(cd "${_current_dir}/.." && pwd)"
_git_submodule="helium-chromium"
_image="helium-chromium-trixie-slim:packager"
_user_uidgid="$(id -u):$(id -g)"
_docker_image_args=()
_make_deb=${MAKE_DEB:-0}
if [ "$_user_uidgid" != "0:0" ]; then
_docker_image_args+=(--build-arg "UID=$(id -u)")
_docker_image_args+=(--build-arg "GID=$(id -g)")
fi
docker buildx build --load -t "${_image}" -f "${_root_dir}/docker/package.Dockerfile" "${_docker_image_args[@]}" .
[ -n "$(ls -A "${_root_dir}/${_git_submodule}" 2>/dev/null || true)" ] || git -C "${_root_dir}" submodule update --init --recursive
_gpg_docker_flags=()
if [[ -n "${GPG_PRIVATE_KEY:-}" && -n "${GPG_PASSPHRASE:-}" ]]; then
_gpg_docker_flags=(-e GPG_PRIVATE_KEY -e GPG_PASSPHRASE -e SIGN_TARBALL=1)
fi
cd "${_root_dir}" && docker run --rm -i \
-u "${_user_uidgid}" \
"${_gpg_docker_flags[@]}" \
-e APPIMAGE_EXTRACT_AND_RUN=1 \
-e HOME=/home/builder \
-e GNUPGHOME=/home/builder/.gnupg \
-e MAKE_DEB=$_make_deb \
-v "${_root_dir}:/repo" \
"${_image}" bash "/repo/scripts/package.sh" "$@"