创建部署任务

Jenkins使用五:创建部署任务

 

选择运行节点

Jenkins使用五:创建部署任务

 

选择使用shell

Jenkins使用五:创建部署任务

 

# 如果是持续进程,这里最好加一个kill进程的命令

判断如果/root/production目录存在,就删除
if [ -d /root/production ];then
    rm -rf /root/production
fi

创建/root/production目录
mkdir -p /root/production

进入到/root/production目录
cd /root/production

克隆git项目,克隆后默认存在git项目名的文件夹下
git clone [email protected]:/root/test.git

进入项目
cd test

执行python代码
python3 hello.py

Jenkins使用五:创建部署任务

 

执行构建

Jenkins使用五:创建部署任务

 

相关文章:

  • 2021-12-16
  • 2021-10-31
  • 2022-12-23
  • 2021-08-28
  • 2021-05-31
  • 2021-06-22
  • 2021-07-04
猜你喜欢
  • 2021-06-02
  • 2021-12-27
  • 2021-11-17
  • 2022-12-23
  • 2021-08-22
  • 2021-04-23
相关资源
相似解决方案