目的:jenkins定时构建Allure报告

Java环境搭建

  1. 服务器一般自带的是OpenJDK,这里建议不用OpenJDK,推荐自己装
  2. 教程百度即可遍地都是
  3. 参考文章:https://blog.csdn.net/u010993514/article/details/82926514

Python环境搭建

https://www.cnblogs.com/lemon-feng/p/11208435.html

  1. 安装依赖环境
    1. 输入命令:<font style="color:#F5222D;">yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel</font>
  2. 创建software文件夹,cd进入
  3. 下载python3文件
输入命令 <font style="color:#F5222D;">wget https://www.python.org/ftp/python/3.8.7/Python-3.8.7.tgz</font> (用稳定版本) 没有wget命令,输入<font style="color:#F5222D;">yum -y install wget</font>,安装其依赖将会被安装
  1. 创建目录:<font style="color:#F5222D;">mkdir -p /usr/local/python3</font>
  2. 进入softwrae文件夹解压python文件,<font style="color:#F5222D;">tar -zxvf xxx.tgz</font>
  3. 进入加压出来的python文件夹内
    1. 安装gcc 输入命令 <font style="color:#F5222D;">yum install gcc</font>,确认下载安装输入y
    2. 3.7版本之后需要一个新的包libffi-devel,安装即可:<font style="color:#F5222D;">yum install libffi-devel -y</font>
    3. 生成编译脚本:<font style="color:#F5222D;">./configure --prefix=/usr/local/python3</font>
    4. 编译:<font style="color:#F5222D;">make</font>
    5. 编译成功后,编译安装:<font style="color:#F5222D;">make install</font>
  4. 建立软连接
    1. <font style="color:#F5222D;">ln -s /usr/local/python3/bin/python3 /usr/bin/python3</font>
    2. <font style="color:#F5222D;">ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3</font>
  5. 并将/usr/local/python3/bin加入PATH:<font style="color:#F5222D;">vim /etc/profile</font> 1. 粘贴以下内容
  1. # vim ~/.bash_profile
  2. # .bash_profile
  3. # Get the aliases and functions
  4. if [ -f ~/.bashrc ]; then
  5. . ~/.bashrc
  6. fi
  7. # User specific environment and startup programs
  8. PATH=$PATH:$HOME/bin:/usr/local/python3/bin
  9. export PATH
  1. 2. <font style="color:rgb(51, 51, 51);">按ESC,输入:wq回车退出</font>
  2. 3. <font style="color:rgb(51, 51, 51);">修改完记得执行行下面的命令,让上一步的修改生效:</font>`<font style="color:#F5222D;">source ~/.bash_profile</font>`
  1. 检查版本

Linux-CI/CD搭建前奏 - 图1

Node环境搭建

https://www.cnblogs.com/qq874455953/p/10264429.html

  1. 新建目录node <font style="color:#F5222D;">cd /usr/local/node</font> 进入
  2. 下载安装包 <font style="color:#F5222D;">wget</font><font style="color:#F5222D;background-color:rgb(245, 245, 245);"> https://npm.taobao.org/mirrors/node/v</font><font style="color:#F5222D;">12</font><font style="color:#F5222D;background-color:rgb(245, 245, 245);">.</font><font style="color:#F5222D;">12</font><font style="color:#F5222D;background-color:rgb(245, 245, 245);">.</font><font style="color:#F5222D;">0</font><font style="color:#F5222D;background-color:rgb(245, 245, 245);">/node-v</font><font style="color:#F5222D;">12</font><font style="color:#F5222D;background-color:rgb(245, 245, 245);">.</font><font style="color:#F5222D;">12</font><font style="color:#F5222D;background-color:rgb(245, 245, 245);">.</font><font style="color:#F5222D;">0</font><font style="color:#F5222D;background-color:rgb(245, 245, 245);">-linux-x</font><font style="color:#F5222D;">64</font><font style="color:#F5222D;background-color:rgb(245, 245, 245);">.tar.gz</font>
  3. 解压
  4. 建立软连接 1. <font style="color:#F5222D;">ln</font><font style="color:#F5222D;background-color:rgb(245, 245, 245);"> -s /usr/local/node/node-v</font><font style="color:#F5222D;">4</font><font style="color:#F5222D;background-color:rgb(245, 245, 245);">.</font><font style="color:#F5222D;">4</font><font style="color:#F5222D;background-color:rgb(245, 245, 245);">.</font><font style="color:#F5222D;">7</font><font style="color:#F5222D;background-color:rgb(245, 245, 245);">-linux-x</font><font style="color:#F5222D;">64</font><font style="color:#F5222D;background-color:rgb(245, 245, 245);">/bin/npm /usr/local/bin/npm</font> 2. ln -s /usr/local/node/node-v4.4.7-linux-x64/bin/node /usr/local/bin/node
  5. 查看版本

Linux-CI/CD搭建前奏 - 图2

Git搭建

https://www.cnblogs.com/wulixia/p/11016684.html

  1. <font style="color:#F5222D;">mkdir -p /usr/local/git</font>
  2. 进入文件夹,上传gitxxx.tar.gz,然后解压
  3. 进入解压后的文件夹内
    1. <font style="color:#F5222D;">yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker</font>
    2. 耐心等待安装完成,中途出现提示的时候输入y并按回车
  4. 提示,安装编译源码所需依赖的时候,yum自动帮你安装了git,这时候你需要先卸载这个旧版的git。
    1. <font style="color:#F5222D;">yum -y remove git</font>
  5. 、编译git源码
    1. <font style="color:#F5222D;">make prefix=/usr/local/git all</font>
  6. 安装git至/usr/local/git路径
    1. <font style="color:#F5222D;">make prefix=/usr/local/git install</font>
  7. 配置环境变量 1. vi /etc/profile 2. <font style="color:#F5222D;">export PATH=$PATH:/usr/local/git/</font><font style="color:#F5222D;">bin</font> 3. 保存
  8. 刷新环境变量
    1. <font style="color:#F5222D;">source /etc/profile</font>
    2. <font style="color:#F5222D;">git --version</font>

Linux-CI/CD搭建前奏 - 图3

Allure搭建

  1. 可下载allure-commandline-2.13.0.tgz上传到服务器至allure文件夹下
  2. 解压之后

Linux-CI/CD搭建前奏 - 图4

  1. 授予package最高权限 <font style="color:#F5222D;">chmod -R 777 package</font>
  2. 进入 <font style="color:#F5222D;">cd /usr/bin</font>
  3. 建立软连接
    1. <font style="color:#F5222D;">ln -s /usr/local/allure/package/bin/allure</font>
  4. 查看allure:即为成功

Linux-CI/CD搭建前奏 - 图5

待续