-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathbuild.sh
executable file
·29 lines (24 loc) · 1.01 KB
/
build.sh
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
#!/usr/bin/env bash
set -euo pipefail
. "lib/init_vars"
# Source mo for templates
. "lib/mo"
echo 'Emitting Templates'
mo <templates/Dockerfile >"${family}/Dockerfile"
mo <templates/entrypoint.sh >"${family}/entrypoint.sh"
mo <templates/healthcheck.sh >"${family}/healthcheck.sh"
mo <templates/script.sed >"${family}/script.sed"
mo <templates/bake.hcl >"${family}/bake.hcl"
chmod +x "${family}/entrypoint.sh"
chmod +x "${family}/healthcheck.sh"
echo 'Building Images'
pushd "${family}"
docker_version=${docker_version} \
unifi_version=${unifi_version} \
unifi_sha256=${unifi_sha256} \
java_package=${java_package} \
docker buildx bake --file bake.hcl unifi --builder=container
popd
echo 'Testing Images'
GOSS_PATH="${HOME}/.local/bin/goss-linux-amd64" GOSS_WAIT_OPTS='-r 60s -s 1s > /dev/null' dgoss run --platform linux/amd64 "ryansch/unifi:${docker_version}"
GOSS_PATH="${HOME}/.local/bin/goss-linux-arm64" GOSS_WAIT_OPTS='-r 60s -s 1s > /dev/null' dgoss run --platform linux/arm64 "ryansch/unifi:${docker_version}"