#NEWLINE# def get_build_info( ) : #NEWLINE# #INDENT# info = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if os . environ . get ( 'TDDIUM' ) : #NEWLINE# #INDENT# info [ 'branch' ] = os . environ . get ( 'TDDIUM_CURRENT_BRANCH' ) #NEWLINE# info [ 'commit' ] = os . environ . get ( 'TDDIUM_CURRENT_COMMIT' ) #NEWLINE# info [ 'build_vendor' ] = 'SolanoCI' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if os . environ . get ( 'CIRCLECI' ) : #NEWLINE# #INDENT# info [ 'branch' ] = os . environ . get ( 'CIRCLE_BRANCH' ) #NEWLINE# info [ 'commit' ] = os . environ . get ( 'CIRCLE_COMMIT' ) #NEWLINE# info [ 'build_vendor' ] = 'CircleCI' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if os . environ . get ( 'bamboo_buildKey' ) : #NEWLINE# #INDENT# info [ 'branch' ] = os . environ . get ( 'bamboo_repository_branch_name' ) #NEWLINE# info [ 'commit' ] = os . environ . get ( 'bamboo_repository_revision_number' ) #NEWLINE# info [ 'build_vendor' ] = 'Bamboo' #NEWLINE# job_key = os . environ . get ( 'bamboo_shortJobKey' ) #NEWLINE# job_build_key = os . environ . get ( 'bamboo_buildResultKey' ) #NEWLINE# build_id = job_build_key #NEWLINE# build_id = build_id . replace ( ( '-%s-' % job_key ) , '-' ) #NEWLINE# build_url = os . environ . get ( 'bamboo_buildResultsUrl' ) #NEWLINE# build_url = build_url . replace ( job_build_key , build_id ) #NEWLINE# info [ 'build_id' ] = build_id #NEWLINE# info [ 'build_url' ] = build_url #NEWLINE# info [ 'env_prefix' ] = 'bamboo_' #NEWLINE# info [ 'env_mask' ] = '_PASSWORD' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# click . echo ( ( 'Detected build information: %s' % pprint . pformat ( info ) ) ) #NEWLINE# return info