其他分享
首页 > 其他分享> > jenkins+robotframework

jenkins+robotframework

作者:互联网

创建robotframework容器

可参考Openbmc的

下载jenkins容器

#sudo docker pull jenkins/jenkins

测试jenkins

#mkdir jenkins_home
#sudo docker run  -v /mnt/ram0/jenkins_home:/var/jenkins_home -v /etc/localtime:/etc/localtime -p 10240:8080 jenkins/jenkins

-v /mnt/ram0/jenkins_home:/var/jenkins_home -> 挂载host目录到容器
-v /etc/localtime:/etc/localtime -> 同步host与容器时间
-p 10240:8080 -> 映射jenkins 8080端口到host 10240端口

jenkins安装robot framework 插件

TODO

jenkins调用robotframework的容器

需要修改jenkins容器的启动参数

build后打开robotframework报告失败

编译jenkins容器中的/usr/local/bin/jenkins.sh,在exec java开头的那行增加参数,修改后如下

exec java -Dhudson.model.DirectoryBrowserSupport.CSP="sandbox allow-scripts; default-src 'none'; img-src 'self' data: ; style-src 'self' 'unsafe-inline' data: ; script-src 'self' 'unsafe-inline' 'u    nsafe-eval' ;" -Duser.home="$JENKINS_HOME" ${FUTURE_OPTS} "${java_opts_array[@]}" -jar ${JENKINS_WAR} "${jenkins_opts_array[@]}" "$@"

创建job执行测试

ROBOT_DATA=/mnt/ram0/openbmc-test-automation-master
ROBOT_OUTPUT=/mnt/ram0/robotlog
ROBOT_CASE=ipmi/test_ipmi_device_id.robot
docker run \
-v ${ROBOT_DATA}:/opt/test \
-v ${ROBOT_OUTPUT}:/opt/log \
-i 93b55ffb403f \
robot -v OPENBMC_HOST:${BMC_IP} -v IPMI_USERNAME:${BMC_USERNAME} -v IPMI_PASSWORD:${BMC_PASSWORD} -d /opt/log -l log_${BUILD_ID}.html -r report_${BUILD_ID}.html /opt/test/${ROBOT_CASE}

标签:容器,mnt,ROBOT,robotframework,home,jenkins,localtime
来源: https://www.cnblogs.com/zl-yang/p/16379505.html