Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1123760
  • 博文数量: 188
  • 博客积分: 2267
  • 博客等级: 大尉
  • 技术积分: 1907
  • 用 户 组: 普通用户
  • 注册时间: 2011-08-01 11:17
文章分类

全部博文(188)

文章存档

2016年(16)

2015年(16)

2014年(12)

2013年(32)

2012年(45)

2011年(67)

分类: Python/Ruby

2015-03-19 11:46:09


点击(此处)折叠或打开

  1. #!/usr/bin/python
  2. #coding:utf-8

  3. ### 导入模块
  4. import time
  5. import os
  6. import shutil

  7. #定义变量
  8. date = time.strftime("%m%d")
  9. src1 = "/root/"+date+"/WebContent"
  10. src2 = "/root/"+date+"/yiren.war"
  11. src3 = "/root/default-web.xml"
  12. src4 = "/root/domain.xml"
  13. comm1 = "\cp -rf " +src1 +" /opt/nginx/"
  14. comm2 = "asadmin -W /etc/gf.pass deploy "+src2
  15. dst = "/tmp"

  16. #print "today is:", date

  17. if os.path.exists(src1):
  18. # shutil.copy(src1, dst)
  19.     os.system(comm1)
  20.     print "statis is OK!"
  21. else:
  22.     print "static is not deploy!"
  23. if os.path.exists(src2):
  24.     os.system('asadmin -W /etc/gf.pass undeploy yiren')
  25.     os.system(comm2)
  26.     shutil.copy(src3, "/usr/local/glassfish3/glassfish/domains/yiren/config/")
  27.     shutil.copy(src4, "/usr/local/glassfish3/glassfish/domains/yiren/config/")
  28.     os.system('asadmin restart-domain')
  29.     print "deploy sucessfull"
  30. else:
  31.     print "nothing to do !"




阅读(865) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

williamherry2015-03-19 13:34:52

牛逼