Did you register n apps on the appengine? Every time code update is very painful?!
After I have been suffering for a long time, I finally found a way to automatically deploy, and write a script to share with you all
deploy.py
#!/usr/bin/env python# -*- coding: utf-8 -*-# 将 {project_name} 替换成你的项目目录# 将 {password} 替换成你的密码文件# 将 {email} 替换成你的emailimport sysimport osimport urllib2def deploy(no): tpl = open(‘app.yaml‘, ‘rb‘) try: tpl_data = tpl.read().replace(‘{{no}}‘, str(no)) to_f = open(‘{project_name}/app.yaml‘, ‘wb‘) try: to_f.write(tpl_data) finally: to_f.close() finally: tpl.close() os.system(‘appcfg.py --passin --email={email} update {project_name} < {password}‘)if __name__ == ‘__main__‘: start, end = int(sys.argv[1]), int(sys.argv[2]) + 1 for i in range(start, end): deploy(i)
App.yaml
application: demo{{no}}version: 1runtime: pythonapi_version: 1handlers:- url: .* script: main.py
Run
# 慢慢等吧,^_^python deploy.py 0, 10000
Have love
^_^ want to be useful to you.
Automatic deployment scripts for Google AppEngine