-
Notifications
You must be signed in to change notification settings - Fork 16
/
ubuntu-provider.sh
49 lines (38 loc) · 1.04 KB
/
ubuntu-provider.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
48
49
#!/bin/bash
if [ ! -n "$1" ] ;then
hostname="127.0.0.1"
else
hostname="$1"
fi
echo "服务IP:${hostname}"
echo "apt update......"
apt update
#安装 docker
echo "检查Docker......"
docker -v
if [ $? -eq 0 ]; then
echo "检查到Docker已安装!"
else
echo "安装docker环境..."
curl -sSL https://get.docker.com/ | sh
echo "安装docker环境...安装完成!"
fi
echo "拉取必要的image"
docker pull openstf/stf:latest
docker pull sorccu/adb:latest
echo "停止provider相关容器"
docker stop "provider1" "adbd"
sleep 1
echo "删除provider相关容器"
docker rm -v "provider1" "adbd"
sleep 1
echo "启动adbd"
docker run -d --name adbd --privileged -v /dev/bus/usb:/dev/bus/usb --net host sorccu/adb:latest
sleep 3
echo "启动stf provider"
docker run -d --name provider1 --net host openstf/stf \
stf provider --name provider1 \
--connect-sub tcp://${hostname}:7250 \
--connect-push tcp://${hostname}:7270 \
--min-port=15000 --max-port=25000 --heartbeat-interval 20000 --allow-remote --no-cleanup \
--storage-url http://${hostname}