jenkins pipeline 写法
pipeline { agent any stages { stage('合服') { steps { sh ''' sh /data/fytx_hefuceshi_s005a/script/hefu/jenkin_script.bak/merge.sh ''' } } stage('重启后台游戏服') { input { message "是否修改了后台配置?" ok "已修改" submitter "root,majunjie" } steps { sh ''' ssh -o StrictHostKeyChecking=no root@10.21.210.105 \'PATH=/usr/local/python2.7/bin:$PATH ; cd /home/game_analys && sh uwsgi_reboot.sh && cd /home/game_service && sh uwsgi_reboot.sh\' cd /data/fytx_hefuceshi_s005a/py_service && sh login_service.sh restart && sh pay_service.sh restart && \ cd /data/fytx_hefuceshi_s005a/server && ./start.sh ''' } } stage('还原') { input { message "测试完成,后台配置是否还原?" ok "已还原" submitter "root,majunjie" } steps { sh ''' ssh -o StrictHostKeyChecking=no root@10.21.210.105 'PATH=/usr/local/python2.7/bin:$PATH ;cd /home/game_analys && sh uwsgi_reboot.sh && cd /home/game_service && sh uwsgi_reboot.sh' cd /data/fytx_hefuceshi_s005a/script/hefu/jenkin_script.bak/ && sh recover.sh ''' } } } }
一些事情一直在干,说不定以后就结果了呢
本文来自博客园,作者:chenjianwen,转载请注明原文链接:https://www.cnblogs.com/chenjw-note/p/15421489.html