-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_armhf.sh
executable file
·47 lines (31 loc) · 1020 Bytes
/
build_armhf.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
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
branch=$(git rev-parse --abbrev-ref HEAD)
subbranch="$branch-"
image="volkerhaensel/tuya_mqtt.net"
if [ "$branch" == "main" ] || [ "$branch" == "master" ]
then
branch='latest'
subbranch=''
fi
tags=($(git tag -l))
arch=$(uname -m)
if [ "$arch" == "armhf" ] || [ "$arch" == "armv7l" ]
then
docker build tuya_mqtt.net -t $image:arm32-$branch
image_ID=$(docker images --format="{{.Repository}}:{{.Tag}} {{.ID}}" | grep $image:arm32-$branch | cut -d' ' -f2 )
echo "image $image_ID is used"
echo "run docker push $image:arm32-$branch"
docker push $image:arm32-$branch
for i in "${tags[@]}"
do
echo "current version have tag $i"
echo "run docker tag $image_ID $image:arm32-$subbranch$i"
docker tag $image_ID $image:arm32-$subbranch$i
echo "run docker push $image:arm32-$subbranch$i"
docker push $image:arm32-$subbranch$i
done
else
echo "architecture $arch found"
echo "this build script is designed to run on arm32 bit."
echo "exiting."
fi