#NEWLINE# def configure( ) : #NEWLINE# #INDENT# 'Upload supervisor configuration files.' #NEWLINE# user = cget ( 'user' ) #NEWLINE# sdir = cset ( 'supervisor_dir' , pjoin ( cget ( 'service_dir' ) , 'supervisor' ) ) #NEWLINE# slogdir = cset ( 'supervisor_log_dir' , pjoin ( cget ( 'log_dir' ) , 'supervisor' ) ) #NEWLINE# cset ( 'supervisor_process_base' , cget ( 'project_name' ) . replace ( '-' , '_' ) ) #NEWLINE# cset ( 'supervisor_process_id' , ( '%s%s' % ( cget ( 'supervisor_process_base' ) , '_supervisor' ) ) ) #NEWLINE# dirs = [ '' , 'config' , cget ( 'project_name' ) ] #NEWLINE# dirs = [ pjoin ( sdir , l ) for l in dirs ] #NEWLINE# log_dirs = [ '' , cget ( 'project_name' ) , 'child_auto' , 'solr' ] #NEWLINE# log_dirs = [ pjoin ( slogdir , l ) for l in log_dirs ] #NEWLINE# create_target_directories ( ( dirs + log_dirs ) , '700' , user ) #NEWLINE# context = dict ( env [ 'ctx' ] ) #NEWLINE# local_dir = local_files_dir ( 'supervisor' ) #NEWLINE# dest_dir = pjoin ( sdir , 'config' ) #NEWLINE# confs = cget ( 'supervisor_files' ) #NEWLINE# show ( yellow ( ( 'Uploading service configuration files: %s.' % confs ) ) ) #NEWLINE# for name in confs : #NEWLINE# #INDENT# source = pjoin ( local_dir , name ) #NEWLINE# destination = pjoin ( local_dir , name ) #NEWLINE# if isdir ( source ) : #NEWLINE# #INDENT# upload_templated_folder_with_perms ( source , local_dir , dest_dir , context , mode = '644' , directories_mode = '700' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# upload_template_with_perms ( source , destination , context , mode = '644' ) #NEWLINE# #UNINDENT# #UNINDENT# scripts = [ 'supervisorctl.sh' , 'supervisord.sh' ] #NEWLINE# for script_name in scripts : #NEWLINE# #INDENT# source = pjoin ( cget ( 'local_root' ) , 'deployment' , 'scripts' , script_name ) #NEWLINE# destination = pjoin ( cget ( 'script_dir' ) , script_name ) #NEWLINE# upload_template_with_perms ( source , destination , context , mode = '755' )