-
Notifications
You must be signed in to change notification settings - Fork 33
/
docker_push
30 lines (30 loc) · 1.32 KB
/
docker_push
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
#!/bin/bash
echo "Logging in to Docker as $DOCKER_USERNAME"
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
case "$1" in
master )
docker build -t philhawthorne/ha-dockermon:latest .
docker run --rm --privileged multiarch/qemu-user-static:register --reset
docker build -t philhawthorne/ha-dockermon:arm -f Dockerfile.RaspberryPi .
docker push philhawthorne/ha-dockermon:latest
docker push philhawthorne/ha-dockermon:arm
;;
edge )
echo "Tagging and pushing images as edge"
docker build -t philhawthorne/ha-dockermon:edge .
# prepare qemu
docker run --rm --privileged multiarch/qemu-user-static:register --reset
docker build -t philhawthorne/ha-dockermon:edge-arm -f Dockerfile.RaspberryPi .
docker push philhawthorne/ha-dockermon:edge
docker push philhawthorne/ha-dockermon:edge-arm
;;
*)
echo "Tagging release $1"
docker build -t philhawthorne/ha-dockermon:"$1" .
# prepare qemu
docker run --rm --privileged multiarch/qemu-user-static:register --reset
docker build -t philhawthorne/ha-dockermon:"$1"-arm -f Dockerfile.RaspberryPi .
docker push philhawthorne/ha-dockermon:"$1"
docker push philhawthorne/ha-dockermon:"$1"-arm
;;
esac