1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 05:58:58 +01:00
MadelineProto/tests/docker.sh

47 lines
1.5 KiB
Bash
Raw Normal View History

2023-05-30 15:48:23 +02:00
#!/bin/sh -e
docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
docker buildx create --use --name wp --driver remote tcp://192.168.69.1:1234
2023-05-30 15:56:53 +02:00
has_riscv=0
2023-05-30 15:48:23 +02:00
if ping -c 1 192.168.69.206; then
2023-05-30 15:49:27 +02:00
docker buildx create --append --name wp --driver remote tcp://192.168.69.206:1234
2023-05-30 15:56:53 +02:00
has_riscv=1
2023-05-30 15:48:23 +02:00
fi
2023-05-30 15:56:53 +02:00
has_x86=0
2023-05-30 15:48:23 +02:00
if ping -c 1 192.168.69.236; then
2023-05-30 15:49:27 +02:00
docker buildx create --append --name wp --driver remote tcp://192.168.69.236:1234
2023-05-30 15:56:53 +02:00
has_x86=1
fi
arch="linux/arm64"
if [ $has_x86 -eq 1 ]; then
arch="$arch,linux/amd64"
2023-05-30 15:48:23 +02:00
fi
for f in debian alpine; do
2023-05-30 15:56:53 +02:00
docker buildx build -f tests/dockerfiles/Dockerfile.$f --platform $arch . -t danog/madelineproto:next-$f --cache-from danog/madelineproto:next-$f --cache-to type=inline
if [ $has_riscv -eq 1 ]; then
2023-05-30 16:00:17 +02:00
IMG=danog/madelineproto:8.2-fpm-$f docker buildx build -f tests/dockerfiles/Dockerfile.$f --platform linux/riscv64 . -t danog/madelineproto:next-$f --cache-from danog/madelineproto:next-$f --cache-to type=inline
2023-05-30 15:56:53 +02:00
fi
2023-05-30 16:00:17 +02:00
docker push danog/madelineproto:next-$f
2023-05-30 15:48:23 +02:00
2023-05-30 16:00:17 +02:00
docker tag danog/madelineproto:next-$f danog/madelineproto:next-$f-$CI_COMMIT_SHA
docker push danog/madelineproto:next-$f-$CI_COMMIT_SHA
2023-05-30 15:48:23 +02:00
if [ "$CI_COMMIT_TAG" != "" ]; then
2023-05-30 16:00:17 +02:00
docker tag danog/madelineproto:next-$f danog/madelineproto:$f
docker push danog/madelineproto:$f
2023-05-30 15:48:23 +02:00
fi
done
2023-05-30 16:00:17 +02:00
docker tag danog/madelineproto:next-debian danog/madelineproto:next
docker push danog/madelineproto:next
2023-05-30 15:48:23 +02:00
if [ "$CI_COMMIT_TAG" != "" ]; then
2023-05-30 16:00:17 +02:00
docker tag danog/madelineproto:next danog/madelineproto:latest
docker push danog/madelineproto:latest
2023-05-30 15:48:23 +02:00
fi