Automatic deployment scripts for Google AppEngine

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.