Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

appdynamics custom job log files - fix #181 #225

Merged
merged 2 commits into from
May 4, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions runtime/opt/taupage/runtime/Docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
import subprocess
import time
import yaml
import glob
import shutil
import os

from taupage import is_sensitive_key, CREDENTIALS_DIR, get_or, get_default_port, get_token

Expand Down Expand Up @@ -130,10 +129,14 @@ def get_volume_options(config: dict):
yield '/etc/ssl/certs:/etc/ssl/certs:ro'

# if AppDynamics applicationname is in the config mount the agent to the container

# TODO: we should also check if the directory really exists.
if 'appdynamics_application' in config:
yield '-v'
yield '/opt/proprietary/appdynamics-jvm:/agents/appdynamics-jvm:rw'
if os.path.isdir('/opt/proprietary/appdynamics-jvm'):
yield '-v'
yield '/opt/proprietary/appdynamics-jvm:/agents/appdynamics-jvm:rw'
if os.path.isdir('/opt/proprietary/appdynamics-machine/monitors/analytics-agent/conf/job'):
yield '-v'
yield '/opt/proprietary/appdynamics-machine/monitors/analytics-agent/conf/job:/agents/jobfiles:rw'

# typically, for continuous integration/delivery systems, you need to be able to build
# Docker images and there is no better solution currently.
Expand Down Expand Up @@ -321,12 +324,6 @@ def main(args):
logging.error('Docker run failed: %s', mask_command(str(e).split(' ')))
sys.exit(1)

# copy job files from docker container to the machine agent
dest_dir = "/opt/proprietary/appdynamics-machine/monitors/analytics-agent/conf/job/"
for file in glob.glob(r'/var/lib/docker/aufs/mnt/*/appdynmacis/jobs/*.job'):
print('copy jobfile: ', file)
shutil.copy(file, dest_dir)

wait_for_health_check(config)


Expand Down