-
Notifications
You must be signed in to change notification settings - Fork 5
Added a feature to enable glowroot in tomcat #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2f0ec8e
Merge pull request #139 from EyeSeeTea/development
Ramon-Jimenez e1a203a
Merge pull request #147 from EyeSeeTea/development
Ramon-Jimenez bbe5286
Added a feature to enable an open-source APM: glowroot to the tomcat …
cgbautista 7011a1f
Code cleanup
cgbautista e1ed7a8
Avoid warning output from unzip
cgbautista 344243a
status was always 0 because incorrect placement of parenthesis
cgbautista 94a3dce
Fixed an error when `d2-docker logs` was used.
cgbautista 9696334
Added an option in the docker-compose.yml to ensure there is no "search"
cgbautista 9baa64e
Moved 4 functions inside a condition to avoid reseting container folders
cgbautista a4b6432
extracted setup_tomcat, since it will copy any dhis.conf or server.xml
cgbautista 029174b
Fix in tabs
cgbautista 07bc6a9
After stopping the running containers, the command "docker compose ps
cgbautista c394814
Fixed formatting and Readme
cgbautista f7aa689
Merge pull request #153 from EyeSeeTea/fix/rm_command_did_not_clear_s…
ifoche d9bbdce
Merge pull request #152 from EyeSeeTea/fix/containers_should_keep_new…
ifoche 1397ec1
Merge pull request #151 from EyeSeeTea/fix/dns_search_domains
ifoche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import atexit | ||
| import json | ||
| import os | ||
| import shutil | ||
| import tempfile | ||
| import urllib.request | ||
| import zipfile | ||
| from d2_docker import utils | ||
|
|
||
| GLOWROOT_DEFAULT_PORT = "4000" | ||
|
|
||
| def get_latest_glowroot_url(): | ||
| glowroot_releases_url = "https://api.github.com/repos/glowroot/glowroot/releases/latest" | ||
| glowroot_download_url = "https://github.com/glowroot/glowroot/releases/download" | ||
| with urllib.request.urlopen(glowroot_releases_url) as response: | ||
| data = response.read().decode() | ||
| release_info = json.loads(data) | ||
|
|
||
| tag_name = release_info["tag_name"] | ||
| return "{}/{}/glowroot-{}-dist.zip".format(glowroot_download_url, tag_name, tag_name.lstrip("v")) | ||
|
|
||
| def get_glowroot_zip(command, glowroot_zip, glowroot): | ||
| logger = utils.logger | ||
| if isinstance(command, list) and command[0] == "up": | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. keeping the spirit of immutability, I'd add an explicit else to better manage glowroot_path. |
||
| glowroot_file = tempfile.NamedTemporaryFile(delete=False, prefix="glowroot_", suffix=".zip", dir="/tmp") | ||
| glowroot_path = glowroot_file.name | ||
|
|
||
| atexit.register(lambda: os.remove(glowroot_path) if os.path.exists(glowroot_path) else None) | ||
| if glowroot_zip: | ||
| logger.debug("Copy zip file: {} -> {}".format(glowroot_zip, glowroot_path)) | ||
| shutil.copy(glowroot_zip, glowroot_path) | ||
| elif glowroot: | ||
| glowroot_url = get_latest_glowroot_url() | ||
| logger.info("Download file: {}".format(glowroot_url)) | ||
| urllib.request.urlretrieve(glowroot_url, glowroot_path) | ||
| else: | ||
| # empty zipfile | ||
| with zipfile.ZipFile(glowroot_path, mode="w") as zf: | ||
| pass | ||
| else: | ||
| glowroot_path = None | ||
|
|
||
| return utils.get_absfile_for_docker_volume(glowroot_path) | ||
|
|
||
| def get_port_glowroot(glowroot_port, glowroot_zip, glowroot): | ||
| port = glowroot_port if glowroot_port else GLOWROOT_DEFAULT_PORT | ||
| return "{}:{}".format(port, GLOWROOT_DEFAULT_PORT) if (glowroot_port or glowroot_zip or glowroot) else None | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.