from fabric.api import *
from fabric.contrib.console import confirm

appengine_dir='appengine-web/src'
goldquest_dir='src'

def update():
    # update to latest code from repo
    local('git pull') 

def test():
    local("nosetests -m 'Test|test_' -w %(path)s" % dict(path=goldquest_dir))
    # jslint
    # pychecker
    # run jasmine tests

def compile():
    # Minimize javascript using google closure.
    local("java -jar ~/bin/compiler.jar --js %(path)s/javascript/game.js --js_output_file %(path)s/javascript/game.min.js" % dict(path=appengine_dir))

def deploy_appengine():
    local("appcfg.py update " + appengine_dir)

def prepare_deploy():
    test()
    compile()

def deploy():
    update()
    prepare_deploy()
    deploy_appengine()
    # tweet about release

from fabric.api import *
from fabric.contrib.console import confirm

cfg = dict(
    appengine_dir='appengine-web/src',
    goldquest_dir='src',
    appengine_token='',
)

def update():
    # update to latest code from repo
    local('git pull') 

def test():
    local("nosetests -m 'Test|test_' -w %(goldquest_dir)s" % cfg)
    # jslint
    # pychecker
    # run jasmine tests

def compile():
    # Minimize javascript using google closure.
    local("java -jar ~/bin/compiler.jar --js %(appengine_dir)s/javascript/game.js --js_output_file %(appengine_dir)s/javascript/game.min.js" % cfg)

def deploy_appengine():
    local("appcfg.py --oauth2_refresh_token=%(appengine_token)s update %(appengine_dir)s" % cfg)

def prepare_deploy():
    test()
    compile()

def deploy():
    update()
    prepare_deploy()
    deploy_appengine()
    # tweet about release

Add support for appengine update oauth2 token in deploy script.
NEW: Add support for appengine update oauth2 token in deploy script.

  from fabric.api import *
  from fabric.contrib.console import confirm
  
+ cfg = dict(
- appengine_dir='appengine-web/src'
+     appengine_dir='appengine-web/src',
- goldquest_dir='src'
+     goldquest_dir='src',
+     appengine_token='',
+ )
  
  def update():
      # update to latest code from repo
      local('git pull') 
  
  def test():
-     local("nosetests -m 'Test|test_' -w %(path)s" % dict(path=goldquest_dir))
+     local("nosetests -m 'Test|test_' -w %(goldquest_dir)s" % cfg)
      # jslint
      # pychecker
      # run jasmine tests
  
  def compile():
      # Minimize javascript using google closure.
-     local("java -jar ~/bin/compiler.jar --js %(path)s/javascript/game.js --js_output_file %(path)s/javascript/game.min.js" % dict(path=appengine_dir))
+     local("java -jar ~/bin/compiler.jar --js %(appengine_dir)s/javascript/game.js --js_output_file %(appengine_dir)s/javascript/game.min.js" % cfg)
  
  def deploy_appengine():
-     local("appcfg.py update " + appengine_dir)
+     local("appcfg.py --oauth2_refresh_token=%(appengine_token)s update %(appengine_dir)s" % cfg)
  
  def prepare_deploy():
      test()
      compile()
  
  def deploy():
      update()
      prepare_deploy()
      deploy_appengine()
      # tweet about release
  
Add support for appengine update oauth2 token in deploy script.
## Code Before:
from fabric.api import *
from fabric.contrib.console import confirm

appengine_dir='appengine-web/src'
goldquest_dir='src'

def update():
    # update to latest code from repo
    local('git pull') 

def test():
    local("nosetests -m 'Test|test_' -w %(path)s" % dict(path=goldquest_dir))
    # jslint
    # pychecker
    # run jasmine tests

def compile():
    # Minimize javascript using google closure.
    local("java -jar ~/bin/compiler.jar --js %(path)s/javascript/game.js --js_output_file %(path)s/javascript/game.min.js" % dict(path=appengine_dir))

def deploy_appengine():
    local("appcfg.py update " + appengine_dir)

def prepare_deploy():
    test()
    compile()

def deploy():
    update()
    prepare_deploy()
    deploy_appengine()
    # tweet about release

## Instruction:
Add support for appengine update oauth2 token in deploy script.
## Code After:
from fabric.api import *
from fabric.contrib.console import confirm

cfg = dict(
    appengine_dir='appengine-web/src',
    goldquest_dir='src',
    appengine_token='',
)

def update():
    # update to latest code from repo
    local('git pull') 

def test():
    local("nosetests -m 'Test|test_' -w %(goldquest_dir)s" % cfg)
    # jslint
    # pychecker
    # run jasmine tests

def compile():
    # Minimize javascript using google closure.
    local("java -jar ~/bin/compiler.jar --js %(appengine_dir)s/javascript/game.js --js_output_file %(appengine_dir)s/javascript/game.min.js" % cfg)

def deploy_appengine():
    local("appcfg.py --oauth2_refresh_token=%(appengine_token)s update %(appengine_dir)s" % cfg)

def prepare_deploy():
    test()
    compile()

def deploy():
    update()
    prepare_deploy()
    deploy_appengine()
    # tweet about release
