def activate_new_relic(m2ee, app_name): if buildpackutil.get_new_relic_license_key() is None: logger.debug( 'Skipping New Relic setup, no license key found in environment') return logger.info('Adding new relic') m2ee_section = m2ee.config._conf['m2ee'] if 'custom_environment' not in m2ee_section: m2ee_section['custom_environment'] = {} m2ee_section['custom_environment']['NEW_RELIC_LICENSE_KEY'] = ( buildpackutil.get_new_relic_license_key()) m2ee_section['custom_environment']['NEW_RELIC_APP_NAME'] = app_name m2ee_section['custom_environment']['NEW_RELIC_LOG'] = ( os.path.abspath('newrelic/agent.log')) m2ee.config._conf['m2ee']['javaopts'].append('-javaagent:{path}'.format( path=os.path.abspath('newrelic/newrelic.jar')))
def activate_new_relic(m2ee, app_name): if buildpackutil.get_new_relic_license_key() is None: logger.debug( "Skipping New Relic setup, no license key found in environment") return logger.info("Adding new relic") m2ee_section = m2ee.config._conf["m2ee"] if "custom_environment" not in m2ee_section: m2ee_section["custom_environment"] = {} m2ee_section["custom_environment"][ "NEW_RELIC_LICENSE_KEY"] = buildpackutil.get_new_relic_license_key() m2ee_section["custom_environment"]["NEW_RELIC_APP_NAME"] = app_name m2ee_section["custom_environment"]["NEW_RELIC_LOG"] = os.path.abspath( "newrelic/agent.log") m2ee.config._conf["m2ee"]["javaopts"].append("-javaagent:{path}".format( path=os.path.abspath("newrelic/newrelic.jar")))
def activate_new_relic(m2ee, app_name): if buildpackutil.get_new_relic_license_key() is None: logger.debug( 'Skipping New Relic setup, no license key found in environment' ) return logger.info('Adding new relic') m2ee_section = m2ee.config._conf['m2ee'] if 'custom_environment' not in m2ee_section: m2ee_section['custom_environment'] = {} m2ee_section['custom_environment']['NEW_RELIC_LICENSE_KEY'] = ( buildpackutil.get_new_relic_license_key() ) m2ee_section['custom_environment']['NEW_RELIC_APP_NAME'] = app_name m2ee_section['custom_environment']['NEW_RELIC_LOG'] = ( os.path.abspath('newrelic/agent.log') ) m2ee.config._conf['m2ee']['javaopts'].append( '-javaagent:{path}'.format( path=os.path.abspath('newrelic/newrelic.jar') ) )
def copy_buildpack_resources(): shutil.copy( os.path.join(BUILDPACK_DIR, "m2ee.yaml"), os.path.join(DOT_LOCAL_LOCATION, "m2ee.yaml"), ) shutil.copy( os.path.join(BUILDPACK_DIR, "start.py"), os.path.join(BUILD_DIR, "start.py"), ) shutil.copytree(os.path.join(BUILDPACK_DIR, "nginx"), os.path.join(BUILD_DIR, "nginx")) shutil.copytree(os.path.join(BUILDPACK_DIR, "lib"), os.path.join(BUILD_DIR, "lib")) shutil.copy( os.path.join(BUILDPACK_DIR, "bin", "mendix-logfilter"), os.path.join(BUILD_DIR, "bin", "mendix-logfilter"), ) if buildpackutil.get_new_relic_license_key(): shutil.copytree( os.path.join(BUILDPACK_DIR, "newrelic"), os.path.join(BUILD_DIR, "newrelic"), )