stf安装步骤 服务器(ubuntu 16.04)
1 更新环境,基本包的安装
sudo apt-get update
sudo apt-get install git
sudo apt-get install lib32stdc++6
sudo apt-get install yum
2 配置JDK,Android SDK 环境
a 下载解压
b sudo gedit ~/.bashrc
在最后添加
export JAVA_HOME=/home/maque/jdk-12.0.1
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export ANDROID_HOME=/home/maque/android-sdk-linux
export PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH
c source ~./bashrc
d 更新Android SDK 包
./android -v update sdk (全部更新)
./adnroid -v update sdk --no-ui --all --filter platform-tools,android-22
3 安装nodejs
#!/bin/bash
sudo wget https://npm.taobao.org/mirrors/node/v8.9.3/node-v8.9.3-linux-x64.tar.xz
sudo tar -xJf node-v8.9.3-linux-x64.tar.xz
sudo mv node-v8.9.3-linux-x64 /opt/
sudo ln -s /opt/node-v8.9.3-linux-x64/bin/node /usr/local/bin/node
sudo ln -s /opt/node-v8.9.3-linux-x64/bin/npm /usr/local/bin/npm
#set environment
export NODE_HOME="/opt/node-v8.9.3-linux-x64/bin/node"
if ! grep NODE_HOME="/opt/node-v8.9.3-linux-x64/bin/node" /etc/profile
then
echo "NODE_HOME=/opt/node-v8.9.3-linux-x64/bin/node" | sudo tee -a /etc/profile
echo "export NODE_HOME" | sudo tee -a /etc/profile
echo "PATH=${NODE_HOME}/bin:$PATH" | sudo tee -a /etc/profile
echo "export PATH" | sudo tee -a /etc/profile
fi
source /etc/profile
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org
sudo ln -s /opt/node-v8.9.3-linux-x64/lib/node_modules/cnpm/bin/cnpm /usr/local/bin/cnpm
#更改node目录的权限
sudo chown -R root /opt/node-v8.9.3-linux-x64/{lib/node_modules,bin,share}
echo "isnatll nodejs is ok!!!"
sudo node -v
sudo npm -v
sudo cnpm -v
4 安装stf 脚本化
#!/bin/bash
#sudo npm install -g node-gyp
#安装RethinkBD 需要切换root权限操作
#source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | tee /etc/apt/sources.list.d/rethinkdb.list | wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y rethinkdb
sudo cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/instance1.conf
sudo service rethinkdb stop
#安装graphicsmagick
sudo apt-get install -y graphicsmagick
sudo apt-get install -y libzmq3-dev
sudo apt-get install -y libprotobuf-dev
#------------------------------------------------------------------------
#安装protobuf-all
#wget https://github.com/google/protobuf/releases/download/v3.5.1/protobuf-all-3.5.1.tar.gz
wget https://coding.net/u/jamesz2011/p/STF-install/git/raw/master/protobuf-all-3.5.1.tar.gz
tar -zxvf protobuf-all-3.5.1.tar.gz
cd protobuf-3.5.1/
./configure --prefix=/usr/local/protobuf-3.5.1
make
sudo make install
sudo ln -s /usr/local/protobuf-3.5.1/bin/protoc /usr/local/bin/protoc
protoc --version
#set environment
#export PATH=$PATH:/usr/local/protobuf-3.5.1/bin/
#export PKG_CONFIG_PATH=/usr/local/protobuf-3.5.1/lib/pkgconfig/
export PKG_CONFIG_PATH="/usr/local/protobuf-3.5.1/lib/pkgconfig/"
if ! grep PKG_CONFIG_PATH="/usr/local/protobuf-3.5.1/lib/pkgconfig/" /etc/profile
then
echo PKG_CONFIG_PATH="/usr/local/protobuf-3.5.1/lib/pkgconfig/" | sudo tee -a /etc/profile
echo "export PKG_CONFIG_PATH" | sudo tee -a /etc/profile
echo "PATH=$PATH:/usr/local/protobuf-3.5.1/bin/" | sudo tee -a /etc/profile
echo "export PATH" | sudo tee -a /etc/profile
fi
source /etc/profile
#安装yasm
sudo apt-get install -y yasm
#安装pkg-config
sudo apt-get install -y pkg-config
#安装g++
sudo apt-get install -y g++
#安装node-gyp
sudo npm install -g node-gyp --unsafe-perm
#安装zmq
sudo npm install -g zmq --unsafe-perm
#安装jpeg-turbo
sudo npm install -g jpeg-turbo --unsafe-perm
#安装stf
sudo npm install -g stf --unsafe-perm
sudo ln -s /opt/node-v8.9.3-linux-x64/bin/stf /usr/local/bin/stf
5 stf 启动
#rethinkdb 关闭重启
service rethinkdb stop
rethinkdb --bind all --cache-size 8192 --http-port 8075
rethinkdb http://127.0.0.1:8075
#stf 启动
stf local --public-ip 本机IP --allow-remote
参考:https://github.com/openstf/stf
https://testerhome.com/topics/2988
来源:CSDN
作者:麻雀
链接:https://blog.csdn.net/maque0312/article/details/89598021