forked from MaxWinterstein/homeassistant-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helper-builder.sh
35 lines (30 loc) · 954 Bytes
/
helper-builder.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
30
31
32
33
34
35
#!/bin/bash
# see https://github.com/home-assistant/builder
# thx https://stackoverflow.com/a/51911626
__usage="
Usage: $(basename $0) [OPTIONS]
Options:
push Build all possible and push
test <arch> Build for <arch>
Example:
$(basename $0) test amd64
"
if [[ $1 = "push" ]]; then
echo 'Build all and push...'
echo -n "Dockerhub password for maxwinterstein: "
read -s password
docker run --privileged \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v $PWD/:/data homeassistant/aarch64-builder \
--all -t /data --docker-user maxwinterstein --docker-password $password #--docker-hub-check
elif [[ $1 = "test" ]]; then
arch=${2:-all}
echo "Build for $arch..."
sleep 5
docker run --privileged \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v $PWD/:/data homeassistant/aarch64-builder \
--$arch --test -t /data
else
echo "$__usage"
fi