jenkins+docker+robot环境搭建

1.docker必须添加jenkins用户的执行权限

sudo usermod -aG docker jenkins
sudo systemctl restart docker
sudo systemctl restart jenkins

2.构建robot基础镜像

#Dockerfile
FROM daocloud.io/library/python
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
#requirements.txt
robotframework
robotframework-requests

3.jenkins在下载git代码后,执行docker命令

docker run -v /var/lib/jenkins/workspace/devops/compass:/data myrobot robot --outputdir /data /data//devops/测试案例/API/API.txt

4.安装robot插件,并设置好输出结果的目录

/var/lib/jenkins/workspace/devops/compass
    原文作者:heliping_peter
    原文地址: https://www.jianshu.com/p/d38385033c1b
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞