daily_build_image.sh 1.1 KB
Newer Older
haoranc's avatar
haoranc 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/bin/bash

set -x

script_dir=`dirname $0`
cd $script_dir
script_dir=`pwd`
cd $script_dir/repository/taos-connector-python
git pull

cd $script_dir/repository/TDinternal
git clean -fxd
git pull

cd $script_dir/repository/TDinternal/community
git clean -fxd
haoranc's avatar
haoranc 已提交
17 18
git checkout  main 
git pull origin main 
haoranc's avatar
haoranc 已提交
19 20 21
git submodule update --init --recursive

cd $script_dir
haoranc's avatar
haoranc 已提交
22 23 24
cp $script_dir/repository/TDinternal/community/tests/ci/build_image.sh  .
cp $script_dir/repository/TDinternal/community/tests/ci/daily_build_image.sh  .

haoranc's avatar
haoranc 已提交
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
./build_image.sh || exit 1
docker image prune -f 
ips="\
192.168.1.47 \
192.168.1.48 \
192.168.1.49 \
192.168.1.52 \
192.168.0.215 \
192.168.0.217 \
192.168.0.219 \
"

image=taos_image.tar

docker save taos_test:v1.0 -o $image

for ip in $ips; do
    echo "scp $image root@$ip:/home/ &"
    scp $image root@$ip:/home/ &
done
wait

for ip in $ips; do
    echo "ssh root@$ip docker load -i /home/$image &"
    ssh root@$ip docker load -i /home/$image &
done
wait

for ip in $ips; do
    echo "ssh root@$ip rm -f /home/$image &"
    ssh root@$ip rm -f /home/$image &
done
wait

rm -rf  taos_image.tar