open-stf云测平台搭建

1,234 阅读1分钟

最近在使用open-stf开源系统搭建公司的云测平台,用于管理公司的测试机。下面记录一下系统的搭建过程,整个环境采用docker进行搭建。

1.安装rethinkdb数据库

docker run -d --name rethinkdb --restart=always -v /srv/rethinkdb:/data --restart always --net host rethinkdb rethinkdb --bind all --cache-size 8192 --http-port 8090
  1. 安装adb service
docker run -d --name adbd --restart always --privileged -v /dev/bus/usb:/dev/bus/usb --net host sorccu/adb --restart=always

3.安装stf服务

docker run -d --name open-stf --restart always --net host openstf/stf:latest stf local --public-ip 云测平台域名 --restart=always

上述方式采用默认的登录方式,如果需要使用ldap方式进行登录,则参见下方方式进行部署

docker run -d --name open-stf --restart always --net host openstf/stf:latest stf local --public-ip 云测平台域名 --auth-type ldap --auth-options '["--ldap-url","ldap://ldap的服务器地址:389", "--ldap-bind-dn","ldap账号","--ldap-search-dn","OU=user,DC=com", "--ldap-bind-credentials","ldap密码","--ldap-search-class","user", "--ldap-search-field", "sAMAccountName"]'

4.Nginx配置

# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/
 
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
 
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
 
events {
    worker_connections 1024;
}
 
http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
 
    access_log  /var/log/nginx/access.log  main;
 
    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;
    client_max_body_size 100M;
 
    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;
 
    include /etc/nginx/conf.d/*.conf;
 
    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  云测平台域名;
 
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;
 
        location / {
            proxy_redirect off;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://127.0.0.1:7100;
        }
 
        error_page 404 /404.html;
            location = /40x.html {
        }
 
        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
}

以上配置中,需要将部分中文描述的地方的参数替换成自己的真实的值。