fix: when running in a docker container, save monitor command output in a file#384
Merged
fix: when running in a docker container, save monitor command output in a file#384
Conversation
…in a file Currently, only the regular result is output However, the monitor result has some useful info such as the scan URL
385757d to
9d5cd3c
Compare
adrukh
commented
Feb 27, 2019
| runCmdAsDockerUser "PATH=${PATH} snyk monitor --json ${SNYK_PARAMS} \ | ||
| ${ADDITIONAL_ENV} | jq -r \".uri\" | awk '{print \"<center><a target=\\\"_blank\\\" href=\\\"\" \$0 \"\\\">View On Snyk.io</a></center>\"}' > \"${PROJECT_PATH}/${PROJECT_FOLDER}/${HTML_FILE}\" 2>\"${ERROR_FILE}\"" | ||
| runCmdAsDockerUser "PATH=$PATH snyk monitor --json ${SNYK_PARAMS} ${ADDITIONAL_ENV} > ${MONITOR_OUTPUT_FILE} 2>$ERROR_FILE" | ||
| runCmdAsDockerUser "cat ${MONITOR_OUTPUT_FILE} | jq -r \".uri\" | awk '{print \"<center><a target=\\\"_blank\\\" href=\\\"\" \$0 \"\\\">View On Snyk.io</a></center>\"}' > \"${PROJECT_PATH}/${PROJECT_FOLDER}/${HTML_FILE}\" 2>>\"${ERROR_FILE}\"" |
Contributor
Author
There was a problem hiding this comment.
@julienduchesne notice the extra > in ... 2>>\"${ERROR_FILE}\"" - I added it so that in case of a failure on the second command, stderr is appended to the file instead of overwriting it.
odinn1984
approved these changes
Feb 27, 2019
Contributor
Author
|
@julienduchesne this is now merged and will be released with Thanks again for this contribution! |
|
🎉 This PR is included in version 1.135.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Contributor
|
Thanks @adrukh ! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Currently, only the regular result is output
However, the monitor result has some useful info such as the scan URL
This merges #381 as an internal contribution to overcome CI.