#NEWLINE# @ click . command ( name = 'deploy' , help = 'Runs a full deployment of the code including unused stale package metadata, setting up dependencies, deploying the code, and optionally running tests' , context_settings = { #NEWLINE# #INDENT# 'color' : True , #NEWLINE# #UNINDENT# } ) #NEWLINE# @ click . option ( '--run-tests' , default = False , is_flag = True , help = 'If set, run tests as part of the deployment.  Defaults to not running tests' ) #NEWLINE# @ click . option ( '--full-delete' , default = False , is_flag = True , help = 'If set, delete all package metadata at the start of the build instead of doing an incremental delete.  **WARNING**: This deletes all package metadata, use with caution.  This option can be necessary if you have reference issues during an incremental delete deployment.' ) #NEWLINE# @ click . option ( '--ee-org' , default = False , is_flag = True , help = 'If set, use the deployUnmanagedEE target which prepares the code for loading into a production Enterprise Edition org.  Defaults to False.' ) #NEWLINE# @ click . option ( '--deploy-only' , default = False , is_flag = True , help = 'If set, runs only the deployWithoutTest target.  Does not clean the org, update dependencies, or run any tests.  This option invalidates all other options' ) #NEWLINE# @ pass_config #NEWLINE# def deploy_unmanaged( config , run_tests , full_delete , ee_org , deploy_only ) : #NEWLINE# #INDENT# target = None #NEWLINE# if deploy_only : #NEWLINE# #INDENT# target = 'deployWithoutTest' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ee_org : #NEWLINE# #INDENT# target = 'deployUnmanagedEE' #NEWLINE# if run_tests : #NEWLINE# #INDENT# target += ' runAllTests' #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if run_tests : #NEWLINE# #INDENT# target = 'deployCI' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# target = 'deployDevOrg' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# env = get_env_cumulusci ( config ) #NEWLINE# env . update ( get_env_sf_org ( config ) ) #NEWLINE# env . update ( get_env_apex_tests ( config ) ) #NEWLINE# if ( not deploy_only ) : #NEWLINE# #INDENT# env [ 'UNMANAGED_DESTROY_MODE' ] = 'incremental' #NEWLINE# if full_delete : #NEWLINE# #INDENT# env [ 'UNMANAGED_DESTROY_MODE' ] = 'full' #NEWLINE# #UNINDENT# click . echo ( ( 'Metadata deletion mode: %s' % env [ 'UNMANAGED_DESTROY_MODE' ] ) ) #NEWLINE# #UNINDENT# p = run_ant_target ( target , env , config , check_credentials = True )