返回顶部

Jenkins+Ansible+Gitlab自动化部署三剑客(四)--Jenkins Linux shell集成

Jenkins应用--Linux shell集成

1.新建项目

 

 2.构建添加shell

 

#!/bin/sh

user=`whoami`

if [ $user == 'deploy' ]
then
    echo "Hello, my name is $user"
else
    echo "Sorry, I am not $user"
fi

ip addr

cat /etc/system-release

free -m

df -h

py_cmd=`which python`

$py_cmd --version

 

 3.执行构建

 

posted @ 2020-02-20 20:09  Will_D_Zhang  阅读(188)  评论(0编辑  收藏  举报