File: ddist.sh

package info (click to toggle)
tini 0.18.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 212 kB
  • sloc: ansic: 619; python: 379; sh: 287; makefile: 5
file content (47 lines) | stat: -rwxr-xr-x 917 bytes parent folder | download
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
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
set -o errexit
set -o nounset

REL_HERE=$(dirname "${BASH_SOURCE}")
HERE=$(cd "${REL_HERE}"; pwd)

IMG="tini-build"

if [[ -n "${ARCH_SUFFIX-}" ]]; then
  IMG="${IMG}_${ARCH_SUFFIX}"
fi

if [[ -n "${ARCH_NATIVE-}" ]]; then
  IMG="${IMG}_native"
fi

if [[ -n "${CC-}" ]]; then
  IMG="${IMG}_${CC}"
fi

# Cleanup the build dir
rm -f "${HERE}/dist"/*

# Create the build image
echo "build: ${IMG}"

docker build \
  --build-arg "ARCH_SUFFIX=${ARCH_SUFFIX-}" \
  --build-arg "ARCH_NATIVE=${ARCH_NATIVE-}" \
  --build-arg "CC=${CC-gcc}" \
  -t "${IMG}" \
  .

# Build new Tini
SRC="/tini"

docker run -it --rm \
  --volume="${HERE}:${SRC}" \
  -e BUILD_DIR=/tmp/tini-build \
  -e SOURCE_DIR="${SRC}" \
  -e FORCE_SUBREAPER="${FORCE_SUBREAPER-1}" \
  -e GPG_PASSPHRASE="${GPG_PASSPHRASE-}" \
  -e CFLAGS="${CFLAGS-}" \
  -e MINIMAL="${MINIMAL-}" \
  -u "$(id -u):$(id -g)" \
  "${IMG}" "${SRC}/ci/run_build.sh"